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/i386/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/i386/fpu')
-rw-r--r-- | sysdeps/i386/fpu/libm-test-ulps | 20 | ||||
-rw-r--r-- | sysdeps/i386/fpu/mptan.c | 1 | ||||
-rw-r--r-- | sysdeps/i386/fpu/s_tan.S | 55 | ||||
-rw-r--r-- | sysdeps/i386/fpu/s_tanl.S | 55 |
4 files changed, 18 insertions, 113 deletions
diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps index 6f090e1417..d83b2339ca 100644 --- a/sysdeps/i386/fpu/libm-test-ulps +++ b/sysdeps/i386/fpu/libm-test-ulps @@ -1539,6 +1539,12 @@ idouble: 1 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 float: 1 @@ -1551,9 +1557,13 @@ double: 1 float: 2 idouble: 1 ifloat: 2 +ildouble: 1 +ldouble: 1 Test "tan_downward (10) == 0.6483608274590866712591249330098086768169": float: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Test "tan_downward (2) == -2.1850398632615189916433061023136825434320": double: 1 float: 1 @@ -1614,9 +1624,13 @@ double: 1 float: 1 idouble: 1 ifloat: 1 +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 @@ -1681,8 +1695,8 @@ double: 1 float: 1 idouble: 1 ifloat: 1 -ildouble: 1 -ldouble: 1 +ildouble: 2 +ldouble: 2 Test "tan_upward (6) == -0.2910061913847491570536995888681755428312": ildouble: 1 ldouble: 1 @@ -2366,6 +2380,8 @@ double: 1 float: 1 idouble: 1 ifloat: 1 +ildouble: 1 +ldouble: 1 Function: "tan_downward": double: 1 diff --git a/sysdeps/i386/fpu/mptan.c b/sysdeps/i386/fpu/mptan.c deleted file mode 100644 index 1cc8931700..0000000000 --- a/sysdeps/i386/fpu/mptan.c +++ /dev/null @@ -1 +0,0 @@ -/* Not needed. */ diff --git a/sysdeps/i386/fpu/s_tan.S b/sysdeps/i386/fpu/s_tan.S deleted file mode 100644 index b35bb835de..0000000000 --- a/sysdeps/i386/fpu/s_tan.S +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>. - * Public domain. - */ - -#define __need_Emath -#include <bits/errno.h> -#include <machine/asm.h> - -RCSID("$NetBSD: s_tan.S,v 1.5 1995/05/09 00:30:00 jtc Exp $") - -ENTRY(__tan) - fldl 4(%esp) - 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: -#ifdef PIC - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) - LOAD_PIC_REG (bx) - call __errno_location@PLT - movl $EDOM, (%eax) - popl %ebx - cfi_adjust_cfa_offset (-4) - cfi_restore (ebx) -#else - call __errno_location@PLT - movl $EDOM, (%eax) -#endif - jmp 4b -END (__tan) -weak_alias (__tan, tan) diff --git a/sysdeps/i386/fpu/s_tanl.S b/sysdeps/i386/fpu/s_tanl.S deleted file mode 100644 index 151b77113f..0000000000 --- a/sysdeps/i386/fpu/s_tanl.S +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>. - */ - -#define __need_Emath -#include <bits/errno.h> -#include <machine/asm.h> - -ENTRY(__tanl) - fldt 4(%esp) - 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: -#ifdef PIC - pushl %ebx - cfi_adjust_cfa_offset (4) - cfi_rel_offset (ebx, 0) - LOAD_PIC_REG (bx) - call __errno_location@PLT - movl $EDOM, (%eax) - popl %ebx - cfi_adjust_cfa_offset (-4) - cfi_restore (ebx) -#else - call __errno_location@PLT - movl $EDOM, (%eax) -#endif - jmp 4b -END (__tanl) -weak_alias (__tanl, tanl) |