about summary refs log tree commit diff
path: root/sysdeps/libm-ieee754/s_csinh.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/libm-ieee754/s_csinh.c')
-rw-r--r--sysdeps/libm-ieee754/s_csinh.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/sysdeps/libm-ieee754/s_csinh.c b/sysdeps/libm-ieee754/s_csinh.c
index 05cec85e7c..98f06a558f 100644
--- a/sysdeps/libm-ieee754/s_csinh.c
+++ b/sysdeps/libm-ieee754/s_csinh.c
@@ -40,10 +40,13 @@ __csinh (__complex__ double x)
       if (icls >= FP_ZERO)
 	{
 	  /* Imaginary part is finite.  */
-	   double sinh_val = __ieee754_sinh (__real__ x);
+	  double sinh_val = __ieee754_sinh (__real__ x);
+	  double sinix, cosix;
 
-	  __real__ retval = sinh_val * __cos (__imag__ x);
-	  __imag__ retval = sinh_val * __sin (__imag__ x);
+	  __sincos (__imag__ x, &sinix, &cosix);
+
+	  __real__ retval = sinh_val * cosix;
+	  __imag__ retval = sinh_val * sinix;
 
 	  if (negate)
 	    __real__ retval = -__real__ retval;
@@ -75,8 +78,12 @@ __csinh (__complex__ double x)
       else if (icls > FP_ZERO)
 	{
 	  /* Imaginary part is finite.  */
-	  __real__ retval = __copysign (HUGE_VAL, __cos (__imag__ x));
-	  __imag__ retval = __copysign (HUGE_VAL, __sin (__imag__ x));
+	  double sinix, cosix;
+
+	  __sincos (__imag__ x, &sinix, &cosix);
+
+	  __real__ retval = __copysign (HUGE_VAL, cosix);
+	  __imag__ retval = __copysign (HUGE_VAL, sinix);
 
 	  if (negate)
 	    __real__ retval = -__real__ retval;