On 1/10/07, ZINTEL Gerhard <gerhard.zintel at faurecia.com> wrote:
> Obviously I'm a bit stubborn, but in my mind optimized should give:...
> I know, it's all very well to say that but it's surely hard to code it.
"Optimize" never performs any mathematical transformations
(factorization, re-association...) to expressions; it simply looks for
common subexpressions. I believe this is intentional, since
transformations can change the floating-point result.
But please feel free to develop code which *does* perform various
transformations, and perhaps even does some sort of search among
alternatives based on reasonable criteria (smallest number of
multiplies, fastest overall speed, least susceptible to rounding
errors, etc.). It is not trivial, but shouldn't be all that
difficult, either. It would no doubt be a contribution that others
would find useful.
-s