From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sylvain Pion To: law@cygnus.com Cc: egcs@cygnus.com Subject: Re: /internet Date: Thu, 17 Dec 1998 04:43:00 -0000 Message-id: <19981217134318.C9897@rigel.inria.fr> References: <199812161958.LAA29146@atrus.synopsys.com> <28398.913854887@hurl.cygnus.com> X-SW-Source: 1998-12/msg00630.html On Wed, Dec 16, 1998 at 05:34:47PM -0700, Jeffrey A Law wrote: > [...] Though > I believe in the case reassociating a series of multiplies we are safe. > > 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. If you want that, you'd better first _prove_ that it works in every case. But you won't be able to do so because it's false. It might be true when the following both conditions are met: - no intermediate overflow/underflow appears (nor denormalized numbers). - the rounding mode is set to nearest. I'd be interested in reading the proof in this case (if it's true). Case if you have an intermediate overflow is easy: DBL_MAX * DLB_MAX * DBL_MIN gives you either Inf or DBL_MAX. Case when rounding is set to +Infinity: 0.1 * 0.1 * -1.0 doesn't give you the same result, try it. -- Sylvain