about summary refs log tree commit diff
path: root/sysdeps/libm-ieee754/s_log1pf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/libm-ieee754/s_log1pf.c')
-rw-r--r--sysdeps/libm-ieee754/s_log1pf.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sysdeps/libm-ieee754/s_log1pf.c b/sysdeps/libm-ieee754/s_log1pf.c
index ee0a83958d..5b1237b0d0 100644
--- a/sysdeps/libm-ieee754/s_log1pf.c
+++ b/sysdeps/libm-ieee754/s_log1pf.c
@@ -8,7 +8,7 @@
  *
  * Developed at SunPro, a Sun Microsystems, Inc. business.
  * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice 
+ * software is freely granted, provided that this notice
  * is preserved.
  * ====================================================
  */
@@ -58,7 +58,7 @@ static float zero = 0.0;
 	k = 1;
 	if (hx < 0x3ed413d7) {			/* x < 0.41422  */
 	    if(ax>=0x3f800000) {		/* x <= -1.0 */
-		if(x==(float)-1.0) return -two25/zero; /* log1p(-1)=+inf */
+		if(x==(float)-1.0) return -two25/(x-x); /* log1p(-1)=+inf */
 		else return (x-x)/(x-x);	/* log1p(x<-1)=NaN */
 	    }
 	    if(ax<0x31000000) {			/* |x| < 2**-29 */
@@ -70,11 +70,11 @@ static float zero = 0.0;
 	    }
 	    if(hx>0||hx<=((int32_t)0xbe95f61f)) {
 		k=0;f=x;hu=1;}	/* -0.2929<x<0.41422 */
-	} 
+	}
 	if (hx >= 0x7f800000) return x+x;
 	if(k!=0) {
 	    if(hx<0x5a000000) {
-		u  = (float)1.0+x; 
+		u  = (float)1.0+x;
 		GET_FLOAT_WORD(hu,u);
 	        k  = (hu>>23)-127;
 		/* correction term */
@@ -90,7 +90,7 @@ static float zero = 0.0;
 	    if(hu<0x3504f7) {
 	        SET_FLOAT_WORD(u,hu|0x3f800000);/* normalize u */
 	    } else {
-	        k += 1; 
+	        k += 1;
 		SET_FLOAT_WORD(u,hu|0x3f000000);	/* normalize u/2 */
 	        hu = (0x00800000-hu)>>2;
 	    }
@@ -98,13 +98,13 @@ static float zero = 0.0;
 	}
 	hfsq=(float)0.5*f*f;
 	if(hu==0) {	/* |f| < 2**-20 */
-	    if(f==zero) if(k==0) return zero;  
+	    if(f==zero) if(k==0) return zero;
 			else {c += k*ln2_lo; return k*ln2_hi+c;}
 	    R = hfsq*((float)1.0-(float)0.66666666666666666*f);
 	    if(k==0) return f-R; else
 	    	     return k*ln2_hi-((R-(k*ln2_lo+c))-f);
 	}
- 	s = f/((float)2.0+f); 
+ 	s = f/((float)2.0+f);
 	z = s*s;
 	R = z*(Lp1+z*(Lp2+z*(Lp3+z*(Lp4+z*(Lp5+z*(Lp6+z*Lp7))))));
 	if(k==0) return f-(hfsq-s*(hfsq+R)); else