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: * Re: What is acceptable for -ffast-math? (Was: associative law in combine)


Linus Torvalds <torvalds@transmeta.com> writes:

| On Sun, 29 Jul 2001, Stephen L Moshier wrote:
| >
| > > Why not make this easier for the user:
| > > - default to non-IEEE, but "reasonably safe".
| >
| > The default GCC behavior is not to allow any optimization
| > that could change the value of an expression.  That rule is easy
| > for users to understand and surely it is a good rule to keep.
| >
| > Floating point arithmetic, IEEE or otherwise, does not obey the
| > associative or distributive laws.
| 
| This is YOUR opinion.
| 
| But most people who write floating point code do not think that way. They
| consider FP to be "mathematically exact" (which _does_ obey associative
| and distributive laws), and they write their programs that way.

Wrong.  

Floating point arithemic is neither associative nor distributive.
And people who actually write numerical programs for living do know
that. 

If correctness is not a criterium then, it is faster not to compte at
all. 

-- Gaby


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