diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-11-15 08:37:58 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-11-15 08:37:58 -0500 |
commit | 8bb181622222f2ee3462c8b021bcae4fcdbbd37a (patch) | |
tree | 166a1be834c8cd5a4c2521d41d7ee506bd8c8e51 /src/complex/ctanh.c | |
parent | 22781b4d8ecaf97ac52d2a501a2e7d3bc1920ce0 (diff) | |
parent | 68847ecd3a644d3ffd9be58603be1a3fa437dff0 (diff) | |
download | musl-8bb181622222f2ee3462c8b021bcae4fcdbbd37a.tar.gz |
Merge remote-tracking branch 'nsz/math'
Diffstat (limited to 'src/complex/ctanh.c')
-rw-r--r-- | src/complex/ctanh.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/complex/ctanh.c b/src/complex/ctanh.c index dd569fc3..0461050d 100644 --- a/src/complex/ctanh.c +++ b/src/complex/ctanh.c @@ -95,9 +95,9 @@ double complex ctanh(double complex z) */ if (ix >= 0x7ff00000) { if ((ix & 0xfffff) | lx) /* x is NaN */ - return cpack(x, (y == 0 ? y : x * y)); + return CMPLX(x, (y == 0 ? y : x * y)); SET_HIGH_WORD(x, hx - 0x40000000); /* x = copysign(1, x) */ - return cpack(x, copysign(0, isinf(y) ? y : sin(y) * cos(y))); + return CMPLX(x, copysign(0, isinf(y) ? y : sin(y) * cos(y))); } /* @@ -105,7 +105,7 @@ double complex ctanh(double complex z) * ctanh(x +- i Inf) = NaN + i NaN */ if (!isfinite(y)) - return cpack(y - y, y - y); + return CMPLX(y - y, y - y); /* * ctanh(+-huge + i +-y) ~= +-1 +- i 2sin(2y)/exp(2x), using the @@ -114,7 +114,7 @@ double complex ctanh(double complex z) */ if (ix >= 0x40360000) { /* x >= 22 */ double exp_mx = exp(-fabs(x)); - return cpack(copysign(1, x), 4 * sin(y) * cos(y) * exp_mx * exp_mx); + return CMPLX(copysign(1, x), 4 * sin(y) * cos(y) * exp_mx * exp_mx); } /* Kahan's algorithm */ @@ -123,5 +123,5 @@ double complex ctanh(double complex z) s = sinh(x); rho = sqrt(1 + s * s); /* = cosh(x) */ denom = 1 + beta * s * s; - return cpack((beta * rho * s) / denom, t / denom); + return CMPLX((beta * rho * s) / denom, t / denom); } |