[Numpy-discussion] Floating Point Difference between numpy and numarray

Warren Focke focke@slac.stanford....
Tue Sep 9 09:11:31 CDT 2008



On Tue, 9 Sep 2008, David Cournapeau wrote:

> We don't use SSE and co in numpy, and I doubt the compilers (even
> Intel one) are able to generate effective SSE for numpy ATM. Actually,
> double and float are about the same speed for x86 (using the x87 FPU
> and not the SSE units), because internally, the register is 80 bits
> wide when doing computation. The real difference is the memory
> pressure induced by double (8 bytes per items) compared to float when
> doing computation with double, and for certain operations, for a
> reason I don't understand (log, sin and co are as fast for float and
> double using the FPU, but sqrt and divide are twice faster for float,
> for example).

Some of the transcendental functions are implemented with polynomials, so should 
take constant time.  Others may use iterative algorithms, which would require 
fewer iterations to reach single accuracy than double.

w



More information about the Numpy-discussion mailing list