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

Fix catan, catanh inaccuracy through use of log (bug 15394).

This commit is contained in:
Joseph Myers
2013-04-24 18:49:13 +00:00
parent 45d69176e8
commit 2f38fbfe09
11 changed files with 130 additions and 10 deletions

View File

@ -61,7 +61,7 @@ __catanl (__complex__ long double x)
}
else
{
long double r2, num, den;
long double r2, num, den, f;
r2 = __real__ x * __real__ x;
@ -75,7 +75,14 @@ __catanl (__complex__ long double x)
den = __imag__ x - 1.0;
den = r2 + den * den;
__imag__ res = 0.25 * __ieee754_logl (num / den);
f = num / den;
if (f < 0.5)
__imag__ res = 0.25 * __ieee754_logl (f);
else
{
num = 4.0 * __imag__ x;
__imag__ res = 0.25 * __log1pl (num / den);
}
}
return res;