about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--math/libm-test.inc23
2 files changed, 22 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index cdb5b85830..a808e73b15 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-03-04  Joseph Myers  <joseph@codesourcery.com>
+
+	* math/libm-test.inc (print_complex_max_error): Check separately
+	whether real and imaginary errors are within allowed range and
+	pass 0 to print_complex_function_ulps instead of value within
+	allowed range.
+
 2014-03-04  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
 	* libio/tst-ftell-active-handler.c (get_handles_fdopen): Fix
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 371229238d..4cb239f12a 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -568,19 +568,26 @@ static void
 print_complex_max_error (const char *func_name)
 {
   __complex__ FLOAT allowed = find_complex_function_ulps (func_name);
-  int ok = 0;
+  int real_ok = 0, imag_ok = 0, ok;
 
-  if ((real_max_error == 0 && imag_max_error == 0)
-      || (real_max_error <= __real__ allowed
-	  && imag_max_error <= __imag__ allowed
-	  && !ignore_max_ulp))
+  if (real_max_error == 0
+      || (real_max_error <= __real__ allowed && !ignore_max_ulp))
     {
-      ok = 1;
+      real_ok = 1;
     }
 
-  if (!ok)
-    print_complex_function_ulps (func_name, real_max_error, imag_max_error);
+  if (imag_max_error == 0
+      || (imag_max_error <= __imag__ allowed && !ignore_max_ulp))
+    {
+      imag_ok = 1;
+    }
+
+  ok = real_ok && imag_ok;
 
+  if (!ok)
+    print_complex_function_ulps (func_name,
+				 real_ok ? 0 : real_max_error,
+				 imag_ok ? 0 : imag_max_error);
 
   if (print_screen_max_error (ok))
     {