next up previous
Next: Can Bad be OK? Up: Simplification or optimization Previous: Admissible optimizations

Bad optimizations

There are many mathematical simplifications that just don't always work, and thus DO NOT WORK. It is worse than tiresome to deal with compilers that claim they can rearrange floating-point operations to any ``mathematically equivalent'' expression. It is dangerous.

(A+B)-A is not the same as B. parentheses must be respected. example: (1.0+1.0E-20)- 1.0. A+B+C can be evaluated left to right or in some other order. Can we be clear when these are allowed?



Richard J. Fateman
Thu Aug 13 13:55:33 PDT 1998