From d0419dbfbd19cb01398d43895a679c0bcb961070 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 31 Jul 2012 14:21:19 +0000 Subject: Improve clog, clog10 handling of values with real or imaginary part slightly above 1 (bug 13629). --- math/s_clog.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'math/s_clog.c') diff --git a/math/s_clog.c b/math/s_clog.c index e28aa5157d..2593066001 100644 --- a/math/s_clog.c +++ b/math/s_clog.c @@ -78,6 +78,13 @@ __clog (__complex__ double x) else __real__ result = __log1p (absy2) / 2.0; } + else if (absx > 1.0 && absx < 2.0 && absy < 1.0 && scale == 0) + { + double d2m1 = (absx - 1.0) * (absx + 1.0); + if (absy >= DBL_EPSILON) + d2m1 += absy * absy; + __real__ result = __log1p (d2m1) / 2.0; + } else { double d = __ieee754_hypot (absx, absy); -- cgit v1.2.3