summaryrefslogtreecommitdiff
path: root/math/s_ccosf.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-10-22 00:32:39 -0400
committerUlrich Drepper <drepper@gmail.com>2011-10-22 00:32:39 -0400
commitbc62c2fb152d6ffec63975d88fd8f1bc3d3b7c01 (patch)
treebbb67e94ed1a9ba0becbe752c6853c199c639070 /math/s_ccosf.c
parentc196fed8f01a8599dd43edf1c7a1ea3ba9ed0598 (diff)
Optimization to some complex math functions
Also, change last reference to __sqrt into __sqrt to easily.
Diffstat (limited to 'math/s_ccosf.c')
-rw-r--r--math/s_ccosf.c48
1 files changed, 4 insertions, 44 deletions
diff --git a/math/s_ccosf.c b/math/s_ccosf.c
index f0e9c2ac9e..1ee932486b 100644
--- a/math/s_ccosf.c
+++ b/math/s_ccosf.c
@@ -27,52 +27,12 @@
__complex__ float
__ccosf (__complex__ float x)
{
- __complex__ float res;
+ __complex__ float y;
- if (!isfinite (__real__ x) || __isnanf (__imag__ x))
- {
- if (__real__ x == 0.0 || __imag__ x == 0.0)
- {
- __real__ res = __nanf ("");
- __imag__ res = 0.0;
+ __real__ y = -__imag__ x;
+ __imag__ y = __real__ x;
-#ifdef FE_INVALID
- if (__isinf_nsf (__real__ x))
- feraiseexcept (FE_INVALID);
-#endif
- }
- else if (__isinf_nsf (__imag__ x))
- {
- __real__ res = HUGE_VALF;
- __imag__ res = __nanf ("");
-
-#ifdef FE_INVALID
- if (__isinf_nsf (__real__ x))
- feraiseexcept (FE_INVALID);
-#endif
- }
- else
- {
- __real__ res = __nanf ("");
- __imag__ res = __nanf ("");
-
-#ifdef FE_INVALID
- if (isfinite (__imag__ x))
- feraiseexcept (FE_INVALID);
-#endif
- }
- }
- else
- {
- __complex__ float y;
-
- __real__ y = -__imag__ x;
- __imag__ y = __real__ x;
-
- res = __ccoshf (y);
- }
-
- return res;
+ return __ccoshf (y);
}
#ifndef __ccosf
weak_alias (__ccosf, ccosf)