Tim Peters <t...@python.org> added the comment:

More extensive testing convinces me that pairing multiplication is no real help 
at all - the error distributions appear statistically indistinguishable from 
left-to-right multiplication.

I believe this has to do with the "condition numbers" of fp addition and 
multiplication, which are poor for fp addition and good for fp multiplication.  
Intuitively, fp addition systematically loses mounds of information whenever 
two addends in different binades are added (the lower bits in the addend in the 
binade closer to 0 are entirely lost).  But the accuracy of fp mult couldn't 
care which less which binades the inputs are in, provided only the result 
doesn't overflow or become subnormal.

For "random" vectors, pairing summation tends to keep addends close together in 
magnitude, which is "the real" reason it helps.  Left-to-right summation tends 
to make the difference in magnitude increase as it goes along (the running sum 
keeps getting bigger & bigger).

So, red herring.  The one thing that _can_ be done more-or-less 
straightforwardly and cheaply for fp mult is to prevent spurious overflow and 
underflow (including spurious trips into subnormal-land).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41458>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to