2000-05-26 Marek Michalkiewicz <marekm@linux.org.pl>
* libm/common/s_expm1.c (expm1): Add curly braces, avoid warnings. * libm/common/s_log1p.c (log1p): Likewise. * libm/common/s_scalbn.c (scalbn): Likewise. * libm/math/e_log.c: Likewise. * libm/math/e_asin.c: Likewise. * libm/math/ef_asin.c: Likewise. * libm/math/e_j0.c (pzero, qzero): Remove redundant test. * libm/math/e_j1.c (pone, qone): Likewise. * libm/math/ef_j0.c (pzerof, qzerof): Likewise. * libm/math/ef_j1.c (ponef, qonef): Likewise. * libm/mathfp/e_j0.c (pzero, qzero): Likewise. * libm/mathfp/e_j1.c (pone, qone): Likewise. * libm/mathfp/ef_j0.c (pzerof, qzerof): Likewise. * libm/mathfp/ef_j1.c (ponef, qonef): Likewise.
This commit is contained in:
@ -239,9 +239,10 @@ Q5 = -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */
|
||||
e = (x*(e-c)-c);
|
||||
e -= hxs;
|
||||
if(k== -1) return 0.5*(x-e)-0.5;
|
||||
if(k==1)
|
||||
if(k==1) {
|
||||
if(x < -0.25) return -2.0*(e-(x+0.5));
|
||||
else return one+2.0*(x-e);
|
||||
}
|
||||
if (k <= -2 || k>56) { /* suffice to return exp(x)-1 */
|
||||
__uint32_t high;
|
||||
y = one-(e-x);
|
||||
|
@ -201,8 +201,8 @@ static double zero = 0.0;
|
||||
}
|
||||
hfsq=0.5*f*f;
|
||||
if(hu==0) { /* |f| < 2**-20 */
|
||||
if(f==zero) if(k==0) return zero;
|
||||
else {c += k*ln2_lo; return k*ln2_hi+c;}
|
||||
if(f==zero) { if(k==0) return zero;
|
||||
else {c += k*ln2_lo; return k*ln2_hi+c;}}
|
||||
R = hfsq*(1.0-0.66666666666666666*f);
|
||||
if(k==0) return f-R; else
|
||||
return k*ln2_hi-((R-(k*ln2_lo+c))-f);
|
||||
|
@ -91,10 +91,11 @@ tiny = 1.0e-300;
|
||||
if (k > 0x7fe) return huge*copysign(huge,x); /* overflow */
|
||||
if (k > 0) /* normal result */
|
||||
{SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;}
|
||||
if (k <= -54)
|
||||
if (k <= -54) {
|
||||
if (n > 50000) /* in case integer overflow in n+k */
|
||||
return huge*copysign(huge,x); /*overflow*/
|
||||
else return tiny*copysign(tiny,x); /*underflow*/
|
||||
}
|
||||
k += 54; /* subnormal result */
|
||||
SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20));
|
||||
return x*twom54;
|
||||
|
Reference in New Issue
Block a user