What processor are you running Roger?
I cannot get anything like that speed on a celeron 2 GHz, J601c
y=: 10000 * _0.5 + 1e6 [EMAIL PROTECTED] 0
ts=: 6!:2 , 7!:[EMAIL PROTECTED]
ts '<.y'
1.00667 1.25835e7
From: Roger Hui <[EMAIL PROTECTED]>
Reply-To: General forum <[email protected]>
To: General forum <[email protected]>
Subject: Re: [Jgeneral] large space overhead
Date: Mon, 12 Feb 2007 22:51:06 -0800
<.y and >.y on floating point arguments in the
range of integers have been made leaner and
slightly faster.
y=: 10000 * _0.5 + 1e6 [EMAIL PROTECTED] 0
ts=: 6!:2 , 7!:[EMAIL PROTECTED]
NB. J6.02x
ts '<.y'
0.125669 4.19488e6
NB. J6.01
ts '<.y'
0.135530 1.25835e7
----- Original Message -----
From: Roger Hui <[EMAIL PROTECTED]>
Date: Monday, February 12, 2007 10:00 pm
Subject: Re: [Jgeneral] large space overhead
> I have looked further into the matter.
>
> y=: 1000 * 1e6 [EMAIL PROTECTED] 0
> 7!:2 '<.y'
> 12583552
>
> One expects that it should take 4 bytes per
> element but it takes more than 8. The problem
> is that <.y uses an intermediate result which
> is float and then converts it into integers
> if possible, to accommodate cases like <.1e20 .
> So in the cases
>
> integer <.@:* float
> integer <.@ * float
>
> the problem lies in the monad <. . In contrast,
>
> integer <[EMAIL PROTECTED] integer
>
> does not suffer from this problem because the
> entire operation can be done internally using
> integer operations.
>
> A way to improve the monad <. (and >.) is to
> assume that the final result is all integers,
> expected to be by far the most common case,
> and handle the case where the result must be
> floats as an exception. We will see after this
> is done whether it is worthwhile to implement
> integer <[EMAIL PROTECTED] float in special code.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
_________________________________________________________________
MSN Hotmail is evolving check out the new Windows Live Mail
http://ideas.live.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm