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

Fix inaccuracy of clog, clog10 near |z| = 1 (bug 13629).

This commit is contained in:
Joseph Myers
2012-09-25 19:43:49 +00:00
parent c8cb2a5224
commit d032e0d29b
19 changed files with 1003 additions and 10 deletions

View File

@ -90,6 +90,19 @@ __clog10f (__complex__ float x)
d2m1 += absy * absy;
__real__ result = __log1pf (d2m1) * ((float) M_LOG10E / 2.0f);
}
else if (absx < 1.0f
&& absx >= 0.75f
&& absy < FLT_EPSILON / 2.0f
&& scale == 0)
{
float d2m1 = (absx - 1.0f) * (absx + 1.0f);
__real__ result = __log1pf (d2m1) * ((float) M_LOG10E / 2.0f);
}
else if (absx < 1.0f && (absx >= 0.75f || absy >= 0.5f) && scale == 0)
{
float d2m1 = __x2y2m1f (absx, absy);
__real__ result = __log1pf (d2m1) * ((float) M_LOG10E / 2.0f);
}
else
{
float d = __ieee754_hypotf (absx, absy);