about summary refs log tree commit diff
path: root/math/s_catan.c
diff options
context:
space:
mode:
Diffstat (limited to 'math/s_catan.c')
-rw-r--r--math/s_catan.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/math/s_catan.c b/math/s_catan.c
index 783941a72e..6a1016e74c 100644
--- a/math/s_catan.c
+++ b/math/s_catan.c
@@ -20,7 +20,7 @@
 #include <complex.h>
 #include <math.h>
 #include <math_private.h>
-
+#include <float.h>
 
 __complex__ double
 __catan (__complex__ double x)
@@ -83,6 +83,17 @@ __catan (__complex__ double x)
 	  num = 4.0 * __imag__ x;
 	  __imag__ res = 0.25 * __log1p (num / den);
 	}
+
+      if (fabs (__real__ res) < DBL_MIN)
+	{
+	  volatile double force_underflow = __real__ res * __real__ res;
+	  (void) force_underflow;
+	}
+      if (fabs (__imag__ res) < DBL_MIN)
+	{
+	  volatile double force_underflow = __imag__ res * __imag__ res;
+	  (void) force_underflow;
+	}
     }
 
   return res;