[PATCH 2/4] Check n instead of k1 to decide on sign of sin/cos result
Siddhesh Poyarekar
siddhesh@sourceware.org
Tue Sep 27 17:49:00 GMT 2016
For k1 in 1 and 3, n can only have values of 0 and 2, so checking k1 &
2 is equivalent to checking n & 2. We prefer the latter so that we
don't use k1 for anything other than selecting the quadrant in
do_sincos_1, thus dropping it completely.
* sysdeps/ieee754/dbl-64/s_sin.c (do_sincos_1): Check N
instead of K1.
---
sysdeps/ieee754/dbl-64/s_sin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sysdeps/ieee754/dbl-64/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c
index d60feb4..ea41a7c 100644
--- a/sysdeps/ieee754/dbl-64/s_sin.c
+++ b/sysdeps/ieee754/dbl-64/s_sin.c
@@ -353,7 +353,7 @@ do_sincos_1 (double a, double da, double x, int4 n, int4 k)
case 3:
res = do_cos (a, da, &cor);
cor = (cor > 0) ? 1.025 * cor + eps : 1.025 * cor - eps;
- retval = ((res == res + cor) ? ((k1 & 2) ? -res : res)
+ retval = ((res == res + cor) ? ((n & 2) ? -res : res)
: sloww2 (a, da, x, n));
break;
}
--
2.7.4
More information about the Libc-alpha
mailing list