]> sourceware.org Git - glibc.git/commitdiff
Fix low-part sign handling in sin/cos for ldbl-128 and ldbl-128ibm.
authorJoseph Myers <joseph@codesourcery.com>
Thu, 22 Mar 2012 12:52:50 +0000 (12:52 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 22 Mar 2012 12:52:50 +0000 (12:52 +0000)
ChangeLog
sysdeps/ieee754/ldbl-128/k_cosl.c
sysdeps/ieee754/ldbl-128/k_sincosl.c
sysdeps/ieee754/ldbl-128/k_sinl.c
sysdeps/ieee754/ldbl-128ibm/k_cosl.c
sysdeps/ieee754/ldbl-128ibm/k_sincosl.c
sysdeps/ieee754/ldbl-128ibm/k_sinl.c

index 33bb4f89d0b91cc88d41b5909ff5ddcaad50a467..a993315e9e5499a4286a22a6f5c6fcbc960abb8e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2012-03-22  Joseph Myers  <joseph@codesourcery.com>
+
+       * sysdeps/ieee754/ldbl-128/k_cosl.c (__kernel_cosl): Negate y if
+       negating x to take absolute value.
+       * sysdeps/ieee754/ldbl-128/k_sincosl.c (__kernel_sincosl):
+       Likewise.
+       * sysdeps/ieee754/ldbl-128ibm/k_cosl.c (__kernel_cosl): Likewise.
+       * sysdeps/ieee754/ldbl-128ibm/k_sincosl.c (__kernel_sincosl):
+       Likewise.
+       * sysdeps/ieee754/ldbl-128/k_sinl.c (__kernel_sinl): Negate y when
+       computing low part if x was negated.
+       * sysdeps/ieee754/ldbl-128ibm/k_sinl.c (__kernel_sinl): Likewise.
+
 2012-03-21  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elf/tst-auditmod1.c: Support la_x32_gnu_pltenter and
index 4cb9dd1f56ff5958662e5ab47aaee915d2b6fc61..aa447ec1dbeccd390e5c69ea6f18ce1e87ef2831 100644 (file)
@@ -105,7 +105,11 @@ __kernel_cosl(long double x, long double y)
         cosl(h+l) = cosl(h)cosl(l) - sinl(h)sinl(l).  */
       index = 0x3ffe - (tix >> 16);
       hix = (tix + (0x200 << index)) & (0xfffffc00 << index);
-      x = fabsl (x);
+      if (signbit (x))
+       {
+         x = -x;
+         y = -y;
+       }
       switch (index)
        {
        case 0: index = ((45 << 10) + hix - 0x3ffe0000) >> 8; break;
index 98c5d627805bf356d6f87be132291604cbe077f2..00a21c45d18768b47d9c7575b0f73b4f9214ba7b 100644 (file)
@@ -132,7 +132,11 @@ __kernel_sincosl(long double x, long double y, long double *sinx, long double *c
         cosl(h+l) = cosl(h)cosl(l) - sinl(h)sinl(l).  */
       index = 0x3ffe - (tix >> 16);
       hix = (tix + (0x200 << index)) & (0xfffffc00 << index);
-      x = fabsl (x);
+      if (signbit (x))
+       {
+         x = -x;
+         y = -y;
+       }
       switch (index)
        {
        case 0: index = ((45 << 10) + hix - 0x3ffe0000) >> 8; break;
index 6eaf878d94f10349b5e3d85a56b96cc4aa69651c..1f0ca8c7f988cdb83cb977d48b29e4142f01507f 100644 (file)
@@ -116,7 +116,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;
index 52414319a62d699bc463cad501344908e2777b0f..fc0137468800770e7841917cd4d1ecaf5f655d90 100644 (file)
@@ -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;
index f3dd954887bcba6eac1624c8f47723c62f7702bf..98fe07d7a713b6b1ce9f479cc30c0d8388ab7858 100644 (file)
@@ -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;
index 484b65fc8e5103e534e6df0642a095aa910e7ff1..94aba0b62dcbda1e8acfa715fed706005b56c33d 100644 (file)
@@ -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;
This page took 0.056315 seconds and 5 git commands to generate.