X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fasinhl.c;h=8635f52e82381bdaff12badbd7cd170b2e05bf62;hb=f9895817321790bef33a56e3b10f3f71d989c23e;hp=db9662468ac244db9c81346d03f12cf2fe2a1ec6;hpb=969ddbc423238291d5c7982790bbe72720627ba4;p=musl diff --git a/src/math/asinhl.c b/src/math/asinhl.c index db966246..8635f52e 100644 --- a/src/math/asinhl.c +++ b/src/math/asinhl.c @@ -9,10 +9,7 @@ long double asinhl(long double x) /* asinh(x) = sign(x)*log(|x|+sqrt(x*x+1)) ~= x - x^3/6 + o(x^5) */ long double asinhl(long double x) { - union { - long double f; - struct{uint64_t m; uint16_t se; uint16_t pad;} i; - } u = {.f = x}; + union ldshape u = {x}; unsigned e = u.i.se & 0x7fff; unsigned s = u.i.se >> 15; @@ -31,8 +28,14 @@ long double asinhl(long double x) x = log1pl(x + x*x/(sqrtl(x*x+1)+1)); } else { /* |x| < 0x1p-32, raise inexact if x!=0 */ - FORCE_EVAL(x + 0x1p1000); + FORCE_EVAL(x + 0x1p120f); } return s ? -x : x; } +#elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384 +// TODO: broken implementation to make things compile +long double asinhl(long double x) +{ + return asinh(x); +} #endif