This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: /internet
- To: law at cygnus dot com
- Subject: Re: /internet
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Thu, 17 Dec 1998 01:52:17 +0000 (GMT)
- Cc: jbuck at Synopsys dot COM, moshier at mediaone dot net, tim at wagner dot Princeton dot EDU, tprince at cat dot e-mail dot com, bosch at gnat dot com, burley at gnu dot org, egcs at cygnus dot com, hjstein at bfr dot co dot il
> The rules for FP are different becuase it's not 100% certain that the
> results after reassociation will be the same as before reassociation. Though
> I believe in the case reassociating a series of multiplies we are safe.
Only if the exponent freely overflows and underflows. However, often you'll
get Inf for an overflow and 0 for an underflow.
And if you come close to an underflow, you might get de-normalized numbers.
> Again, I have no intention of reassociating a + 5 + b + c for FP because of
> overflow concerns. The same restrictions are not necessary for multiplies
> though as far as I can tell.
>
> I challenge anyone to come up with a case where a reassociation of
> a * b * c * d produces different results than ((a * b) * c) * d.
(DBL_MAX * (DBL_MIN * DBL_MIN)) * 4 is different from
((DBL_MAX * DBL_MIN) * DBL_MIN) * 4