From c0df8e693f34b535bd6ee1b691bc4ca6bc3b4579 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 22 Mar 2012 12:52:50 +0000 Subject: Fix low-part sign handling in sin/cos for ldbl-128 and ldbl-128ibm. --- sysdeps/ieee754/ldbl-128ibm/k_sincosl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sysdeps/ieee754/ldbl-128ibm/k_sincosl.c') diff --git a/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c b/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c index f3dd954..98fe07d 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; -- cgit v1.1