summaryrefslogtreecommitdiff
path: root/math/s_ccosl.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_ccosl.c
parentc196fed8f01a8599dd43edf1c7a1ea3ba9ed0598 (diff)
downloadglibc-bc62c2fb152d6ffec63975d88fd8f1bc3d3b7c01.tar.gz
Optimization to some complex math functions
Also, change last reference to __sqrt into __sqrt to easily.
Diffstat (limited to 'math/s_ccosl.c')
-rw-r--r--math/s_ccosl.c48
1 files changed, 4 insertions, 44 deletions
diff --git a/math/s_ccosl.c b/math/s_ccosl.c
index 9902a02edd..153a60b08b 100644
--- a/math/s_ccosl.c
+++ b/math/s_ccosl.c
@@ -27,51 +27,11 @@
__complex__ long double
__ccosl (__complex__ long double x)
{
- __complex__ long double res;
+ __complex__ long double y;
- if (!isfinite (__real__ x) || __isnanl (__imag__ x))
- {
- if (__real__ x == 0.0 || __imag__ x == 0.0)
- {
- __real__ res = __nanl ("");
- __imag__ res = 0.0;
+ __real__ y = -__imag__ x;
+ __imag__ y = __real__ x;
-#ifdef FE_INVALID
- if (__isinf_nsl (__real__ x))
- feraiseexcept (FE_INVALID);
-#endif
- }
- else if (__isinf_nsl (__imag__ x))
- {
- __real__ res = HUGE_VALL;
- __imag__ res = __nanl ("");
-
-#ifdef FE_INVALID
- if (__isinf_nsl (__real__ x))
- feraiseexcept (FE_INVALID);
-#endif
- }
- else
- {
- __real__ res = __nanl ("");
- __imag__ res = __nanl ("");
-
-#ifdef FE_INVALID
- if (isfinite (__imag__ x))
- feraiseexcept (FE_INVALID);
-#endif
- }
- }
- else
- {
- __complex__ long double y;
-
- __real__ y = -__imag__ x;
- __imag__ y = __real__ x;
-
- res = __ccoshl (y);
- }
-
- return res;
+ return __ccoshl (y);
}
weak_alias (__ccosl, ccosl)