This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: * Re: What is acceptable for -ffast-math? (Was: associative law in combine)
- To: Linus Torvalds <torvalds at transmeta dot com>
- Subject: Re: * Re: What is acceptable for -ffast-math? (Was: associative law in combine)
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- Date: 30 Jul 2001 00:43:37 +0200
- Cc: <moshier at moshier dot ne dot mediaone dot net>, <tprince at computer dot org>, <gcc at gcc dot gnu dot org>
- Organization: CodeSourcery, LLC
- References: <Pine.LNX.4.33.0107291240270.881-100000@penguin.transmeta.com>
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