diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-03-19 22:07:43 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-03-19 22:07:43 -0400 |
commit | 97721a5508415a2f10eb068e022093811c9ff8be (patch) | |
tree | 88e9ce153895ad949576fa7ce1eeee4b02286479 /src/math/tanhl.c | |
parent | acb744921b73f5a73803e533e5e4a4896d164a26 (diff) | |
parent | 0cbb65479147ecdaa664e88cc2a5a925f3de502f (diff) | |
download | musl-97721a5508415a2f10eb068e022093811c9ff8be.tar.gz musl-97721a5508415a2f10eb068e022093811c9ff8be.tar.xz musl-97721a5508415a2f10eb068e022093811c9ff8be.zip |
Merge remote branch 'nsz/master'
Diffstat (limited to 'src/math/tanhl.c')
-rw-r--r-- | src/math/tanhl.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/math/tanhl.c b/src/math/tanhl.c index e62be59b..92efb20d 100644 --- a/src/math/tanhl.c +++ b/src/math/tanhl.c @@ -41,7 +41,7 @@ long double tanhl(long double x) return tanh(x); } #elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 -static const long double one=1.0, two=2.0, tiny = 1.0e-4900L; +static const long double tiny = 1.0e-4900L; long double tanhl(long double x) { @@ -57,8 +57,8 @@ long double tanhl(long double x) if (ix == 0x7fff) { /* for NaN it's not important which branch: tanhl(NaN) = NaN */ if (se & 0x8000) - return one/x-one; /* tanhl(-inf)= -1; */ - return one/x+one; /* tanhl(+inf)= +1 */ + return 1.0/x-1.0; /* tanhl(-inf)= -1; */ + return 1.0/x+1.0; /* tanhl(+inf)= +1 */ } /* |x| < 23 */ @@ -66,17 +66,17 @@ long double tanhl(long double x) if ((ix|jj0|jj1) == 0) /* x == +- 0 */ return x; if (ix < 0x3fc8) /* |x| < 2**-55 */ - return x*(one+tiny); /* tanh(small) = small */ + return x*(1.0+tiny); /* tanh(small) = small */ if (ix >= 0x3fff) { /* |x| >= 1 */ - t = expm1l(two*fabsl(x)); - z = one - two/(t+two); + t = expm1l(2.0*fabsl(x)); + z = 1.0 - 2.0/(t+2.0); } else { - t = expm1l(-two*fabsl(x)); - z = -t/(t+two); + t = expm1l(-2.0*fabsl(x)); + z = -t/(t+2.0); } /* |x| > 23, return +-1 */ } else { - z = one - tiny; /* raise inexact flag */ + z = 1.0 - tiny; /* raise inexact flag */ } return se & 0x8000 ? -z : z; } |