This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Fix ldbl-128ibm acoshl inaccuracy (bug 16384)
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>
- Cc: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- Date: Wed, 1 Jan 2014 18:40:28 +0000
- Subject: Fix ldbl-128ibm acoshl inaccuracy (bug 16384)
- Authentication-results: sourceware.org; auth=none
This patch fixes bug 16384, ldbl-128ibm acoshl inaccuracy, which
showed up while attempting to regenerate ulps for powerpc-nofpu for
2.19. There were two separate problems, use of __log1p instead of
__log1pl and an insufficiently accurate constant value for log 2
(which this patch replaces by use of M_LN2l), each of which could
cause substantial inaccuracy in affected cases.
Tested for powerpc-nofpu.
(Note that ulps regeneration for powerpc is still a pain because of
libgcc bugs, especially the one discussed in glibc bug 15396 that
causes large inaccuracy for division involving subnormal numbers.)
2014-01-01 Joseph Myers <joseph@codesourcery.com>
[BZ #16384]
* sysdeps/ieee754/ldbl-128ibm/e_acoshl.c (ln2): Initialize with
M_LN2l.
(__ieee754_acoshl): Use __log1pl not __log1p.
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c b/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
index 8a4a5bb..b0b33f7 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
@@ -29,7 +29,7 @@
static const long double
one = 1.0L,
-ln2 = 6.93147180559945286227e-01L; /* 0x3FE62E42, 0xFEFA39EF */
+ln2 = M_LN2l;
long double
__ieee754_acoshl(long double x)
@@ -56,7 +56,7 @@ __ieee754_acoshl(long double x)
return __ieee754_logl(2.0*x-one/(x+__ieee754_sqrtl(t-one)));
} else { /* 1<x<2 */
t = x-one;
- return __log1p(t+__ieee754_sqrtl(2.0*t+t*t));
+ return __log1pl(t+__ieee754_sqrtl(2.0*t+t*t));
}
}
strong_alias (__ieee754_acoshl, __acoshl_finite)
--
Joseph S. Myers
joseph@codesourcery.com