about summary refs log tree commit diff
path: root/src/math/j0f.c
diff options
context:
space:
mode:
authorSzabolcs Nagy <nsz@port70.net>2017-03-15 02:55:49 +0100
committerRich Felker <dalias@aerifal.cx>2017-03-15 00:15:28 -0400
commit8cba1dc46c8f29261aa441e70bac798f2c2c0f58 (patch)
tree69ab34ac1a1dfa914a9ffdc3498592a667850309 /src/math/j0f.c
parentcb525397bb053ea49cf160965477a17b17286eb3 (diff)
downloadmusl-8cba1dc46c8f29261aa441e70bac798f2c2c0f58.tar.gz
musl-8cba1dc46c8f29261aa441e70bac798f2c2c0f58.tar.xz
musl-8cba1dc46c8f29261aa441e70bac798f2c2c0f58.zip
fix threshold constants in j0f, y0f, j1f, y1f
partly following freebsd rev 279491
https://svnweb.freebsd.org/base?view=revision&revision=279491
(musl had some of the fixes before freebsd).

the change should not matter much for j0f, y0f, but it improves
j1f and y1f in [2.5,~3.75] (that is [0x40200000,~0x40700000]).
near roots (e.g. around 3.8317 for j1f) there are still large
ulp errors.

dropped code that tried to raise inexact.
Diffstat (limited to 'src/math/j0f.c')
-rw-r--r--src/math/j0f.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/math/j0f.c b/src/math/j0f.c
index 45883dc4..fab554a3 100644
--- a/src/math/j0f.c
+++ b/src/math/j0f.c
@@ -208,8 +208,8 @@ static float pzerof(float x)
 	GET_FLOAT_WORD(ix, x);
 	ix &= 0x7fffffff;
 	if      (ix >= 0x41000000){p = pR8; q = pS8;}
-	else if (ix >= 0x40f71c58){p = pR5; q = pS5;}
-	else if (ix >= 0x4036db68){p = pR3; q = pS3;}
+	else if (ix >= 0x409173eb){p = pR5; q = pS5;}
+	else if (ix >= 0x4036d917){p = pR3; q = pS3;}
 	else /*ix >= 0x40000000*/ {p = pR2; q = pS2;}
 	z = 1.0f/(x*x);
 	r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
@@ -304,8 +304,8 @@ static float qzerof(float x)
 	GET_FLOAT_WORD(ix, x);
 	ix &= 0x7fffffff;
 	if      (ix >= 0x41000000){p = qR8; q = qS8;}
-	else if (ix >= 0x40f71c58){p = qR5; q = qS5;}
-	else if (ix >= 0x4036db68){p = qR3; q = qS3;}
+	else if (ix >= 0x409173eb){p = qR5; q = qS5;}
+	else if (ix >= 0x4036d917){p = qR3; q = qS3;}
 	else /*ix >= 0x40000000*/ {p = qR2; q = qS2;}
 	z = 1.0f/(x*x);
 	r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));