diff options
Diffstat (limited to 'sysdeps/ieee754/ldbl-128ibm')
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/k_cosl.c | 6 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/k_sincosl.c | 6 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/k_sinl.c | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm/k_cosl.c b/sysdeps/ieee754/ldbl-128ibm/k_cosl.c index 52414319a6..fc01374688 100644 --- a/sysdeps/ieee754/ldbl-128ibm/k_cosl.c +++ b/sysdeps/ieee754/ldbl-128ibm/k_cosl.c @@ -123,7 +123,11 @@ __kernel_cosl(long double x, long double y) index = 0x3fe - (tix >> 20); hix = (tix + (0x200 << index)) & (0xfffffc00 << index); - x = fabsl (x); + if (signbit (x)) + { + x = -x; + y = -y; + } switch (index) { case 0: index = ((45 << 14) + hix - 0x3fe00000) >> 12; break; diff --git a/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c b/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c index f3dd954887..98fe07d7a7 100644 --- a/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c +++ b/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c @@ -151,7 +151,11 @@ __kernel_sincosl(long double x, long double y, long double *sinx, long double *c index = 0x3fe - (tix >> 20); hix = (tix + (0x2000 << index)) & (0xffffc000 << index); - x = fabsl (x); + if (signbit (x)) + { + x = -x; + y = -y; + } switch (index) { case 0: index = ((45 << 14) + hix - 0x3fe00000) >> 12; break; diff --git a/sysdeps/ieee754/ldbl-128ibm/k_sinl.c b/sysdeps/ieee754/ldbl-128ibm/k_sinl.c index 484b65fc8e..94aba0b62d 100644 --- a/sysdeps/ieee754/ldbl-128ibm/k_sinl.c +++ b/sysdeps/ieee754/ldbl-128ibm/k_sinl.c @@ -134,7 +134,7 @@ __kernel_sinl(long double x, long double y, int iy) */ SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0); if (iy) - l = y - (h - x); + l = (ix < 0 ? -y : y) - (h - x); else l = x - h; z = l * l; |