summaryrefslogtreecommitdiff
path: root/sysdeps/libm-ieee754/s_cosl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/libm-ieee754/s_cosl.c')
-rw-r--r--sysdeps/libm-ieee754/s_cosl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sysdeps/libm-ieee754/s_cosl.c b/sysdeps/libm-ieee754/s_cosl.c
index 0e7a06d8ba..9765f7fd4e 100644
--- a/sysdeps/libm-ieee754/s_cosl.c
+++ b/sysdeps/libm-ieee754/s_cosl.c
@@ -60,14 +60,15 @@ static char rcsid[] = "$NetBSD: $";
#endif
{
long double y[2],z=0.0;
- int32_t n, se;
+ int32_t n, se, i0, i1;
/* High word of x. */
- GET_LDOUBLE_EXP(se,x);
+ GET_LDOUBLE_WORDS(se,i0,i1,x);
/* |x| ~< pi/4 */
se &= 0x7fff;
- if(ix <= 0x3ffe) return __kernel_cosl(x,z);
+ if(se < 0x3ffe || (se == 0x3ffe && i0 <= 0xc90fdaa2))
+ return __kernel_cosl(x,z);
/* cos(Inf or NaN) is NaN */
else if (se==0x7fff) return x-x;