correction on three-operand addition

David G. Hough on validgh validgh!dghaSun.COM
Mon Jan 21 07:56:00 PST 1991


z + y + x is associative if only one rounding error occurs.  A complete
orthogonal set of operators would thus be z =

 z + y + x
 z + y - x
 z - y - x
-z + y + x
-z + y - x
-z - y - x

At the 11 Jan meeting we also discussed ASCII representations for NaNs again,
rehashing all the old arguments, and confirming (in my mind) the low
payoff of such discussions.

We also talked about max/min operators.  Should max(x,y) the identical to
max(y,x)?  If so then a simple-minded max operator based on comparison
won't yield the desired results in the face of signed zeros and NaNs.
Kahan also mentioned a "compare and swap" operator that might be thought of as
compareswap(&x,&y) that sets x to max(x,y) and y to min(x,y) since this is
what's often useful in small sorting problems such as arise in doubled-precision
arithmetic.



More information about the Numeric-interest mailing list