From 819e5d50dd4d10dc359037eba74c70e74cb42739 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 2 Jan 2014 16:35:46 +0000 Subject: Fix ldbl-128ibm logl inaccuracy (bug 16386). This patch fixes bug 16386, ldbl-128ibm logl inaccuracy (with consequent inaccuracy for lgammal) for arguments where the high double is subnormal, which showed up while attempting to regenerate ulps for powerpc-nofpu for 2.19. The problem here is logic failing to allow for subnormals when calculating the exponent of the argument. Tested for powerpc-nofpu. * sysdeps/ieee754/ldbl-128ibm/e_logl.c (__ieee754_logl): Adjust numbers with subnormal high part when calculating exponent. --- sysdeps/ieee754/ldbl-128ibm/e_logl.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sysdeps/ieee754') diff --git a/sysdeps/ieee754/ldbl-128ibm/e_logl.c b/sysdeps/ieee754/ldbl-128ibm/e_logl.c index b7db2b9784..58d6bc6972 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_logl.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_logl.c @@ -229,6 +229,14 @@ __ieee754_logl(long double x) /* Extract exponent and reduce domain to 0.703125 <= u < 1.40625 */ unsigned int w0; e = (int) (m >> 20) - (int) 0x3fe; + if (e == -1022) + { + x *= 0x1p106L; + xhi = ldbl_high (x); + EXTRACT_WORDS (hx, lx, xhi); + m = hx; + e = (int) (m >> 20) - (int) 0x3fe - 106; + } m &= 0xfffff; w0 = m | 0x3fe00000; m |= 0x100000; -- cgit 1.4.1