diff options
author | bde <bde@FreeBSD.org> | 2005-11-02 06:45:21 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2005-11-02 06:45:21 +0000 |
commit | 481c63491ce1b6f2a5252e58abf8b9db6264b607 (patch) | |
tree | 4fe60fd4ecbfa94df57c56fd406e58c8d8856aa2 /lib | |
parent | 5a81eebcee6e102fd8df655042b5b6d383bddc1c (diff) | |
download | FreeBSD-src-481c63491ce1b6f2a5252e58abf8b9db6264b607.zip FreeBSD-src-481c63491ce1b6f2a5252e58abf8b9db6264b607.tar.gz |
Removed dead code for handling tan[f]() on odd multiples of pi/2. This
case never occurs since pi/2 is irrational so no multiple of it can
be represented as a float and we have precise arg reduction so we never
end up with a remainder of 0 in the "kernel" function unless the
original arg is 0.
If this case occurs, then we would now fall through to general code
that returns +-Inf (depending on the sign of the reduced arg) instead
of forcing +Inf. The correct handling would be to return NaN since
we would have lost so much precision that the correct result can be
anything _except_ +-Inf.
Don't reindent the else clause left over from this, although it was already
bogusly indented ("if (foo) return; else ..." just marches the indentation
to the right), since it will be removed too.
Index: k_tan.c
===================================================================
RCS file: /home/ncvs/src/lib/msun/src/k_tan.c,v
retrieving revision 1.10
diff -r1.10 k_tan.c
88,90c88
< if (((ix | low) | (iy + 1)) == 0)
< return one / fabs(x);
< else {
---
> {
Diffstat (limited to 'lib')
-rw-r--r-- | lib/msun/src/k_tan.c | 4 | ||||
-rw-r--r-- | lib/msun/src/k_tanf.c | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/lib/msun/src/k_tan.c b/lib/msun/src/k_tan.c index 16b2dd0..15145a6 100644 --- a/lib/msun/src/k_tan.c +++ b/lib/msun/src/k_tan.c @@ -85,9 +85,7 @@ __kernel_tan(double x, double y, int iy) { if ((int) x == 0) { /* generate inexact */ u_int32_t low; GET_LOW_WORD(low,x); - if (((ix | low) | (iy + 1)) == 0) - return one / fabs(x); - else { + { if (iy == 1) return x; else { /* compute -1 / (x+y) carefully */ diff --git a/lib/msun/src/k_tanf.c b/lib/msun/src/k_tanf.c index 47aab9c..e344787 100644 --- a/lib/msun/src/k_tanf.c +++ b/lib/msun/src/k_tanf.c @@ -47,9 +47,7 @@ __kernel_tanf(float x, float y, int iy) ix = hx&0x7fffffff; /* high word of |x| */ if(ix<0x31800000) { /* x < 2**-28 */ if ((int) x == 0) { /* generate inexact */ - if ((ix | (iy + 1)) == 0) - return one / fabsf(x); - else { + { if (iy == 1) return x; else { /* compute -1 / (x+y) carefully */ |