Update the constants associated with the evaluation of j0f(x)

for |x| small.

While here, remove the explicit cast of 0.25 to float.  Replace
a multiplication involving 0.25 by a division using an integer
constant 4.  Make a similar change in j0() to minimize the diff.

Suggested by:	bde
This commit is contained in:
Steve Kargl 2014-12-05 19:00:55 +00:00
parent 26f96d922b
commit 2656e946c8
2 changed files with 4 additions and 4 deletions

View File

@ -115,7 +115,7 @@ __ieee754_j0(double x)
if(ix<0x3f200000) { /* |x| < 2**-13 */
if(huge+x>one) { /* raise inexact if x != 0 */
if(ix<0x3e400000) return one; /* |x|<2**-27 */
else return one - 0.25*x*x;
else return one - x*x/4;
}
}
z = x*x;

View File

@ -69,10 +69,10 @@ __ieee754_j0f(float x)
}
return z;
}
if(ix<0x39000000) { /* |x| < 2**-13 */
if(ix<0x3c000000) { /* |x| < 2**-7 */
if(huge+x>one) { /* raise inexact if x != 0 */
if(ix<0x32000000) return one; /* |x|<2**-27 */
else return one - (float)0.25*x*x;
if(ix<0x39800000) return one; /* |x|<2**-12 */
else return one - x*x/4;
}
}
z = x*x;