aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/i386/fpu/libm-test-ulps36
-rw-r--r--sysdeps/ieee754/flt-32/k_tanf.c2
2 files changed, 38 insertions, 0 deletions
diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps
index ab02bde..9ea5ed6 100644
--- a/sysdeps/i386/fpu/libm-test-ulps
+++ b/sysdeps/i386/fpu/libm-test-ulps
@@ -2353,9 +2353,45 @@ double: 1
idouble: 1
# tan
+Test "tan (-0xc.90fdbp-4) == -1.0000000437113909572052640953950483705005":
+float: 1
+ifloat: 1
+Test "tan (-0xc.90fdcp-4) == -1.0000001629206928242190327320047489394217":
+float: 1
+ifloat: 1
+Test "tan (-0xc.90fep-4) == -1.0000006397580424009014454926842136804016":
+float: 1
+ifloat: 1
+Test "tan (-0xc.91p-4) == -1.0000044544650244953647966900221905361131":
+float: 1
+ifloat: 1
+Test "tan (-0xc.92p-4) == -1.0004928571392300571266638743539017593717":
+float: 1
+ifloat: 1
+Test "tan (-0xc.94p-4) == -1.0014703786820082237342656561856877993328":
+float: 1
+ifloat: 1
Test "tan (0x1p16383) == 0.422722393732022337800504160054440141575":
ildouble: 1
ldouble: 1
+Test "tan (0xc.90fdbp-4) == 1.0000000437113909572052640953950483705005":
+float: 1
+ifloat: 1
+Test "tan (0xc.90fdcp-4) == 1.0000001629206928242190327320047489394217":
+float: 1
+ifloat: 1
+Test "tan (0xc.90fep-4) == 1.0000006397580424009014454926842136804016":
+float: 1
+ifloat: 1
+Test "tan (0xc.91p-4) == 1.0000044544650244953647966900221905361131":
+float: 1
+ifloat: 1
+Test "tan (0xc.92p-4) == 1.0004928571392300571266638743539017593717":
+float: 1
+ifloat: 1
+Test "tan (0xc.94p-4) == 1.0014703786820082237342656561856877993328":
+float: 1
+ifloat: 1
Test "tan (1e22) == -1.628778225606898878549375936939548513545":
ildouble: 1
ldouble: 1
diff --git a/sysdeps/ieee754/flt-32/k_tanf.c b/sysdeps/ieee754/flt-32/k_tanf.c
index 9220606..be9a5d0 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;