diff --git a/math/s_ctanh.c b/math/s_ctanh.c index fe38dae..ff2872b 100644 --- a/math/s_ctanh.c +++ b/math/s_ctanh.c @@ -68,6 +68,11 @@ __ctanh (__complex__ double x) res = (ez - emz) / (ez + emz); } + else if (__isinf (den)) + { + __real__ res = __copysign (1.0, __real__ x); + __imag__ res = __copysign (0.0, sin2ix); + } else { __real__ res = __ieee754_sinh (2.0 * __real__ x) / den; diff --git a/math/s_ctanhf.c b/math/s_ctanhf.c index c331dba..84053c0 100644 --- a/math/s_ctanhf.c +++ b/math/s_ctanhf.c @@ -68,6 +68,11 @@ __ctanhf (__complex__ float x) res = (ez - emz) / (ez + emz); } + else if (__isinff (den)) + { + __real__ res = __copysign (1.0, __real__ x); + __imag__ res = __copysign (0.0, sin2ix); + } else { __real__ res = __ieee754_sinhf (2.0 * __real__ x) / den; diff --git a/math/s_ctanhl.c b/math/s_ctanhl.c index 77ca8f8..672a3d1 100644 --- a/math/s_ctanhl.c +++ b/math/s_ctanhl.c @@ -68,6 +68,11 @@ __ctanhl (__complex__ long double x) res = (ez - emz) / (ez + emz); } + else if (__isinfl (den)) + { + __real__ res = __copysign (1.0, __real__ x); + __imag__ res = __copysign (0.0, sin2ix); + } else { __real__ res = __ieee754_sinhl (2.0 * __real__ x) / den;