diff options
author | Joseph Myers <joseph@codesourcery.com> | 2012-03-16 20:05:04 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2012-03-16 20:05:37 +0000 |
commit | 11b90b9f504df5b2da91ce3a06c1657d99e4a95f (patch) | |
tree | 838df025f383c47096e24ac377aa45d48d9200b7 /sysdeps/x86_64/fpu | |
parent | 6a1bd2a100c958d30bbfe8c9b8f9071d24b7c3f4 (diff) | |
download | glibc-11b90b9f504df5b2da91ce3a06c1657d99e4a95f.tar.gz glibc-11b90b9f504df5b2da91ce3a06c1657d99e4a95f.tar.xz glibc-11b90b9f504df5b2da91ce3a06c1657d99e4a95f.zip |
Fix tan, tanl for large inputs.
Diffstat (limited to 'sysdeps/x86_64/fpu')
-rw-r--r-- | sysdeps/x86_64/fpu/k_tanl.c | 1 | ||||
-rw-r--r-- | sysdeps/x86_64/fpu/libm-test-ulps | 28 | ||||
-rw-r--r-- | sysdeps/x86_64/fpu/s_tanl.S | 45 |
3 files changed, 28 insertions, 46 deletions
diff --git a/sysdeps/x86_64/fpu/k_tanl.c b/sysdeps/x86_64/fpu/k_tanl.c deleted file mode 100644 index eea55a98d2..0000000000 --- a/sysdeps/x86_64/fpu/k_tanl.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/x86_64/fpu/libm-test-ulps b/sysdeps/x86_64/fpu/libm-test-ulps index 9a3fd6f8be..613ae579e9 100644 --- a/sysdeps/x86_64/fpu/libm-test-ulps +++ b/sysdeps/x86_64/fpu/libm-test-ulps @@ -1539,6 +1539,12 @@ ildouble: 7 ldouble: 7 # tan +Test "tan (0x1p16383) == 0.422722393732022337800504160054440141575": +ildouble: 1 +ldouble: 1 +Test "tan (1e22) == -1.628778225606898878549375936939548513545": +ildouble: 1 +ldouble: 1 Test "tan (pi/4) == 1": double: 1 idouble: 1 @@ -1547,12 +1553,19 @@ idouble: 1 Test "tan_downward (1) == 1.5574077246549022305069748074583601730873": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "tan_downward (10) == 0.6483608274590866712591249330098086768169": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "tan_downward (2) == -2.1850398632615189916433061023136825434320": float: 1 ifloat: 1 +Test "tan_downward (3) == -0.1425465430742778052956354105339134932261": +ildouble: 1 +ldouble: 1 Test "tan_downward (4) == 1.1578212823495775831373424182673239231198": ildouble: 1 ldouble: 1 @@ -1572,6 +1585,12 @@ float: 1 ifloat: 1 # tan_tonearest +Test "tan_tonearest (1) == 1.5574077246549022305069748074583601730873": +ildouble: 1 +ldouble: 1 +Test "tan_tonearest (2) == -2.1850398632615189916433061023136825434320": +ildouble: 1 +ldouble: 1 Test "tan_tonearest (6) == -0.2910061913847491570536995888681755428312": ildouble: 1 ldouble: 1 @@ -1583,9 +1602,14 @@ ildouble: 1 ldouble: 1 # tan_towardzero +Test "tan_towardzero (1) == 1.5574077246549022305069748074583601730873": +ildouble: 1 +ldouble: 1 Test "tan_towardzero (10) == 0.6483608274590866712591249330098086768169": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "tan_towardzero (2) == -2.1850398632615189916433061023136825434320": ildouble: 1 ldouble: 1 @@ -1636,6 +1660,8 @@ ldouble: 1 Test "tan_upward (5) == -3.3805150062465856369827058794473439087096": float: 1 ifloat: 1 +ildouble: 2 +ldouble: 2 Test "tan_upward (6) == -0.2910061913847491570536995888681755428312": ildouble: 1 ldouble: 1 @@ -2308,6 +2334,8 @@ ldouble: 27 Function: "tan": double: 1 idouble: 1 +ildouble: 1 +ldouble: 1 Function: "tan_downward": float: 1 diff --git a/sysdeps/x86_64/fpu/s_tanl.S b/sysdeps/x86_64/fpu/s_tanl.S deleted file mode 100644 index 6427e3f6f0..0000000000 --- a/sysdeps/x86_64/fpu/s_tanl.S +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>. - * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>. - */ - -#define __need_Emath -#include <bits/errno.h> -#include <machine/asm.h> - -RCSID("$NetBSD: $") - -ENTRY(__tanl) - fldt 8(%rsp) - fxam - fstsw %ax - movb $0x45, %dh - andb %ah, %dh - cmpb $0x05, %dh - je 3f -4: fptan - fnstsw %ax - testl $0x400,%eax - jnz 1f - fstp %st(0) - ret -1: fldpi - fadd %st(0) - fxch %st(1) -2: fprem1 - fstsw %ax - testl $0x400,%eax - jnz 2b - fstp %st(1) - fptan - fstp %st(0) - ret -3: call __errno_location@PLT - movl $EDOM, (%rax) - jmp 4b -END (__tanl) -weak_alias (__tanl, tanl) |