1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +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 @@ __catan (__complex__ double x)
}
else
{
double r2, num, den;
double r2, num, den, f;
r2 = __real__ x * __real__ x;
@ -75,7 +75,14 @@ __catan (__complex__ double x)
den = __imag__ x - 1.0;
den = r2 + den * den;
__imag__ res = 0.25 * __ieee754_log (num / den);
f = num / den;
if (f < 0.5)
__imag__ res = 0.25 * __ieee754_log (f);
else
{
num = 4.0 * __imag__ x;
__imag__ res = 0.25 * __log1p (num / den);
}
}
return res;