This is the mail archive of the libc-alpha@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]

Fix ldbl-128 j0l spurious underflows (bug 19156) [committed]


My recent addition of more tests for j0 showed up that the ldbl-128
implementation of j0l produces spurious underflow exceptions for
arguments close to 0 (when the result is very close to 1).  This patch
fixes this by just returning the argument in that case.

Tested for mips64 (where it fixes the recently-added tests that were
previously failing).  Committed.

2015-10-21  Joseph Myers  <joseph@codesourcery.com>

	[BZ #19156]
	* sysdeps/ieee754/ldbl-128/e_j0l.c (__ieee754_j0l): Return 1 for
	arguments very close to 0.

diff --git a/sysdeps/ieee754/ldbl-128/e_j0l.c b/sysdeps/ieee754/ldbl-128/e_j0l.c
index 1320de7..c208916 100644
--- a/sysdeps/ieee754/ldbl-128/e_j0l.c
+++ b/sysdeps/ieee754/ldbl-128/e_j0l.c
@@ -693,6 +693,8 @@ __ieee754_j0l (long double x)
   xx = fabsl (x);
   if (xx <= 2.0L)
     {
+      if (xx < 0x1p-57L)
+	return 1.0L;
       /* 0 <= x <= 2 */
       z = xx * xx;
       p = z * z * neval (z, J0_2N, NJ0_2N) / deval (z, J0_2D, NJ0_2D);

-- 
Joseph S. Myers
joseph@codesourcery.com


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