This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Draft "Unsafe fp optimizations" project description.
- To: gcc at gcc dot gnu dot org
- Subject: Re: Draft "Unsafe fp optimizations" project description.
- From: Ross Smith <ross dot s at ihug dot co dot nz>
- Date: Sun, 05 Aug 2001 12:13:52 +1200
- Organization: Ihug
- References: <20010804134535.DDEF3F2B6C@nile.gnat.com>
dewar@gnat.com wrote:
>
> > Example: A/B/C -> A/(B*C). Will overflow for about half of the
possible choices for B and C for
> > which the original didn't overflow.
>
> That's quite wrong, you have to be close to max_real, half is way way
> overstating the case.
I think what Toon meant was something like: if you throw all the
possible distinct values for a given FP representation into a sack, and
pick the operands at random from the sack, there's roughly a 50/50
chance that B*C will overflow or underflow.
The usefulness of the transformation derives from the fact that this is
rarely how operands are actually arrived at. :-)
--
Ross Smith <ross.s@ihug.co.nz> The Internet Group, Auckland, New Zealand
========================================================================
"Unix has always lurked provocatively in the background of the operating
system wars, like the Russian Army." -- Neal Stephenson