diff options
Diffstat (limited to 'sysdeps/libm-ieee754/s_ccosh.c')
-rw-r--r-- | sysdeps/libm-ieee754/s_ccosh.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sysdeps/libm-ieee754/s_ccosh.c b/sysdeps/libm-ieee754/s_ccosh.c index b9d7b82f5e..fa958f491b 100644 --- a/sysdeps/libm-ieee754/s_ccosh.c +++ b/sysdeps/libm-ieee754/s_ccosh.c @@ -40,9 +40,12 @@ __ccosh (__complex__ double x) { /* Imaginary part is finite. */ double cosh_val = __ieee754_cosh (__real__ x); + double sinix, cosix; - __real__ retval = cosh_val * __cos (__imag__ x); - __imag__ retval = cosh_val * __sin (__imag__ x); + __sincos (__imag__ x, &sinix, &cosix); + + __real__ retval = cosh_val * cosix; + __imag__ retval = cosh_val * sinix; } else { @@ -62,8 +65,12 @@ __ccosh (__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); } else { |