X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fasinf.c;h=bcd304a3425991689cbf14dd1cd575a43a8b1117;hb=d1a2ead878c27ac4ec600740320f8b76e1f961e9;hp=462bf0431e7e610d39d4f456b631120f86c2d4af;hpb=969ddbc423238291d5c7982790bbe72720627ba4;p=musl diff --git a/src/math/asinf.c b/src/math/asinf.c index 462bf043..bcd304a3 100644 --- a/src/math/asinf.c +++ b/src/math/asinf.c @@ -26,7 +26,7 @@ qS1 = -7.0662963390e-01; static float R(float z) { - float p, q; + float_t p, q; p = z*(pS0+z*(pS1+z*pS2)); q = 1.0f+z*qS1; return p/q; @@ -46,10 +46,9 @@ float asinf(float x) return 0/(x-x); /* asin(|x|>1) is NaN */ } if (ix < 0x3f000000) { /* |x| < 0.5 */ - if (ix < 0x39800000) { /* |x| < 2**-12 */ - FORCE_EVAL(x + 0x1p120f); - return x; /* return x with inexact if x!=0 */ - } + /* if 0x1p-126 <= |x| < 0x1p-12, avoid raising underflow */ + if (ix < 0x39800000 && ix >= 0x00800000) + return x; return x + x*R(x*x); } /* 1 > |x| >= 0.5 */