X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Ftanl.c;h=546c7a02aa72aa66b23a75a78974d921b085b63e;hb=44b4d09fc0626541ca12cf96f65adc21ab1fc413;hp=3b51e011b0fc5cc1a76a88d2a2c9a4da3d171fa4;hpb=1d5ba3bb5a3f55e10db05219638cfcd967d65417;p=musl diff --git a/src/math/tanl.c b/src/math/tanl.c index 3b51e011..546c7a02 100644 --- a/src/math/tanl.c +++ b/src/math/tanl.c @@ -53,11 +53,12 @@ long double tanl(long double x) /* |x| < (double)pi/4 */ if (z.e < M_PI_4) { - /* x = +-0 or x is subnormal */ - if (z.bits.exp == 0) - /* inexact and underflow if x!=0 */ - return x + x*0x1p-120f; - /* can raise spurious underflow */ + /* |x| < 0x1p-64 */ + if (z.bits.exp < 0x3fff - 64) { + /* raise inexact if x!=0 and underflow if subnormal */ + FORCE_EVAL(z.bits.exp == 0 ? x/0x1p120f : x+0x1p120f); + return x; + } return __tanl(x, 0, 0); }