* msun/man/cosh.3:
* msun/man/sinh.3: * msun/man/tanh.3: . Fix grammar. * msun/src/e_coshl.c: * msun/src/e_sinhl.c: . Fix comment. * msun/src/s_tanhl.c: . Remove unused variables. . Fix location/indentation of comments. . Use comparison involving ints instead of long double. . Re-order polynomial evaluation on ld128 for |x| < 0.25. For now, retain the older order in an "#if 0 ... #else" block. . Use int comparison to short-circuit the |x| < 1.5 condition. Requested by: bde
This commit is contained in:
parent
f86b34932a
commit
1531aa5f6a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=260145
@ -50,7 +50,7 @@
|
||||
The
|
||||
.Fn cosh ,
|
||||
.Fn coshf ,
|
||||
and the
|
||||
and
|
||||
.Fn coshl
|
||||
functions compute the hyperbolic cosine of
|
||||
.Fa x .
|
||||
|
@ -50,7 +50,7 @@
|
||||
The
|
||||
.Fn sinh ,
|
||||
.Fn sinhf ,
|
||||
and the
|
||||
and
|
||||
.Fn sinhl
|
||||
functions compute the hyperbolic sine of
|
||||
.Fa x .
|
||||
|
@ -50,7 +50,7 @@
|
||||
The
|
||||
.Fn tanh ,
|
||||
.Fn tanhf ,
|
||||
and the
|
||||
and
|
||||
.Fn tanhl
|
||||
functions compute the hyperbolic tangent of
|
||||
.Fa x .
|
||||
|
@ -78,7 +78,7 @@ C26 = 2.5022374732804632e-27; /* 0x18c7ecf8b2c4a0.0p-141 */
|
||||
#error "Unsupported long double format"
|
||||
#endif /* LDBL_MANT_DIG == 64 */
|
||||
|
||||
/* log(2**16385 - 0.5) rounded towards up: */
|
||||
/* log(2**16385 - 0.5) rounded up: */
|
||||
static const float
|
||||
o_threshold = 1.13572168e4; /* 0xb174de.0p-10 */
|
||||
|
||||
|
@ -77,7 +77,7 @@ S25 = 6.5067867911512749e-26; /* 0x1423352626048a.0p-136 */
|
||||
#error "Unsupported long double format"
|
||||
#endif /* LDBL_MANT_DIG == 64 */
|
||||
|
||||
/* log(2**16385 - 0.5) rounded towards up: */
|
||||
/* log(2**16385 - 0.5) rounded up: */
|
||||
static const float
|
||||
o_threshold = 1.13572168e4; /* 0xb174de.0p-10 */
|
||||
|
||||
|
@ -86,9 +86,8 @@ static inline long double
|
||||
divl(long double a, long double b, long double c, long double d,
|
||||
long double e, long double f)
|
||||
{
|
||||
long double inv, r, w;
|
||||
long double inv, r;
|
||||
float fr, fw;
|
||||
uint32_t hx;
|
||||
|
||||
_2sumF(a, c);
|
||||
b = b + c;
|
||||
@ -128,12 +127,13 @@ tanhl(long double x)
|
||||
|
||||
ENTERI();
|
||||
|
||||
if (fabsl(x) < 40) { /* |x|<40 */
|
||||
/* |x| < 40 */
|
||||
if (ix < 0x4004 || fabsl(x) < 40) { /* |x|<40 */
|
||||
if (__predict_false(ix<BIAS-(LDBL_MANT_DIG+1)/2)) { /* |x|<TINY */
|
||||
/* tanh(+-0) = +0; tanh(tiny) = tiny(-+) with inexact: */
|
||||
return (x == 0 ? x : (0x1p200 * x - x) * 0x1p-200);
|
||||
}
|
||||
if (fabsl(x) < 0.25) { /* |x|<0.25 */
|
||||
if (ix<0x3ffd) { /* |x|<0.25 */
|
||||
x2 = x*x;
|
||||
#if LDBL_MANT_DIG == 64
|
||||
x4 = x2*x2;
|
||||
@ -142,15 +142,23 @@ tanhl(long double x)
|
||||
T3*(x2*x) + x);
|
||||
#elif LDBL_MANT_DIG == 113
|
||||
dx2 = x2;
|
||||
#if 0
|
||||
RETURNI(((((((((((((((T33*dx2 + T31)*dx2 + T29)*dx2 + T27)*dx2 +
|
||||
T25)*x2 + T23)*x2 + T21)*x2 + T19)*x2 + T17)*x2 +
|
||||
T15)*x2 + T13)*x2 + T11)*x2 + T9)*x2 + T7)*x2 + T5)*
|
||||
(x2*x*x2) +
|
||||
T3*(x2*x) + x);
|
||||
#else
|
||||
long double q = ((((((((((((((T33*dx2 + T31)*dx2 + T29)*dx2 + T27)*dx2 +
|
||||
T25)*x2 + T23)*x2 + T21)*x2 + T19)*x2 + T17)*x2 +
|
||||
T15)*x2 + T13)*x2 + T11)*x2 + T9)*x2 + T7)*x2 + T5)*
|
||||
(x2*x*x2);
|
||||
RETURNI(q + T3*(x2*x) + x);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
k_hexpl(2*fabsl(x), &hi, &lo);
|
||||
if (fabsl(x) < 1.5) /* |x|<1.5 */
|
||||
if (ix<0x4001 && fabsl(x) < 1.5) /* |x|<1.5 */
|
||||
z = divl(hi, lo, -0.5, hi, lo, 0.5);
|
||||
else
|
||||
z = one - one/(lo+0.5+hi);
|
||||
|
Loading…
Reference in New Issue
Block a user