This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/13881] powl inaccurate for x86/x86_64
- From: "bruno at clisp dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Fri, 06 Apr 2012 15:24:30 +0000
- Subject: [Bug math/13881] powl inaccurate for x86/x86_64
- Auto-submitted: auto-generated
- References: <bug-13881-131@http.sourceware.org/bugzilla/>
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.