aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ieee754
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 /sysdeps/ieee754
parent76b1f93b0416aae7aa4356188ad08e9216187616 (diff)
downloadglibc-9ad63c23eabdec1b625b1217b6635f34268ca342.tar
glibc-9ad63c23eabdec1b625b1217b6635f34268ca342.tar.gz
glibc-9ad63c23eabdec1b625b1217b6635f34268ca342.tar.bz2
glibc-9ad63c23eabdec1b625b1217b6635f34268ca342.zip
Fix tanf underflow close to pi/4 (bug 14154).
Diffstat (limited to 'sysdeps/ieee754')
-rw-r--r--sysdeps/ieee754/flt-32/k_tanf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/ieee754/flt-32/k_tanf.c b/sysdeps/ieee754/flt-32/k_tanf.c
index 92206069c8..be9a5d0f09 100644
--- a/sysdeps/ieee754/flt-32/k_tanf.c
+++ b/sysdeps/ieee754/flt-32/k_tanf.c
@@ -56,6 +56,8 @@ float __kernel_tanf(float x, float y, int iy)
z = pio4-x;
w = pio4lo-y;
x = z+w; y = 0.0;
+ if (fabsf (x) < 0x1p-13f)
+ return (1 - ((hx >> 30) & 2)) * iy * (1.0f - 2 * iy * x);
}
z = x*x;
w = z*z;