[Numpy-discussion] Precision difference between dot and sum

Nadav Horesh nadavh at visionsense.com
Tue Nov 2 05:08:48 EDT 2010


"... Also, IIRC, 1.0 cannot be represented exactly as a float,"

 Not true

   Nadav


-----Original Message-----
From: numpy-discussion-bounces at scipy.org on behalf of Matthieu Brucher
Sent: Tue 02-Nov-10 11:05
To: Discussion of Numerical Python
Subject: Re: [Numpy-discussion] Precision difference between dot and sum
 
>> It would be great if someone could let me know why this happens.
>
> They don't use the same implementation, so such tiny differences are
> expected - having exactly the same solution would have been surprising,
> actually. You may be surprised about the difference for such a trivial
> operation, but keep in mind that dot is implemented with highly
> optimized CPU instructions (that is if you use ATLAS or similar library).

Also, IIRC, 1.0 cannot be represented exactly as a float, so the dot
way may be more wrong than the sum way.

Matthieu
-- 
Information System Engineer, Ph.D.
Blog: http://matt.eifelle.com
LinkedIn: http://www.linkedin.com/in/matthieubrucher
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion at scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 3356 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20101102/a24060da/attachment.bin>


More information about the NumPy-Discussion mailing list