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

@ -64,7 +64,14 @@ __catanhl (__complex__ long double x)
long double den = 1.0 - __real__ x;
den = i2 + den * den;
__real__ res = 0.25 * (__ieee754_logl (num) - __ieee754_logl (den));
long double f = num / den;
if (f < 0.5)
__real__ res = 0.25 * __ieee754_logl (f);
else
{
num = 4.0 * __real__ x;
__real__ res = 0.25 * __log1pl (num / den);
}
den = 1 - __real__ x * __real__ x - i2;