summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-128ibm/k_cosl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/ldbl-128ibm/k_cosl.c')
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/k_cosl.c6
1 files changed, 5 insertions, 1 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;