e_expf.c (d1d015864103b253b3fcb2f72a0da5b0cfeb31b6) | e_expf.c (5763a8cf06a297c067aa7af13973f50ab44c2a4d) |
---|---|
1/* e_expf.c -- float version of e_exp.c. 2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 */ 4 5/* 6 * ==================================================== 7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 * --- 69 unchanged lines hidden (view full) --- 78 else if(hx < 0x39000000) { /* when |x|<2**-14 */ 79 if(huge+x>one) return one+x;/* trigger inexact */ 80 } 81 else k = 0; 82 83 /* x is now in primary range */ 84 t = x*x; 85 if(k >= -125) | 1/* e_expf.c -- float version of e_exp.c. 2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 */ 4 5/* 6 * ==================================================== 7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 * --- 69 unchanged lines hidden (view full) --- 78 else if(hx < 0x39000000) { /* when |x|<2**-14 */ 79 if(huge+x>one) return one+x;/* trigger inexact */ 80 } 81 else k = 0; 82 83 /* x is now in primary range */ 84 t = x*x; 85 if(k >= -125) |
86 SET_FLOAT_WORD(twopk,0x3f800000+(k<<23)); | 86 SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+k))<<23); |
87 else | 87 else |
88 SET_FLOAT_WORD(twopk,0x3f800000+((k+100)<<23)); | 88 SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+(k+100)))<<23); |
89 c = x - t*(P1+t*P2); 90 if(k==0) return one-((x*c)/(c-(float)2.0)-x); 91 else y = one-((lo-(x*c)/((float)2.0-c))-hi); 92 if(k >= -125) { 93 if(k==128) return y*2.0F*0x1p127F; 94 return y*twopk; 95 } else { 96 return y*twopk*twom100; 97 } 98} | 89 c = x - t*(P1+t*P2); 90 if(k==0) return one-((x*c)/(c-(float)2.0)-x); 91 else y = one-((lo-(x*c)/((float)2.0-c))-hi); 92 if(k >= -125) { 93 if(k==128) return y*2.0F*0x1p127F; 94 return y*twopk; 95 } else { 96 return y*twopk*twom100; 97 } 98} |