about summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-128
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-11-18 12:33:53 -0800
committerDavid S. Miller <davem@davemloft.net>2012-11-18 12:33:53 -0800
commit05b227bdaea9a5f1faf08dad31221d8736f3659d (patch)
tree06e947ef8dbcee671b979246fa994fba53081e4c /sysdeps/ieee754/ldbl-128
parent786b0b67a3019e84988a6d5a79fd97801580a1cd (diff)
downloadglibc-05b227bdaea9a5f1faf08dad31221d8736f3659d.tar.gz
glibc-05b227bdaea9a5f1faf08dad31221d8736f3659d.tar.xz
glibc-05b227bdaea9a5f1faf08dad31221d8736f3659d.zip
Correct tinyness handling in long-double and float y0/y1.
	With help from Joseph Myers.
	* sysdeps/ieee754/flt-32/e_j0f.c (__ieee754_y0f): Adjust tinyness
	cutoff to 2**-13.
	* sysdeps/ieee754/flt-32/e_j1f.c (__ieee754_y1f): Adjust tinyness
	cutoff to 2**-25.
	* sysdeps/ieee754/ldbl-128/e_j0l.c (U0): New constant.
	( __ieee754_y0l): Avoid arithmetic underflow when 'x' is very
	small.
	* sysdeps/ieee754/ldbl-128/e_j1l.c (__ieee754_y1l): Likewise.
	* math/libm-test.inc (y0_test): New tests.
	(y1_test): New tests.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Update.
	* sysdeps/sparc/fpu/libm-test-ulps: Update.
Diffstat (limited to 'sysdeps/ieee754/ldbl-128')
-rw-r--r--sysdeps/ieee754/ldbl-128/e_j0l.c3
-rw-r--r--sysdeps/ieee754/ldbl-128/e_j1l.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/sysdeps/ieee754/ldbl-128/e_j0l.c b/sysdeps/ieee754/ldbl-128/e_j0l.c
index 112a8f3f9c..1b18289588 100644
--- a/sysdeps/ieee754/ldbl-128/e_j0l.c
+++ b/sysdeps/ieee754/ldbl-128/e_j0l.c
@@ -809,6 +809,7 @@ static long double Y0_2D[NY0_2D + 1] = {
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
+static const long double U0 = -7.3804295108687225274343927948483016310862e-02L;
 
 /* Bessel function of the second kind, order zero.  */
 
@@ -831,6 +832,8 @@ long double
       return -HUGE_VALL + x;
     }
   xx = fabsl (x);
+  if (xx <= 0x1p-57)
+    return U0 + TWOOPI * __ieee754_logl (x);
   if (xx <= 2.0L)
     {
       /* 0 <= x <= 2 */
diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c
index 1f62bd0920..f16343b26b 100644
--- a/sysdeps/ieee754/ldbl-128/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-128/e_j1l.c
@@ -838,6 +838,8 @@ __ieee754_y1l (long double x)
       return -HUGE_VALL + x;
     }
   xx = fabsl (x);
+  if (xx <= 0x1p-114)
+    return -TWOOPI / x;
   if (xx <= 2.0L)
     {
       /* 0 <= x <= 2 */