TEST_f_f (cos, 0.75L, 0.731688868873820886311838753000084544L);
+#ifndef TEST_LDOUBLE
+ /* Enable for long double once x86 and x86-64 implementation is fixed. */
+ TEST_f_f (cos, 0x1p65, 0.998886220660580136106421721793L);
+ TEST_f_f (cos, -0x1p65, 0.998886220660580136106421721793L);
+#endif
+
#ifdef TEST_DOUBLE
TEST_f_f (cos, 0.80190127184058835, 0.69534156199418473);
TEST_f_f (cos, 1e22, 0.5232147853951389454975944733847);
- TEST_f_f (cos, 0x1p65, 0.998886220660580136106421721793);
- TEST_f_f (cos, -0x1p65, 0.998886220660580136106421721793);
TEST_f_f (cos, 0x1p1023, -0.8263698346141479945007856808117);
#endif
TEST_f_f (sin, -M_PI_2l, -1);
TEST_f_f (sin, 0.75L, 0.681638760023334166733241952779893935L);
+#ifndef TEST_LDOUBLE
+ /* Enable for long double once x86 and x86-64 implementation is fixed. */
+ TEST_f_f (sin, 0x1p65, -0.0471838762123546738051061498057L);
+ TEST_f_f (sin, -0x1p65, 0.0471838762123546738051061498057L);
+#endif
+
#ifdef TEST_DOUBLE
TEST_f_f (sin, 0.80190127184058835, 0.71867942238767868);
TEST_f_f (sin, 2.522464e-1, 2.4957989804940911e-1);
TEST_f_f (sin, 1e22, -0.8522008497671888017727058937530);
- TEST_f_f (sin, 0x1p65, -0.0471838762123546738051061498057);
- TEST_f_f (sin, -0x1p65, 0.0471838762123546738051061498057);
TEST_f_f (sin, 0x1p1023, 0.5631277798508840248814522055909);
#endif
TEST_extra (sincos, M_PI_6l*2.0, 0.86602540378443864676372317075293616L, 0.5);
TEST_extra (sincos, 0.75L, 0.681638760023334166733241952779893935L, 0.731688868873820886311838753000084544L);
+#ifndef TEST_LDOUBLE
+ /* Enable for long double once x86 and x86-64 implementation is fixed. */
+ TEST_extra (sincos, 0x1p65, -0.0471838762123546738051061498057L, 0.998886220660580136106421721793L);
+ TEST_extra (sincos, -0x1p65, 0.0471838762123546738051061498057L, 0.998886220660580136106421721793L);
+#endif
+
#ifdef TEST_DOUBLE
TEST_extra (sincos, 0.80190127184058835, 0.71867942238767868, 0.69534156199418473);
TEST_extra (sincos, 1e22, -0.8522008497671888017727058937530, 0.5232147853951389454975944733847);
- TEST_extra (sincos, 0x1p65, -0.0471838762123546738051061498057, 0.998886220660580136106421721793);
- TEST_extra (sincos, -0x1p65, 0.0471838762123546738051061498057, 0.998886220660580136106421721793);
TEST_extra (sincos, 0x1p1023, 0.5631277798508840248814522055909, -0.8263698346141479945007856808117);
#endif
+++ /dev/null
-/* Empty. This file is only meant to avoid compiling the file with the
- same name in the libm-ieee754 directory. The code is not used since
- there is an assembler version for all users of this file. */
+++ /dev/null
-/* Empty. This file is only meant to avoid compiling the file with the
- same name in the libm-ieee754 directory. The code is not used since
- there is an assembler version for all users of this file. */
# cos_downward
Test "cos_downward (1) == 0.5403023058681397174009366074429766037323":
double: 1
+float: 2
idouble: 1
+ifloat: 2
ildouble: 1
ldouble: 1
Test "cos_downward (10) == -0.8390715290764524522588639478240648345199":
float: 1
idouble: 1
ifloat: 1
+Test "cos_downward (2) == -0.4161468365471423869975682295007621897660":
+float: 1
+ifloat: 1
Test "cos_downward (3) == -0.9899924966004454572715727947312613023937":
double: 1
idouble: 1
ildouble: 1
ldouble: 1
Test "cos_downward (8) == -0.1455000338086135258688413818311946826093":
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Test "cos_downward (9) == -0.9111302618846769883682947111811653112463":
ldouble: 1
# cos_tonearest
+Test "cos_tonearest (2) == -0.4161468365471423869975682295007621897660":
+float: 1
+ifloat: 1
Test "cos_tonearest (8) == -0.1455000338086135258688413818311946826093":
ildouble: 1
ldouble: 1
ldouble: 1
# csin
+Test "Imaginary part of: csin (-2 - 3 i) == -9.15449914691142957346729954460983256 + 4.16890695996656435075481305885375484 i":
+float: 1
+ifloat: 1
Test "Real part of: csin (0.75 + 1.25 i) == 1.28722291002649188575873510790565441 + 1.17210635989270256101081285116138863 i":
float: 1
ifloat: 1
ildouble: 1
ldouble: 1
+# sin
+Test "sin (-0x1p65) == 0.0471838762123546738051061498057":
+float: 1
+ifloat: 1
+Test "sin (0x1p65) == -0.0471838762123546738051061498057":
+float: 1
+ifloat: 1
+
# sin_downward
Test "sin_downward (1) == 0.8414709848078965066525023216302989996226":
ildouble: 1
ldouble: 1
Test "sin_downward (10) == -0.5440211108893698134047476618513772816836":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Test "sin_downward (2) == 0.9092974268256816953960198659117448427023":
double: 1
idouble: 1
Test "sin_downward (3) == 0.1411200080598672221007448028081102798469":
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Test "sin_downward (4) == -0.7568024953079282513726390945118290941359":
ldouble: 1
# sin_tonearest
+Test "sin_tonearest (1) == 0.8414709848078965066525023216302989996226":
+float: 1
+ifloat: 1
Test "sin_tonearest (10) == -0.5440211108893698134047476618513772816836":
ildouble: 1
ldouble: 1
Test "sin_upward (8) == 0.9893582466233817778081235982452886721164":
float: 1
ifloat: 1
+Test "sin_upward (9) == 0.4121184852417565697562725663524351793439":
+float: 1
+ifloat: 1
# sincos
+Test "sincos (-0x1p65, &sin_res, &cos_res) puts 0.0471838762123546738051061498057 in sin_res":
+float: 1
+ifloat: 1
+Test "sincos (0x1p65, &sin_res, &cos_res) puts -0.0471838762123546738051061498057 in sin_res":
+float: 1
+ifloat: 1
Test "sincos (M_PI_6l*2.0, &sin_res, &cos_res) puts 0.5 in cos_res":
double: 1
float: 1
Function: "cos_downward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
+ifloat: 2
ildouble: 1
ldouble: 1
Function: "cos_tonearest":
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
ildouble: 1
ldouble: 1
+Function: "sin":
+float: 1
+ifloat: 1
+
Function: "sin_downward":
double: 1
float: 1
ldouble: 1
Function: "sin_tonearest":
+float: 1
+ifloat: 1
ildouble: 1
ldouble: 1
+++ /dev/null
-/*
- * 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_cosf.S,v 1.3 1995/05/08 23:55:16 jtc Exp $")
-
-ENTRY(__cosf)
- flds 4(%esp)
- fxam
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x05, %dh
- je 3f
-4: fcos
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- ret
- .align ALIGNARG(4)
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fcos
- 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 (__cosf)
-weak_alias (__cosf, cosf)
+++ /dev/null
-/* Compute sine and cosine of argument.
- Copyright (C) 1997, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <machine/asm.h>
-#include "bp-sym.h"
-#include "bp-asm.h"
-
-#define PARMS LINKAGE /* no space for saved regs */
-#define ANGLE PARMS
-#define SINP ANGLE+4
-#define COSP SINP+PTR_SIZE
-
- .text
-ENTRY (BP_SYM (__sincosf))
- ENTER
-
- flds ANGLE(%esp)
- fsincos
- movl SINP(%esp), %ecx
- CHECK_BOUNDS_BOTH_WIDE (%ecx, SINP(%esp), $4)
- movl COSP(%esp), %edx
- CHECK_BOUNDS_BOTH_WIDE (%edx, COSP(%esp), $4)
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- fstps (%edx)
- fstps (%ecx)
-
- LEAVE
- ret
-
- .align ALIGNARG(4)
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fsincos
- fstps (%edx)
- fstps (%ecx)
-
- LEAVE
- ret
-END (BP_SYM (__sincosf))
-weak_alias (BP_SYM (__sincosf), BP_SYM (sincosf))
+++ /dev/null
-/*
- * 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_sinf.S,v 1.3 1995/05/09 00:27:53 jtc Exp $")
-
-ENTRY(__sinf)
- flds 4(%esp)
- fxam
- fstsw %ax
- movb $0x45, %dh
- andb %ah, %dh
- cmpb $0x05, %dh
- je 3f
-4: fsin
- fnstsw %ax
- testl $0x400,%eax
- jnz 1f
- ret
- .align ALIGNARG(4)
-1: fldpi
- fadd %st(0)
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testl $0x400,%eax
- jnz 2b
- fstp %st(1)
- fsin
- 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 (__sinf)
-weak_alias (__sinf, sinf)