1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

Optimization to some complex math functions

Also, change last reference to __sqrt into __sqrt to easily.
This commit is contained in:
Ulrich Drepper
2011-10-22 00:32:39 -04:00
parent c196fed8f0
commit bc62c2fb15
23 changed files with 132 additions and 258 deletions

View File

@ -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)