Re: vector of bin indices using histogram? [message #50768 is a reply to message #50766] |
Wed, 18 October 2006 09:25   |
Foldy Lajos
Messages: 268 Registered: October 2001
|
Senior Member |
|
|
On Wed, 18 Oct 2006, David Fanning wrote:
> =?ISO-8859-2?Q?F=D6LDY_Lajos?= writes:
>
>> oops, I have to correct myself: FDIV latency is 23 clock cycles for float,
>> 38 for double, and 43 for long double. Anyway, it is greater than 7.
>
> Well, the multiplication is actually a bit faster on
> my machine (Windows) than the division. So I'm not
> at all sure how generalized this result is.
>
> Cheers,
> David
A little experiment with a surprising result, on a Pentium D 3.4 GHz with
linux and IDL 6.2. The array size is small to avoid memory access latency.
regards,
lajos
; md.pro <- cut here
a=sin(findgen(1000))*1e38
nrep=1000000l
t=systime(1)
for j=1l,nrep do b=a/2.
print, 'DIV: ', systime(1)-t
t=systime(1)
for j=1l,nrep do b=a*0.5
print, 'MUL: ', systime(1)-t
end
; md.pro <- cut here
IDL> .ru md
% Compiled module: $MAIN$.
DIV: 13.824564
MUL: 2.1084599
IDL> .ru md
% Compiled module: $MAIN$.
DIV: 13.793007
MUL: 2.0625601
IDL> .ru md
% Compiled module: $MAIN$.
DIV: 13.829693
MUL: 2.1155751
IDL>
|
|
|