Bug 13884 - exp10 inaccurate
Summary: exp10 inaccurate
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: math (show other bugs)
Version: 2.15
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-20 20:56 UTC by Joseph Myers
Modified: 2014-06-26 13:47 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Myers 2012-03-20 20:56:28 UTC
The generic implementations of exp10, exp10f, exp10l (math/e_exp10*) use exp (arg * log (10)) as their algorithm, which is inaccurate for large inputs (you need some extra precision for calculating log (10) and doing the multiplication).  For example, on x86_64, exp10f (36) has a 39ulp error, exp10 (305) has a 217ulp error and exp10l (4932) has a 5612ulp error.

It is likely that the x86 implementations of exp10f and exp10 are OK (because of the extra x87 precision used for internal calculations), but that of exp10l probably suffers the same issue as reported here (but I haven't tested the x86 functions).
Comment 1 Joseph Myers 2012-04-30 09:41:34 UTC
Accuracy for float only fixed by:

commit 9568c0c2255045456a09b441f89c6641e27a4bec
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Mon Apr 30 09:37:01 2012 +0000

    Fix exp10 spurious overflows (bug 13924).

double and long double still need to be fixed.
Comment 2 Joseph Myers 2012-05-06 18:24:49 UTC
Fixed by:

commit d8b82cad1b525bdcbfff88d218c7c45032e4a3af
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Sun May 6 18:23:44 2012 +0000

    Fix exp10 inaccuracy and exceptions (bugs 13884, 13914).