diff options
author | Szabolcs Nagy <nsz@port70.net> | 2012-12-16 20:28:43 +0100 |
---|---|---|
committer | Szabolcs Nagy <nsz@port70.net> | 2012-12-16 20:28:43 +0100 |
commit | c6383b7b10303457306932584fc23f24b5153a81 (patch) | |
tree | ebc0a95cb34bcb501060b1679f14a19c7d92c91c /src/math/acos.c | |
parent | d8a7619e371ff0f226200f6316abb46dd1192f3d (diff) | |
download | musl-c6383b7b10303457306932584fc23f24b5153a81.tar.gz musl-c6383b7b10303457306932584fc23f24b5153a81.tar.bz2 musl-c6383b7b10303457306932584fc23f24b5153a81.tar.xz musl-c6383b7b10303457306932584fc23f24b5153a81.zip |
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)
Diffstat (limited to 'src/math/acos.c')
-rw-r--r-- | src/math/acos.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/math/acos.c b/src/math/acos.c index be95d25e..cd5d06a6 100644 --- a/src/math/acos.c +++ b/src/math/acos.c @@ -72,7 +72,7 @@ double acos(double x) if ((ix-0x3ff00000 | lx) == 0) { /* acos(1)=0, acos(-1)=pi */ if (hx >> 31) - return 2*pio2_hi + 0x1p-1000; + return 2*pio2_hi + 0x1p-120f; return 0; } return 0/(x-x); @@ -80,7 +80,7 @@ double acos(double x) /* |x| < 0.5 */ if (ix < 0x3fe00000) { if (ix <= 0x3c600000) /* |x| < 2**-57 */ - return pio2_hi + 0x1p-1000; + return pio2_hi + 0x1p-120f; return pio2_hi - (x - (pio2_lo-x*R(x*x))); } /* x < -0.5 */ |