aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/libm-ieee754/s_ctan.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/libm-ieee754/s_ctan.c')
-rw-r--r--sysdeps/libm-ieee754/s_ctan.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sysdeps/libm-ieee754/s_ctan.c b/sysdeps/libm-ieee754/s_ctan.c
index f448395..069b96c 100644
--- a/sysdeps/libm-ieee754/s_ctan.c
+++ b/sysdeps/libm-ieee754/s_ctan.c
@@ -48,10 +48,14 @@ __ctan (__complex__ double x)
}
else
{
- double den = (__cos (2.0 * __real__ x)
- + __ieee754_cosh (2.0 * __imag__ x));
+ double sin2rx, cos2rx;
+ double den;
- __real__ res = __sin (2.0 * __real__ x) / den;
+ __sincos (2.0 * __real__ x, &sin2rx, &cos2rx);
+
+ den = cos2rx + __ieee754_cosh (2.0 * __imag__ x);
+
+ __real__ res = sin2rx / den;
__imag__ res = __ieee754_sinh (2.0 * __imag__ x) / den;
}