about summary refs log tree commit diff
path: root/math
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2012-07-06 21:19:38 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-07-06 21:19:38 +0000
commit9ad63c23eabdec1b625b1217b6635f34268ca342 (patch)
tree5a78e51fe04aaa99b1d98b489190be0c750d9ec3 /math
parent76b1f93b0416aae7aa4356188ad08e9216187616 (diff)
downloadglibc-9ad63c23eabdec1b625b1217b6635f34268ca342.tar.gz
glibc-9ad63c23eabdec1b625b1217b6635f34268ca342.tar.xz
glibc-9ad63c23eabdec1b625b1217b6635f34268ca342.zip
Fix tanf underflow close to pi/4 (bug 14154).
Diffstat (limited to 'math')
-rw-r--r--math/libm-test.inc41
1 files changed, 39 insertions, 2 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc
index b87a40d8d9..27c53a1386 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -8405,13 +8405,50 @@ tan_test (void)
   TEST_f_f (tan, nan_value, nan_value);
   check_int ("errno for tan(NaN) == 0", errno, 0, 0, 0, 0);
 
-  /* Bug 14154: spurious exception may occur.  */
-  TEST_f_f (tan, M_PI_4l, 1, UNDERFLOW_EXCEPTION_OK_FLOAT);
+  TEST_f_f (tan, M_PI_4l, 1);
   TEST_f_f (tan, 0.75L, 0.931596459944072461165202756573936428L);
 
   TEST_f_f (tan, 0x1p65, -0.0472364872359047946798414219288370688827L);
   TEST_f_f (tan, -0x1p65, 0.0472364872359047946798414219288370688827L);
 
+  TEST_f_f (tan, 0xc.9p-4, 0.9995162902115457818029468900654150261381L);
+  TEST_f_f (tan, 0xc.908p-4, 0.9997603425502441410973077452249560802034L);
+  TEST_f_f (tan, 0xc.90cp-4, 0.9998823910588060302788513970802357770031L);
+  TEST_f_f (tan, 0xc.90ep-4, 0.9999434208994808753305784795924711152508L);
+  TEST_f_f (tan, 0xc.90fp-4, 0.9999739372166156702433266059635165160515L);
+  TEST_f_f (tan, 0xc.90f8p-4, 0.9999891957244072765118898375645469865764L);
+  TEST_f_f (tan, 0xc.90fcp-4, 0.9999968250656122402859679132395522927393L);
+  TEST_f_f (tan, 0xc.90fdp-4, 0.9999987324100083358016192309006353329444L);
+  TEST_f_f (tan, 0xc.90fd8p-4, 0.9999996860835706212861509874451585282616L);
+  TEST_f_f (tan, 0xc.90fdap-4, 0.9999999245021033010474530133665235922808L);
+  TEST_f_f (tan, 0xc.ap-4, 1.0073556597407272165371804539701396631519L);
+  TEST_f_f (tan, 0xc.98p-4, 1.0034282930863044654045449407466962736255L);
+  TEST_f_f (tan, 0xc.94p-4, 1.0014703786820082237342656561856877993328L);
+  TEST_f_f (tan, 0xc.92p-4, 1.0004928571392300571266638743539017593717L);
+  TEST_f_f (tan, 0xc.91p-4, 1.0000044544650244953647966900221905361131L);
+  TEST_f_f (tan, 0xc.90fep-4, 1.0000006397580424009014454926842136804016L);
+  TEST_f_f (tan, 0xc.90fdcp-4, 1.0000001629206928242190327320047489394217L);
+  TEST_f_f (tan, 0xc.90fdbp-4, 1.0000000437113909572052640953950483705005L);
+
+  TEST_f_f (tan, -0xc.9p-4, -0.9995162902115457818029468900654150261381L);
+  TEST_f_f (tan, -0xc.908p-4, -0.9997603425502441410973077452249560802034L);
+  TEST_f_f (tan, -0xc.90cp-4, -0.9998823910588060302788513970802357770031L);
+  TEST_f_f (tan, -0xc.90ep-4, -0.9999434208994808753305784795924711152508L);
+  TEST_f_f (tan, -0xc.90fp-4, -0.9999739372166156702433266059635165160515L);
+  TEST_f_f (tan, -0xc.90f8p-4, -0.9999891957244072765118898375645469865764L);
+  TEST_f_f (tan, -0xc.90fcp-4, -0.9999968250656122402859679132395522927393L);
+  TEST_f_f (tan, -0xc.90fdp-4, -0.9999987324100083358016192309006353329444L);
+  TEST_f_f (tan, -0xc.90fd8p-4, -0.9999996860835706212861509874451585282616L);
+  TEST_f_f (tan, -0xc.90fdap-4, -0.9999999245021033010474530133665235922808L);
+  TEST_f_f (tan, -0xc.ap-4, -1.0073556597407272165371804539701396631519L);
+  TEST_f_f (tan, -0xc.98p-4, -1.0034282930863044654045449407466962736255L);
+  TEST_f_f (tan, -0xc.94p-4, -1.0014703786820082237342656561856877993328L);
+  TEST_f_f (tan, -0xc.92p-4, -1.0004928571392300571266638743539017593717L);
+  TEST_f_f (tan, -0xc.91p-4, -1.0000044544650244953647966900221905361131L);
+  TEST_f_f (tan, -0xc.90fep-4, -1.0000006397580424009014454926842136804016L);
+  TEST_f_f (tan, -0xc.90fdcp-4, -1.0000001629206928242190327320047489394217L);
+  TEST_f_f (tan, -0xc.90fdbp-4, -1.0000000437113909572052640953950483705005L);
+
 #ifndef TEST_FLOAT
   TEST_f_f (tan, 1e22, -1.628778225606898878549375936939548513545L);
   TEST_f_f (tan, 0x1p1023, -0.6814476476066215012854144040167365190368L);