math: use 0x1p-120f and 0x1p120f for tiny and huge values

previously 0x1p-1000 and 0x1p1000 was used for raising inexact
exception like x+tiny (when x is big) or x+huge (when x is small)

the rational is that these float consts are large enough
(0x1p-120 + 1 raises inexact even on ld128 which has 113 mant bits)
and float consts maybe smaller or easier to load on some platforms
(on i386 this reduced the object file size by 4bytes in some cases)
This commit is contained in:
Szabolcs Nagy
2012-12-16 20:28:43 +01:00
parent d8a7619e37
commit c6383b7b10
10 changed files with 27 additions and 27 deletions

View File

@ -38,14 +38,14 @@ long double acosl(long double x)
((u.bits.manh & ~LDBL_NBIT) | u.bits.manl) == 0) {
if (expsign > 0)
return 0; /* acos(1) = 0 */
return 2*pio2_hi + 0x1p-1000; /* acos(-1)= pi */
return 2*pio2_hi + 0x1p-120f; /* acos(-1)= pi */
}
return 0/(x-x); /* acos(|x|>1) is NaN */
}
/* |x| < 0.5 */
if (expt < 0x3fff - 1) {
if (expt < 0x3fff - 65)
return pio2_hi + 0x1p-1000; /* x < 0x1p-65: acosl(x)=pi/2 */
return pio2_hi + 0x1p-120f; /* x < 0x1p-65: acosl(x)=pi/2 */
return pio2_hi - (x - (pio2_lo - x * __invtrigl_R(x*x)));
}
/* x < -0.5 */