This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: What is acceptable for -ffast-math? (Was: associative law in combine)



> While I agree that by default the compiler must follow "good rules", I 
> think that always disallowing optimisations which may lose some bits of 
> accuracy (when specified with a option switch of course) just because 
> it may hurt someone, somewhere, sometime is a little too strong.
> Full safety is IMHO impossible with floating point... Only the 
> programmer knows the accuracy of its input data (Linus called that 
> noise) and the accuracy he expects on its result.

Exactly ... and it isn't at all rare that the programmer knows exactly
how much noise is in the input data (little or none) and the how much
accuracy he expects in the result (as much as possible!).

Rewriting the programmers program in such a way that he gets
significantly less accuracy than he could reasonably expect is just
silly.

Noise is a red herring.  There is no reason why computation should
introduce more innaccuracy than they need to, especially in a ad hoc
way that is beyond the programmer's control.

-Tim


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]