[MLton-user] timing anomoly

Florian Weimer fw at deneb.enyo.de
Sat Dec 22 03:31:08 PST 2007


* Sean McLaughlin:

>>From Goldberg: What every computer scientist should know about
> floating point arithmetic:
>
> "The importance of preserving parentheses cannot be
> overemphasized. The algorithms presented in theorems 3, 4 and 6 all depend
> on it. For example, in Theorem 6, the formula xh = mx - (mx - x) would reduce
> to xh = x if it weren't for parentheses, thereby destroying the entire
> algorithm.
> A language definition that does not require parentheses to be honored is
> useless for floating-point calculations."

I may have talked myself into a corner there. 8-)  But GCC on i386 does
suffer from an excess precision problem.  A straight implementation of
Theorem 6 does not work on Linux (and others, where the FPU control word
defaults to 80 bit mode).



More information about the MLton-user mailing list