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

Fix cacos real-part inaccuracy for result real part near 0 (bug 15023).

This commit is contained in:
Joseph Myers
2013-01-17 20:25:51 +00:00
parent 2a26ef3a01
commit 728d7b43fc
16 changed files with 424 additions and 124 deletions

View File

@ -25,11 +25,27 @@ __cacosl (__complex__ long double x)
{
__complex__ long double y;
__complex__ long double res;
int rcls = fpclassify (__real__ x);
int icls = fpclassify (__imag__ x);
y = __casinl (x);
if (rcls <= FP_INFINITE || icls <= FP_INFINITE
|| (rcls == FP_ZERO && icls == FP_ZERO))
{
y = __casinl (x);
__real__ res = M_PI_2l - __real__ y;
__imag__ res = -__imag__ y;
__real__ res = M_PI_2l - __real__ y;
__imag__ res = -__imag__ y;
}
else
{
__real__ y = -__imag__ x;
__imag__ y = __real__ x;
y = __kernel_casinhl (y, 1);
__real__ res = __imag__ y;
__imag__ res = __real__ y;
}
return res;
}