aboutsummaryrefslogtreecommitdiff
path: root/math/s_ctanhf.c
diff options
context:
space:
mode:
Diffstat (limited to 'math/s_ctanhf.c')
-rw-r--r--math/s_ctanhf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/math/s_ctanhf.c b/math/s_ctanhf.c
index 9d15c3e..3ce8ac1 100644
--- a/math/s_ctanhf.c
+++ b/math/s_ctanhf.c
@@ -33,7 +33,14 @@ __ctanhf (__complex__ float x)
if (__isinf_nsf (__real__ x))
{
__real__ res = __copysignf (1.0, __real__ x);
- __imag__ res = __copysignf (0.0, __imag__ x);
+ if (isfinite (__imag__ x) && fabsf (__imag__ x) > 1.0f)
+ {
+ float sinix, cosix;
+ __sincosf (__imag__ x, &sinix, &cosix);
+ __imag__ res = __copysignf (0.0f, sinix * cosix);
+ }
+ else
+ __imag__ res = __copysignf (0.0, __imag__ x);
}
else if (__imag__ x == 0.0)
{