e_exp.c (d1d015864103b253b3fcb2f72a0da5b0cfeb31b6) | e_exp.c (5763a8cf06a297c067aa7af13973f50ab44c2a4d) |
---|---|
1 2/* @(#)e_exp.c 1.6 04/04/22 */ 3/* 4 * ==================================================== 5 * Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved. 6 * 7 * Permission to use, copy, modify, and distribute this 8 * software is freely granted, provided that this notice --- 131 unchanged lines hidden (view full) --- 140 else if(hx < 0x3e300000) { /* when |x|<2**-28 */ 141 if(huge+x>one) return one+x;/* trigger inexact */ 142 } 143 else k = 0; 144 145 /* x is now in primary range */ 146 t = x*x; 147 if(k >= -1021) | 1 2/* @(#)e_exp.c 1.6 04/04/22 */ 3/* 4 * ==================================================== 5 * Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved. 6 * 7 * Permission to use, copy, modify, and distribute this 8 * software is freely granted, provided that this notice --- 131 unchanged lines hidden (view full) --- 140 else if(hx < 0x3e300000) { /* when |x|<2**-28 */ 141 if(huge+x>one) return one+x;/* trigger inexact */ 142 } 143 else k = 0; 144 145 /* x is now in primary range */ 146 t = x*x; 147 if(k >= -1021) |
148 INSERT_WORDS(twopk,0x3ff00000+(k<<20), 0); | 148 INSERT_WORDS(twopk,((u_int32_t)(0x3ff+k))<<20, 0); |
149 else | 149 else |
150 INSERT_WORDS(twopk,0x3ff00000+((k+1000)<<20), 0); | 150 INSERT_WORDS(twopk,((u_int32_t)(0x3ff+(k+1000)))<<20, 0); |
151 c = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5)))); 152 if(k==0) return one-((x*c)/(c-2.0)-x); 153 else y = one-((lo-(x*c)/(2.0-c))-hi); 154 if(k >= -1021) { 155 if (k==1024) return y*2.0*0x1p1023; 156 return y*twopk; 157 } else { 158 return y*twopk*twom1000; 159 } 160} 161 162#if (LDBL_MANT_DIG == 53) 163__weak_reference(exp, expl); 164#endif | 151 c = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5)))); 152 if(k==0) return one-((x*c)/(c-2.0)-x); 153 else y = one-((lo-(x*c)/(2.0-c))-hi); 154 if(k >= -1021) { 155 if (k==1024) return y*2.0*0x1p1023; 156 return y*twopk; 157 } else { 158 return y*twopk*twom1000; 159 } 160} 161 162#if (LDBL_MANT_DIG == 53) 163__weak_reference(exp, expl); 164#endif |