about summary refs log tree commit diff
path: root/sysdeps/ieee754/dbl-64/s_sincos.c
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh.poyarekar@linaro.org>2015-12-21 10:43:04 +0530
committerSiddhesh Poyarekar <siddhesh.poyarekar@linaro.org>2015-12-21 10:43:04 +0530
commitb300455644e2945da05eb49d12d3a037f1408be1 (patch)
tree71301f70e68810cdac8ab2ee812e0f3343ae1e8b /sysdeps/ieee754/dbl-64/s_sincos.c
parentf7953c44d545c91442f123300288853284501dab (diff)
downloadglibc-b300455644e2945da05eb49d12d3a037f1408be1.tar.gz
glibc-b300455644e2945da05eb49d12d3a037f1408be1.tar.xz
glibc-b300455644e2945da05eb49d12d3a037f1408be1.zip
Consolidate sincos computation for 2.426265 < |x| < 105414350
Like the previous change, exploit the fact that computation for sin
and cos is identical except that it is apart by a quadrant.  Also
remove csloww, csloww1 and csloww2 since they can easily be expressed
in terms of sloww, sloww1 and sloww2.
Diffstat (limited to 'sysdeps/ieee754/dbl-64/s_sincos.c')
-rw-r--r--sysdeps/ieee754/dbl-64/s_sincos.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sysdeps/ieee754/dbl-64/s_sincos.c b/sysdeps/ieee754/dbl-64/s_sincos.c
index 7f78b4106f..0290004642 100644
--- a/sysdeps/ieee754/dbl-64/s_sincos.c
+++ b/sysdeps/ieee754/dbl-64/s_sincos.c
@@ -69,12 +69,22 @@ __sincos (double x, double *sinx, double *cosx)
   u.x = x;
   k = 0x7fffffff & u.i[HIGH_HALF];
 
-  if (k < 0x419921FB)
+  if (k < 0x400368fd)
     {
       *sinx = __sin_local (x);
       *cosx = __cos_local (x);
       return;
     }
+  if (k < 0x419921FB)
+    {
+      double a, da;
+      int4 n = reduce_sincos_1 (x, &a, &da);
+
+      *sinx = do_sincos_1 (a, da, x, n, 0);
+      *cosx = do_sincos_1 (a, da, x, n, 1);
+
+      return;
+    }
   if (k < 0x42F00000)
     {
       double a, da;