about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@sourceware.org>2016-09-01 22:11:00 +0530
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2016-09-02 20:08:41 +0530
commit25e440c6c7b32da8720a5a18cec0d5322f7eccd0 (patch)
treea07479761316316ddba7715c5adbc6d8040aeda2 /sysdeps
parent758e79ec89c4e285bafcef601702cd27790fd78e (diff)
downloadglibc-25e440c6c7b32da8720a5a18cec0d5322f7eccd0.tar.gz
glibc-25e440c6c7b32da8720a5a18cec0d5322f7eccd0.tar.xz
glibc-25e440c6c7b32da8720a5a18cec0d5322f7eccd0.zip
Use do_sin for sin(x) where 0.25 < |x| < 0.855469
The only code looks slightly different from do_sin but on closer
examination, should give exactly the same result.  Drop it in favour
of the do_sin function call.

	* sysdeps/ieee754/dbl-64/s_sin.c (__sin): Use do_sin.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/ieee754/dbl-64/s_sin.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/sysdeps/ieee754/dbl-64/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c
index 888270f91d..7196e6433e 100644
--- a/sysdeps/ieee754/dbl-64/s_sin.c
+++ b/sysdeps/ieee754/dbl-64/s_sin.c
@@ -443,7 +443,7 @@ SECTION
 #endif
 __sin (double x)
 {
-  double xx, res, t, cor, y, s, c, sn, ssn, cs, ccs;
+  double xx, res, t, cor;
   mynumber u;
   int4 k, m;
   double retval = 0;
@@ -473,23 +473,8 @@ __sin (double x)
 /*---------------------------- 0.25<|x|< 0.855469---------------------- */
   else if (k < 0x3feb6000)
     {
-      u.x = big + fabs (x);
-      y = fabs (x) - (u.x - big);
-      y = (x > 0 ? y : -y);
-
-      xx = y * y;
-      s = y + y * xx * (sn3 + xx * sn5);
-      c = xx * (cs2 + xx * (cs4 + xx * cs6));
-      SINCOS_TABLE_LOOKUP (u, sn, ssn, cs, ccs);
-      if (m <= 0)
-        {
-          sn = -sn;
-	  ssn = -ssn;
-	}
-      cor = (ssn + s * ccs - sn * c) + cs * s;
-      res = sn + cor;
-      cor = (sn - res) + cor;
-      retval = (res == res + 1.096 * cor) ? res : slow1 (x);
+      res = do_sin (x, 0, &cor);
+      retval = (res == res + 1.096 * cor) ? (m > 0 ? res : -res) : slow1 (x);
     }				/*   else  if (k < 0x3feb6000)    */
 
 /*----------------------- 0.855469  <|x|<2.426265  ----------------------*/