diff options
author | Bruce Evans <bde@FreeBSD.org> | 2005-11-12 20:06:04 +0000 |
---|---|---|
committer | Bruce Evans <bde@FreeBSD.org> | 2005-11-12 20:06:04 +0000 |
commit | e96c4fd9f7acfed01430ff68d3e299fb64d2f1ac (patch) | |
tree | 8e048201ff4692a9ee9ac61c49b7bfdc169c8153 | |
parent | d40f7f8b3e3af7597e1caf4979ac067e971a89b8 (diff) | |
download | src-e96c4fd9f7acfed01430ff68d3e299fb64d2f1ac.tar.gz src-e96c4fd9f7acfed01430ff68d3e299fb64d2f1ac.zip |
Imoproved comments for the minimax polynomial.
Removed an unused variable.
Fixed some wrong comments and some nearby misformatting.
Notes
Notes:
svn path=/head/; revision=152343
-rw-r--r-- | lib/msun/src/k_tanf.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/msun/src/k_tanf.c b/lib/msun/src/k_tanf.c index e7b816d3e41f..31b313770832 100644 --- a/lib/msun/src/k_tanf.c +++ b/lib/msun/src/k_tanf.c @@ -18,18 +18,18 @@ static char rcsid[] = "$FreeBSD$"; #include "math.h" #include "math_private.h" + static const float -one = 1.0000000000e+00, /* 0x3f800000 */ pio4 = 7.8539812565e-01, /* 0x3f490fda */ pio4lo= 3.7748947079e-08, /* 0x33222168 */ -/* Bounds for tan(x)/x - t(x): ~[-1.73e-09, 1.724e-09]. */ +/* |tan(x)/x - t(x)| < 2**-29.2 (~[-1.73e-09, 1.724e-09]). */ T[] = { - 0xaaaaa3.0p-25, /* 0.33333310485 */ - 0x888b06.0p-26, /* 0.13334283238 */ - 0xdc84c8.0p-28, /* 0.053837567568 */ - 0xb9d8f1.0p-29, /* 0.022686453536 */ - 0xcfe632.0p-31, /* 0.0063445800915 */ - 0xeaf97e.0p-31, /* 0.0071708550677 */ + 0xaaaaa3.0p-25, /* 0.33333310485 */ + 0x888b06.0p-26, /* 0.13334283238 */ + 0xdc84c8.0p-28, /* 0.053837567568 */ + 0xb9d8f1.0p-29, /* 0.022686453536 */ + 0xcfe632.0p-31, /* 0.0063445800915 */ + 0xeaf97e.0p-31, /* 0.0071708550677 */ }; float @@ -37,9 +37,10 @@ __kernel_tanf(float x, float y, int iy) { float z,r,v,w,s; int32_t ix,hx; + GET_FLOAT_WORD(hx,x); - ix = hx&0x7fffffff; /* high word of |x| */ - if(ix>=0x3f2ca140) { /* |x|>=0.6744 */ + ix = hx&0x7fffffff; + if(ix>=0x3f2ca140) { /* |x|>=0.67434 */ if(hx<0) {x = -x; y = -y;} z = pio4-x; w = pio4lo-y; |