Paul van Wamelen on Wed, 28 Aug 2002 01:01:55 -0500 (CDT)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

bug?


Dear all,

The following is strange but at least understandable:

? exp(10^-300)
%2 = 1.000000000000000000000000000
? %-1
%3 = 1.000000000000000000000000000 E-300
? % - 10^-300
%4 = 1.34971959 E-329

So exp of very small numbers are computed to large precision (I assume
because it is possible!) But then cos should work the same way, but it
doesn't:

? cos(10^-300)
%5 = 1.000000000000000000000000000
? %-1
%6 = -4.999999999999999999708086868 E-601

well sort of, but that isn't .5 to relative precision 28. It looks worse
if you up the precision:

? default(realprecision,100)
   realprecision = 105 significant digits (100 digits displayed)
? cos(10^-300) - (1 - 10^-600/2)
%11 =
2.91913131511413537189539175501010675755770891175910936852001807591773586414884430473814008517840
E-620

Shouldn't this be about 10^-700?

I'm using
                 GP/PARI CALCULATOR Version 2.1.1 (released)
                UltraSparc (MicroSparc kernel) 32-bit version
                (readline disabled, extended help available)

but I believe this behaviour is VERY old.

Sincerely,
Paul van Wamelen