about summary refs log tree commit diff
path: root/math/s_clog10f.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2012-07-31 14:21:19 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-07-31 14:21:19 +0000
commitd0419dbfbd19cb01398d43895a679c0bcb961070 (patch)
treed600a45e750c40eed4d2050bd2b3bba3c9e64309 /math/s_clog10f.c
parent2bc1387273d2123398fc12133643ea2bc02a2cd1 (diff)
downloadglibc-d0419dbfbd19cb01398d43895a679c0bcb961070.tar.gz
glibc-d0419dbfbd19cb01398d43895a679c0bcb961070.tar.xz
glibc-d0419dbfbd19cb01398d43895a679c0bcb961070.zip
Improve clog, clog10 handling of values with real or imaginary part slightly above 1 (bug 13629).
Diffstat (limited to 'math/s_clog10f.c')
-rw-r--r--math/s_clog10f.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/math/s_clog10f.c b/math/s_clog10f.c
index eb1b895aec..c61e8af8ce 100644
--- a/math/s_clog10f.c
+++ b/math/s_clog10f.c
@@ -83,6 +83,13 @@ __clog10f (__complex__ float x)
 	  else
 	    __real__ result = __log1pf (absy2) * ((float) M_LOG10E / 2.0f);
 	}
+      else if (absx > 1.0f && absx < 2.0f && absy < 1.0f && scale == 0)
+	{
+	  float d2m1 = (absx - 1.0f) * (absx + 1.0f);
+	  if (absy >= FLT_EPSILON)
+	    d2m1 += absy * absy;
+	  __real__ result = __log1pf (d2m1) * ((float) M_LOG10E / 2.0f);
+	}
       else
 	{
 	  float d = __ieee754_hypotf (absx, absy);