This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: paranoia results (C and Fortran)
- To: emil at cls dot usask dot ca, egcs-bugs at egcs dot cygnus dot com
- Subject: Re: paranoia results (C and Fortran)
- From: N8TM at aol dot com
- Date: Mon, 12 Jul 1999 21:53:29 EDT
In a message dated 7/12/99 4:06:28 PM PST, emil@cls.usask.ca writes:
> DEFECT: Calculated 7.38905609548934539e+00 for
> (1 + (-1.11022302462515654e-16) ^ (-1.80143985094819840e+16);
> differs from correct value by -3.44130679508225512e-09 .
> This much error may spoil financial
> calculations involving tiny interest rates.
This would mean that you're using an unsatisfactory implementation of pow().
That's not directly under the control of egcs. I've worked out a powl() for
686 which passes all the usual tests, but I haven't detected any interest in
that. Definitely getting off-topic.
>>* is neither chopped nor correctly rounded.
/ is neither chopped nor correctly rounded.
Addition/Subtraction neither rounds nor chops.
Sticky bit used incorrectly or not at all.
FLAW: lack(s) of guard digits or failure(s) to correctly round or chop
(noted above) count as one flaw in the final tally below.
This simply means that you're invoking double rounding by running an x86 in
default mode, which rounds to 64 bits mantissa, and following up by rounding
to 53 bits. It's not the fault of egcs that this is a useful mode for
running this processor family. Set it to 53-bit rounding mode if you don't
like it, as certain other compilers do. When you run in single (float)
precision, you don't see this problem, as the 64-bit mantissa arithmetic
doesn't drop any bits.
Tim
tprince@computer.org