about summary refs log tree commit diff
path: root/math/s_clog10l.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2012-09-25 19:43:49 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-09-25 19:43:49 +0000
commitd032e0d29b6ed9d3844916ada0ead19c3190ff9a (patch)
treea0ebd8e356dd8608c8e207d6a509a48b716ca537 /math/s_clog10l.c
parentc8cb2a522493dc4a2d7f41694b00274eea2f5782 (diff)
downloadglibc-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_clog10l.c')
-rw-r--r--math/s_clog10l.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/math/s_clog10l.c b/math/s_clog10l.c
index d50f616578..958f74abdb 100644
--- a/math/s_clog10l.c
+++ b/math/s_clog10l.c
@@ -89,6 +89,19 @@ __clog10l (__complex__ long double x)
 	    d2m1 += absy * absy;
 	  __real__ result = __log1pl (d2m1) * (M_LOG10El / 2.0L);
 	}
+      else if (absx < 1.0L
+	       && absx >= 0.75L
+	       && absy < LDBL_EPSILON / 2.0L
+	       && scale == 0)
+	{
+	  long double d2m1 = (absx - 1.0L) * (absx + 1.0L);
+	  __real__ result = __log1pl (d2m1) * (M_LOG10El / 2.0L);
+	}
+      else if (absx < 1.0L && (absx >= 0.75L || absy >= 0.5L) && scale == 0)
+	{
+	  long double d2m1 = __x2y2m1l (absx, absy);
+	  __real__ result = __log1pl (d2m1) * (M_LOG10El / 2.0L);
+	}
       else
 	{
 	  long double d = __ieee754_hypotl (absx, absy);