This is the mail archive of the
mailing list for the GCC project.
Re: What is acceptable for -ffast-math? (Was: associative law in combine)
- To: Gabriel Dos_Reis <gdosreis at sophia dot inria dot fr>
- Subject: Re: What is acceptable for -ffast-math? (Was: associative law in combine)
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Wed, 01 Aug 2001 23:18:39 +0200
- CC: Alexandre Oliva <aoliva at redhat dot com>, Gabriel Dos Reis <gdr at codesourcery dot com>, Gabriel Dos_Reis <Gabriel dot Dos_Reis at sophia dot inria dot fr>, Linus Torvalds <torvalds at transmeta dot com>, Tim Hollebeek <tim at hollebeek dot com>, Theodore Papadopoulo <Theodore dot Papadopoulo at sophia dot inria dot fr>, dewar at gnat dot com, amylaar at redhat dot com, gcc at gcc dot gnu dot org, moshier at moshier dot ne dot mediaone dot net, tprince at computer dot org
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <20010801122417.A2509@cj44686-b.reston1.va.home.com> <Pine.LNX.email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org>
Gabriel Dos_Reis wrote:
> I don't consider 0.5 * DBL_MAX to be at the "very limits of the number
Gaby, I'll try a different approach - I'm not going to say you are an
<elided> or your analysis is wrong, flawed, or biased.
I'm just going to point you at the topic of this thread: "What is
acceptable for -ffast-math ?".
Now, try for a moment to think with me. During the hoolabaloo around
the Pentium FDIV error, I actually went into our weather forecasting
code to count the floating point divisions per grid cell per time step
The grand total for the whole forecast period was 2.2x10^9.
That was end-of-1994. Nowadays, we have about 15 times more grid cells
and a 33 % longer forecast period. Because I don't want to do this
counting exercise again, I'll just assume the same number of divisions
per grid cell, per time step, i.e. 70.
That makes the total 20 x 2.2 x 10^9 ~ 0.5 x 10^11 divisions per
If we further assume that:
1) All of these divisions are of the form that allow the transformation.
2) Some forecast will hit your example.
3) The probability distribution for this hit is uniform (this assumption
is doubtful, because of the value involved).
this means that one in 2^53 / (0.5x10^11) ~ 10^5 forecasts will hit the
I'm sorry, but I do not have the time to wait for the off-chance that
this error will occur, so I'll happily apply this transformation.
Now, even given this, I would certainly heed Roberts advice that the
transformation should actually be a perceptable "optimisation".
In our case, I doubt this (but then, I - personally - am not interested
in anything less than a 10 % improvement).
Toon Moene - mailto:email@example.com - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)