about summary refs log tree commit diff
path: root/math/s_clog.c
diff options
context:
space:
mode:
Diffstat (limited to 'math/s_clog.c')
-rw-r--r--math/s_clog.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/math/s_clog.c b/math/s_clog.c
index 2593066001..79b1f375d7 100644
--- a/math/s_clog.c
+++ b/math/s_clog.c
@@ -85,6 +85,19 @@ __clog (__complex__ double x)
 	    d2m1 += absy * absy;
 	  __real__ result = __log1p (d2m1) / 2.0;
 	}
+      else if (absx < 1.0
+	       && absx >= 0.75
+	       && absy < DBL_EPSILON / 2.0
+	       && scale == 0)
+	{
+	  double d2m1 = (absx - 1.0) * (absx + 1.0);
+	  __real__ result = __log1p (d2m1) / 2.0;
+	}
+      else if (absx < 1.0 && (absx >= 0.75 || absy >= 0.5) && scale == 0)
+	{
+	  double d2m1 = __x2y2m1 (absx, absy);
+	  __real__ result = __log1p (d2m1) / 2.0;
+	}
       else
 	{
 	  double d = __ieee754_hypot (absx, absy);