about summary refs log tree commit diff
path: root/src/math/expm1f.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/expm1f.c')
-rw-r--r--src/math/expm1f.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/math/expm1f.c b/src/math/expm1f.c
index cfab6975..a8b79e88 100644
--- a/src/math/expm1f.c
+++ b/src/math/expm1f.c
@@ -53,7 +53,7 @@ float expm1f(float x)
 		}
 		if (xsb != 0) {  /* x < -27*ln2 */
 			/* raise inexact */
-			if (x+tiny < (float)0.0)
+			if (x+tiny < 0.0f)
 				return tiny-one;  /* return -1 */
 		}
 	}
@@ -71,7 +71,7 @@ float expm1f(float x)
 				k = -1;
 			}
 		} else {
-			k  = invln2*x+((xsb==0)?(float)0.5:(float)-0.5);
+			k  = invln2*x + (xsb==0 ? 0.5f : -0.5f);
 			t  = k;
 			hi = x - t*ln2_hi;      /* t*ln2_hi is exact here */
 			lo = t*ln2_lo;
@@ -85,27 +85,27 @@ float expm1f(float x)
 		k = 0;
 
 	/* x is now in primary range */
-	hfx = (float)0.5*x;
+	hfx = 0.5f*x;
 	hxs = x*hfx;
 	r1 = one+hxs*(Q1+hxs*Q2);
-	t  = (float)3.0 - r1*hfx;
-	e  = hxs*((r1-t)/((float)6.0 - x*t));
+	t  = 3.0f - r1*hfx;
+	e  = hxs*((r1-t)/(6.0f - x*t));
 	if (k == 0)  /* c is 0 */
 		return x - (x*e-hxs);
 	SET_FLOAT_WORD(twopk, 0x3f800000+(k<<23));   /* 2^k */
 	e  = x*(e-c) - c;
 	e -= hxs;
 	if (k == -1)
-		return (float)0.5*(x-e) - (float)0.5;
+		return 0.5f*(x-e) - 0.5f;
 	if (k == 1) {
-		if (x < (float)-0.25)
-			return -(float)2.0*(e-(x+(float)0.5));
-		return one+(float)2.0*(x-e);
+		if (x < -0.25f)
+			return -2.0f*(e-(x+0.5f));
+		return one + 2.0f*(x-e);
 	}
 	if (k <= -2 || k > 56) {   /* suffice to return exp(x)-1 */
 		y = one - (e - x);
 		if (k == 128)
-			y = y*2.0F*0x1p127F;
+			y = y*2.0f*0x1p127f;
 		else
 			y = y*twopk;
 		return y - one;
@@ -116,7 +116,7 @@ float expm1f(float x)
 		y = t - (e - x);
 		y = y*twopk;
 	} else {
-		SET_FLOAT_WORD(t, ((0x7f-k)<<23));  /* 2^-k */
+		SET_FLOAT_WORD(t, (0x7f-k)<<23);  /* 2^-k */
 		y = x - (e + t);
 		y += one;
 		y = y*twopk;