summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2013-03-16 17:51:48 +0000
committerJoseph Myers <joseph@codesourcery.com>2013-03-16 17:51:48 +0000
commitd2f9799e7ca00687eb1a57f2747b4293e1a7dea6 (patch)
tree536a28c0919e8388cb94fa1ba9b75dce7d61a7bc
parent2a185d32e830589bf9ae50f9243bb304f84b110b (diff)
downloadglibc-d2f9799e7ca00687eb1a57f2747b4293e1a7dea6.tar.gz
glibc-d2f9799e7ca00687eb1a57f2747b4293e1a7dea6.tar.xz
glibc-d2f9799e7ca00687eb1a57f2747b4293e1a7dea6.zip
Fix y1l spurious overflows for ldbl-96 (bug 15283).
-rw-r--r--ChangeLog10
-rw-r--r--NEWS2
-rw-r--r--math/libm-test.inc20
-rw-r--r--sysdeps/i386/fpu/libm-test-ulps12
-rw-r--r--sysdeps/ieee754/ldbl-96/e_j1l.c2
-rw-r--r--sysdeps/x86_64/fpu/libm-test-ulps12
6 files changed, 56 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8192d5ae54..2fd21f5aa5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2013-03-16  Joseph Myers  <joseph@codesourcery.com>
 
+	[BZ #15283]
+	* sysdeps/ieee754/ldbl-96/e_j1l.c (__ieee754_y1l): Correct test
+	for arguments at most half maximum finite value.
+	* math/libm-test.inc (j0_test): Add more tests.
+	(j1_test): Likewise.
+	(y0_test): Likewise.
+	(y1_test): Likewise.
+	* sysdeps/i386/fpu/libm-test-ulps: Update.
+	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
 	[BZ #14155]
 	* sysdeps/ieee754/ldbl-128/e_j0l.c (__ieee754_j0l): Do not compute
 	1 / x and functions P and Q for arguments above 0x1p256L.
diff --git a/NEWS b/NEWS
index cb96a74e50..376a792189 100644
--- a/NEWS
+++ b/NEWS
@@ -11,7 +11,7 @@ Version 2.18
 
   11561, 12723, 13550, 13951, 14142, 14200, 14317, 14327, 14496, 14920,
   14964, 14981, 14982, 14985, 14994, 14996, 15003, 15006, 15020, 15023,
-  15036, 15054, 15055, 15062, 15078, 15160, 15232, 15234.
+  15036, 15054, 15055, 15062, 15078, 15160, 15232, 15234, 15283.
 
 * Add support for calling C++11 thread_local object destructors on thread
   and program exit.  This needs compiler support for offloading C++11
diff --git a/math/libm-test.inc b/math/libm-test.inc
index d9df034c63..914aab3349 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -6246,6 +6246,11 @@ j0_test (void)
   TEST_f_f (j0, -0x1.001000001p+593L, -3.927269966354206207832593635798954916263e-90L);
 #endif
 
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+  TEST_f_f (j0, 0x1p16382L, -1.2193782500509000574176799046642541129387e-2466L);
+  TEST_f_f (j0, 0x1p16383L, 9.5859502826270374691362975419147645151233e-2467L);
+#endif
+
   END (j0);
 }
 
@@ -6287,6 +6292,11 @@ j1_test (void)
   TEST_f_f (j1, 0x1.ff00000000002p+840L, 1.846591691699331493194965158699937660696e-127L);
 #endif
 
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+  TEST_f_f (j1, 0x1p16382L, 8.0839224448726336195866026476176740513439e-2467L);
+  TEST_f_f (j1, 0x1p16383L, -3.8895531955766020648617743624167352352217e-2467L);
+#endif
+
   END (j1);
 }
 
@@ -10458,6 +10468,11 @@ y0_test (void)
   TEST_f_f (y0, 0x1.ff00000000002p+840L, 1.846591691699331493194965158699937660696e-127L);
 #endif
 
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+  TEST_f_f (y0, 0x1p16382L, 8.0839224448726336195866026476176740513439e-2467L);
+  TEST_f_f (y0, 0x1p16383L, -3.8895531955766020648617743624167352352217e-2467L);
+#endif
+
   TEST_f_f (y0, 0x1p-10L, -4.4865150767109739412411806297168793661098L);
   TEST_f_f (y0, 0x1p-20L, -8.8992283012125827603076426611387876938160L);
   TEST_f_f (y0, 0x1p-30L, -1.3311940304267782826037118027401817264906e+1L);
@@ -10511,6 +10526,11 @@ y1_test (void)
   TEST_f_f (y1, 0x1.001000001p+593L, 3.927269966354206207832593635798954916263e-90L);
 #endif
 
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+  TEST_f_f (y1, 0x1p16382L, 1.2193782500509000574176799046642541129387e-2466L);
+  TEST_f_f (y1, 0x1p16383L, -9.5859502826270374691362975419147645151233e-2467L);
+#endif
+
   TEST_f_f (y1, 0x1p-10L, -6.5190099301063115047395187618929589514382e+02L);
   TEST_f_f (y1, 0x1p-20L, -6.6754421443450423911167962313100637952285e+05L);
   TEST_f_f (y1, 0x1p-30L, -6.8356527557643159612937462812258975438856e+08L);
diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps
index fd0180ffd6..6186c99afb 100644
--- a/sysdeps/i386/fpu/libm-test-ulps
+++ b/sysdeps/i386/fpu/libm-test-ulps
@@ -2475,6 +2475,9 @@ ldouble: 2
 Test "j0 (0x1.d7ce3ap+107) == 2.775523647291230802651040996274861694514e-17":
 float: 1
 ifloat: 1
+Test "j0 (0x1p16382) == -1.2193782500509000574176799046642541129387e-2466":
+ildouble: 1
+ldouble: 1
 Test "j0 (10.0) == -0.245935764451348335197760862485328754":
 double: 3
 float: 1
@@ -2508,6 +2511,9 @@ ldouble: 1
 Test "j1 (0x1.ff00000000002p+840) == 1.846591691699331493194965158699937660696e-127":
 double: 1
 idouble: 1
+Test "j1 (0x1p16382) == 8.0839224448726336195866026476176740513439e-2467":
+ildouble: 1
+ldouble: 1
 Test "j1 (10.0) == 0.0434727461688614366697487680258592883":
 double: 2
 float: 1
@@ -3285,6 +3291,9 @@ idouble: 1
 Test "y0 (0x1p-80) == -3.5375500319532942168707373066828113573541e+1":
 double: 1
 idouble: 1
+Test "y0 (0x1p16382) == 8.0839224448726336195866026476176740513439e-2467":
+ildouble: 1
+ldouble: 1
 Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
 double: 2
 float: 1
@@ -3329,6 +3338,9 @@ ldouble: 1
 Test "y1 (0x1p-10) == -6.5190099301063115047395187618929589514382e+02":
 float: 1
 ifloat: 1
+Test "y1 (0x1p16382) == 1.2193782500509000574176799046642541129387e-2466":
+ildouble: 1
+ldouble: 1
 Test "y1 (1.0) == -0.781212821300288716547150000047964821":
 double: 1
 idouble: 1
diff --git a/sysdeps/ieee754/ldbl-96/e_j1l.c b/sysdeps/ieee754/ldbl-96/e_j1l.c
index 785c0b0676..4c13018aea 100644
--- a/sysdeps/ieee754/ldbl-96/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-96/e_j1l.c
@@ -203,7 +203,7 @@ __ieee754_y1l (long double x)
       __sincosl (x, &s, &c);
       ss = -s - c;
       cc = s - c;
-      if (ix < 0x7fe00000)
+      if (ix < 0x7ffe)
 	{			/* make sure x+x not overflow */
 	  z = __cosl (x + x);
 	  if ((s * c) > zero)
diff --git a/sysdeps/x86_64/fpu/libm-test-ulps b/sysdeps/x86_64/fpu/libm-test-ulps
index b828774c7a..f190ed881a 100644
--- a/sysdeps/x86_64/fpu/libm-test-ulps
+++ b/sysdeps/x86_64/fpu/libm-test-ulps
@@ -2390,6 +2390,9 @@ ifloat: 1
 Test "j0 (0x1.d7ce3ap+107) == 2.775523647291230802651040996274861694514e-17":
 float: 2
 ifloat: 2
+Test "j0 (0x1p16382) == -1.2193782500509000574176799046642541129387e-2466":
+ildouble: 1
+ldouble: 1
 Test "j0 (10.0) == -0.245935764451348335197760862485328754":
 double: 2
 float: 1
@@ -2420,6 +2423,9 @@ ldouble: 1
 Test "j1 (0x1.ff00000000002p+840) == 1.846591691699331493194965158699937660696e-127":
 double: 1
 idouble: 1
+Test "j1 (0x1p16382) == 8.0839224448726336195866026476176740513439e-2467":
+ildouble: 1
+ldouble: 1
 Test "j1 (10.0) == 0.0434727461688614366697487680258592883":
 float: 2
 ifloat: 2
@@ -3073,6 +3079,9 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+Test "y0 (0x1p16382) == 8.0839224448726336195866026476176740513439e-2467":
+ildouble: 1
+ldouble: 1
 Test "y0 (1.0) == 0.0882569642156769579829267660235151628":
 double: 2
 float: 1
@@ -3117,6 +3126,9 @@ ldouble: 1
 Test "y1 (0x1p-10) == -6.5190099301063115047395187618929589514382e+02":
 double: 1
 idouble: 1
+Test "y1 (0x1p16382) == 1.2193782500509000574176799046642541129387e-2466":
+ildouble: 1
+ldouble: 1
 Test "y1 (1.5) == -0.412308626973911295952829820633445323":
 float: 1
 ifloat: 1