diff options
author | Joseph Myers <joseph@codesourcery.com> | 2012-09-25 19:43:49 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2012-09-25 19:43:49 +0000 |
commit | d032e0d29b6ed9d3844916ada0ead19c3190ff9a (patch) | |
tree | a0ebd8e356dd8608c8e207d6a509a48b716ca537 /math/s_clog10f.c | |
parent | c8cb2a522493dc4a2d7f41694b00274eea2f5782 (diff) | |
download | glibc-d032e0d29b6ed9d3844916ada0ead19c3190ff9a.tar.gz glibc-d032e0d29b6ed9d3844916ada0ead19c3190ff9a.tar.xz glibc-d032e0d29b6ed9d3844916ada0ead19c3190ff9a.zip |
Fix inaccuracy of clog, clog10 near |z| = 1 (bug 13629).
Diffstat (limited to 'math/s_clog10f.c')
-rw-r--r-- | math/s_clog10f.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/math/s_clog10f.c b/math/s_clog10f.c index c61e8af8ce..1789f1aedb 100644 --- a/math/s_clog10f.c +++ b/math/s_clog10f.c @@ -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); |