]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix sign of input to bsloww1 (BZ #16623)
authorSiddhesh Poyarekar <siddhesh@redhat.com>
Thu, 27 Feb 2014 15:59:16 +0000 (21:29 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Thu, 27 Feb 2014 15:59:16 +0000 (21:29 +0530)
In 84ba214c, I removed some redundant sign computations and in the
process, I incorrectly got rid of a temporary variable, thus passing
the absolute value of the input to bsloww1.  This caused #16623.

This fix undoes the incorrect change.

ChangeLog
NEWS
sysdeps/ieee754/dbl-64/s_sin.c

index b65e16f820a6275d20867dd74fc90a7f2660a1a1..8c6db1b4a141bebf1f94ab79886446bdd1ae5de0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-02-27  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+       [BZ #16623]
+       * sysdeps/ieee754/dbl-64/s_sin.c (__sin): Preserve sign of A
+       and DA.
+       (__cos): Likewise.
+
 2014-02-12  Dylan Alex Simon  <dylan@dylex.net>
 
        [BZ #16545]
diff --git a/NEWS b/NEWS
index 7b52f1f2b66a5d348e333d0852ccbd3b9eff7cd8..6a3c57ef1d6c98b9b69cd28e4fa5041e993598f3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,7 @@ Version 2.19.1
 
 * The following bugs are resolved with this release:
 
-  16545.
+  16545, 16623.
 \f
 Version 2.19
 
index 6105e9fbdf1b2c797eb8c85a0eea141233554941..50109b8dd4ed03d59c948bfd9f9b25ffcaf5dac2 100644 (file)
@@ -447,19 +447,21 @@ __sin (double x)
            }
          else
            {
+             double t;
              if (a > 0)
                {
                  m = 1;
+                 t = a;
                  db = da;
                }
              else
                {
                  m = 0;
-                 a = -a;
+                 t = -a;
                  db = -da;
                }
-             u.x = big + a;
-             y = a - (u.x - big);
+             u.x = big + t;
+             y = t - (u.x - big);
              res = do_sin (u, y, db, &cor);
              cor = (cor > 0) ? 1.035 * cor + eps : 1.035 * cor - eps;
              retval = ((res == res + cor) ? ((m) ? res : -res)
@@ -671,19 +673,21 @@ __cos (double x)
            }
          else
            {
+             double t;
              if (a > 0)
                {
                  m = 1;
+                 t = a;
                  db = da;
                }
              else
                {
                  m = 0;
-                 a = -a;
+                 t = -a;
                  db = -da;
                }
-             u.x = big + a;
-             y = a - (u.x - big);
+             u.x = big + t;
+             y = t - (u.x - big);
              res = do_sin (u, y, db, &cor);
              cor = (cor > 0) ? 1.035 * cor + eps : 1.035 * cor - eps;
              retval = ((res == res + cor) ? ((m) ? res : -res)