about summary refs log tree commit diff
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/w_pow.c24
-rw-r--r--math/w_powf.c24
-rw-r--r--math/w_powl.c24
3 files changed, 15 insertions, 57 deletions
diff --git a/math/w_pow.c b/math/w_pow.c
index 12c0591d34..ed79dbda05 100644
--- a/math/w_pow.c
+++ b/math/w_pow.c
@@ -29,13 +29,7 @@ __pow (double x, double y)
     {
       if (_LIB_VERSION != _IEEE_)
 	{
-	  if (isnan (x))
-	    {
-	      if (y == 0.0)
-		/* pow(NaN,0.0) */
-		return __kernel_standard (x, y, 42);
-	    }
-	  else if (isfinite (x) && isfinite (y))
+	  if (isfinite (x) && isfinite (y))
 	    {
 	      if (isnan (z))
 		/* pow neg**non-int */
@@ -55,19 +49,11 @@ __pow (double x, double y)
 	    }
 	}
     }
-  else if (__builtin_expect (z == 0.0, 0) && isfinite (x) && isfinite (y)
+  else if (__builtin_expect (z == 0.0, 0)
+	   && isfinite (x) && x != 0 && isfinite (y)
 	   && _LIB_VERSION != _IEEE_)
-    {
-      if (x == 0.0)
-	{
-	  if (y == 0.0)
-	    /* pow(0.0,0.0) */
-	    return __kernel_standard (x, y, 20);
-	}
-      else
-	/* pow underflow */
-	return __kernel_standard (x, y, 22);
-    }
+    /* pow underflow */
+    return __kernel_standard (x, y, 22);
 
   return z;
 }
diff --git a/math/w_powf.c b/math/w_powf.c
index 2e786e2f4e..ec157a3a13 100644
--- a/math/w_powf.c
+++ b/math/w_powf.c
@@ -29,13 +29,7 @@ __powf (float x, float y)
     {
       if (_LIB_VERSION != _IEEE_)
 	{
-	  if (isnan (x))
-	    {
-	      if (y == 0.0f)
-		/* pow(NaN,0.0) */
-		return __kernel_standard_f (x, y, 142);
-	    }
-	  else if (isfinite (x) && isfinite (y))
+	  if (isfinite (x) && isfinite (y))
 	    {
 	      if (isnan (z))
 		/* pow neg**non-int */
@@ -55,19 +49,11 @@ __powf (float x, float y)
 	    }
 	}
     }
-  else if (__builtin_expect (z == 0.0f, 0) && isfinite (x) && isfinite (y)
+  else if (__builtin_expect (z == 0.0f, 0)
+	   && isfinite (x) && x != 0 && isfinite (y)
 	   && _LIB_VERSION != _IEEE_)
-    {
-      if (x == 0.0f)
-	{
-	  if (y == 0.0f)
-	    /* pow(0.0,0.0) */
-	    return __kernel_standard_f (x, y, 120);
-	}
-      else
-	/* pow underflow */
-	return __kernel_standard_f (x, y, 122);
-    }
+    /* pow underflow */
+    return __kernel_standard_f (x, y, 122);
 
   return z;
 }
diff --git a/math/w_powl.c b/math/w_powl.c
index be02e1eacc..9b86651f55 100644
--- a/math/w_powl.c
+++ b/math/w_powl.c
@@ -29,13 +29,7 @@ __powl (long double x, long double y)
     {
       if (_LIB_VERSION != _IEEE_)
 	{
-	  if (isnan (x))
-	    {
-	      if (y == 0.0L)
-		/* pow(NaN,0.0) */
-		return __kernel_standard_l (x, y, 242);
-	    }
-	  else if (isfinite (x) && isfinite (y))
+	  if (isfinite (x) && isfinite (y))
 	    {
 	      if (isnan (z))
 		/* pow neg**non-int */
@@ -55,19 +49,11 @@ __powl (long double x, long double y)
 	    }
 	}
     }
-  else if (__builtin_expect (z == 0.0L, 0) && isfinite (x) && isfinite (y)
+  else if (__builtin_expect (z == 0.0L, 0)
+	   && isfinite (x) && x != 0 && isfinite (y)
 	   && _LIB_VERSION != _IEEE_)
-    {
-      if (x == 0.0L)
-	{
-	  if (y == 0.0L)
-	    /* pow(0.0,0.0) */
-	    return __kernel_standard_l (x, y, 220);
-	}
-      else
-	/* pow underflow */
-	return __kernel_standard_l (x, y, 222);
-    }
+    /* pow underflow */
+    return __kernel_standard_l (x, y, 222);
 
   return z;
 }