about summary refs log tree commit diff
path: root/sysdeps/libm-ieee754/s_ctanf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/libm-ieee754/s_ctanf.c')
-rw-r--r--sysdeps/libm-ieee754/s_ctanf.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sysdeps/libm-ieee754/s_ctanf.c b/sysdeps/libm-ieee754/s_ctanf.c
index 99011fa41d..1c6fdca81d 100644
--- a/sysdeps/libm-ieee754/s_ctanf.c
+++ b/sysdeps/libm-ieee754/s_ctanf.c
@@ -48,10 +48,14 @@ __ctanf (__complex__ float x)
     }
   else
     {
-      float den = (__cosf (2.0 * __real__ x)
-		   + __ieee754_coshf (2.0 * __imag__ x));
+      float sin2rx, cos2rx;
+      float den;
 
-      __real__ res = __sinf (2.0 * __real__ x) / den;
+      __sincosf (2.0 * __real__ x, &sin2rx, &cos2rx);
+
+      den = cos2rx + __ieee754_coshf (2.0 * __imag__ x);
+
+      __real__ res = sin2rx / den;
       __imag__ res = __ieee754_sinhf (2.0 * __imag__ x) / den;
     }