There are 3 verbs in the family:

x <[EMAIL PROTECTED] d   integer quotient
d|x        integer remainder
(0,d)#:x   integer quotient and remainder

All three members of the family have been improved, 
with the largest improvement occurring when d is 
a positive power of 2.

Preliminary benchmarks:

x=: _2e5 + 1e6 [EMAIL PROTECTED] 4e5

ts=: 6!:2 , 7!:[EMAIL PROTECTED]
ts 'Expression'

Expression          J6.02x                J6.01            Ratio
x <[EMAIL PROTECTED] 256   0.0055291 4.19507e6   0.1623434 2.09723e7   29.36 
5.00
256 | x      0.0056425 4.19494e6   0.0257975 4.19494e6    4.57 1.00
0 256 #: x   0.0092815 8.38925e6   0.0600597 8.38925e6    6.47 1.00



----- Original Message -----
From: Roger Hui rhui000 at shaw.ca
Date: Sat Oct 21 05:27:23 HKT 2006
Subject: Re: [Jprogramming] Integer division, the faster one

Preliminary benchmarks:

ts=: 6!:2 , 7!:[EMAIL PROTECTED]
x=: 1e6 [EMAIL PROTECTED] 2e6
ts 'Expression'

Expression          J6.02x              J6.01            Factor
x <[EMAIL PROTECTED] 512   0.0054822 4.19507e6  0.136416 2.09723e7   23.80 5.00
x <[EMAIL PROTECTED] 17    0.0213073 4.19507e6  0.154837 2.09723e7    7.27 5.00


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to