This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug math/13881] powl inaccurate for x86/x86_64


http://sourceware.org/bugzilla/show_bug.cgi?id=13881

--- Comment #2 from Bruno Haible <bruno at clisp dot org> 2012-04-06 15:24:30 UTC ---
Find attached a test case. The approximations to 1e4932L and 1e3699L
are computed through an (exact) ldexpl call, from a mantissa that was
computed with GNU clisp's high-precision long-float numbers.

$ gcc -Wall foo.c -lm
$ ./a.out

Expected result (without any rounding errors):

x = 1e+4932
y = 0.75
x^y = 1e+3699
1

Actual result (on x86 and x86_64):

x = 1.000000000000000000006018949387963891324e+4932
y = 0.75
x^y = 1.000000000000000298896762326719536039811e+3699
1.000000000000000298914538954253572455855

As you can see:
1) x^y has only 15 valid digits after the decimal point.
2) The printf of x has 22 correct digits after the decimal point; this matches
the 64 mantissa bits in an x86 'long double'.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]