SHA256
1
0
forked from pool/glibc
glibc/sin-sign.patch
2014-02-26 13:47:49 +00:00

55 lines
1.2 KiB
Diff

Index: glibc-2.19/sysdeps/ieee754/dbl-64/s_sin.c
===================================================================
--- glibc-2.19.orig/sysdeps/ieee754/dbl-64/s_sin.c
+++ glibc-2.19/sysdeps/ieee754/dbl-64/s_sin.c
@@ -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)