summaryrefslogtreecommitdiff
path: root/sysdeps/libm-ieee754/s_ctanl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/libm-ieee754/s_ctanl.c')
-rw-r--r--sysdeps/libm-ieee754/s_ctanl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sysdeps/libm-ieee754/s_ctanl.c b/sysdeps/libm-ieee754/s_ctanl.c
index 82f86fc148..b4a2b4a13c 100644
--- a/sysdeps/libm-ieee754/s_ctanl.c
+++ b/sysdeps/libm-ieee754/s_ctanl.c
@@ -48,10 +48,14 @@ __ctanl (__complex__ long double x)
}
else
{
- long double den = (__cosl (2.0 * __real__ x)
- + __ieee754_coshl (2.0 * __imag__ x));
+ long double sin2rx, cos2rx;
+ long double den;
- __real__ res = __sinl (2.0 * __real__ x) / den;
+ __sincosl (2.0 * __real__ x, &sin2rx, &cos2rx);
+
+ den = cos2rx + __ieee754_coshl (2.0 * __imag__ x);
+
+ __real__ res = sin2rx / den;
__imag__ res = __ieee754_sinhl (2.0 * __imag__ x) / den;
}