diff options
author | Elliott Hughes <enh@google.com> | 2015-08-28 20:21:43 -0700 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-11-07 01:42:32 -0800 |
commit | 795a57e08bb61fb0c2ae22d9f7a3ae6312511fed (patch) | |
tree | 347d4ddf0e4f68eaa591fd0fff643fb5e02ebe4c /libm/upstream-freebsd/lib/msun/src/s_ctanhf.c | |
parent | 245c1718cb035268284bea8dabe3faa3f8326ee8 (diff) | |
download | bionic-795a57e08bb61fb0c2ae22d9f7a3ae6312511fed.zip bionic-795a57e08bb61fb0c2ae22d9f7a3ae6312511fed.tar.gz bionic-795a57e08bb61fb0c2ae22d9f7a3ae6312511fed.tar.bz2 |
Sync with upstream FreeBSD libm.
Change-Id: I97e9b23903f1d993d84825806065e85626007d31
Diffstat (limited to 'libm/upstream-freebsd/lib/msun/src/s_ctanhf.c')
-rw-r--r-- | libm/upstream-freebsd/lib/msun/src/s_ctanhf.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/libm/upstream-freebsd/lib/msun/src/s_ctanhf.c b/libm/upstream-freebsd/lib/msun/src/s_ctanhf.c index 4be28d8..e9826c0 100644 --- a/libm/upstream-freebsd/lib/msun/src/s_ctanhf.c +++ b/libm/upstream-freebsd/lib/msun/src/s_ctanhf.c @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD: head/lib/msun/src/s_ctanhf.c 284428 2015-06-15 20:47:26Z tijl $"); #include <complex.h> #include <math.h> @@ -51,18 +51,19 @@ ctanhf(float complex z) if (ix >= 0x7f800000) { if (ix & 0x7fffff) - return (cpackf(x, (y == 0 ? y : x * y))); + return (CMPLXF((x + 0) * (y + 0), + y == 0 ? y : (x + 0) * (y + 0))); SET_FLOAT_WORD(x, hx - 0x40000000); - return (cpackf(x, + return (CMPLXF(x, copysignf(0, isinf(y) ? y : sinf(y) * cosf(y)))); } if (!isfinite(y)) - return (cpackf(y - y, y - y)); + return (CMPLXF(y - y, y - y)); - if (ix >= 0x41300000) { /* x >= 11 */ + if (ix >= 0x41300000) { /* |x| >= 11 */ float exp_mx = expf(-fabsf(x)); - return (cpackf(copysignf(1, x), + return (CMPLXF(copysignf(1, x), 4 * sinf(y) * cosf(y) * exp_mx * exp_mx)); } @@ -71,14 +72,14 @@ ctanhf(float complex z) s = sinhf(x); rho = sqrtf(1 + s * s); denom = 1 + beta * s * s; - return (cpackf((beta * rho * s) / denom, t / denom)); + return (CMPLXF((beta * rho * s) / denom, t / denom)); } float complex ctanf(float complex z) { - z = ctanhf(cpackf(-cimagf(z), crealf(z))); - return (cpackf(cimagf(z), -crealf(z))); + z = ctanhf(CMPLXF(cimagf(z), crealf(z))); + return (CMPLXF(cimagf(z), crealf(z))); } |