s_expm1.c (d1d015864103b253b3fcb2f72a0da5b0cfeb31b6) s_expm1.c (5763a8cf06a297c067aa7af13973f50ab44c2a4d)
1/* @(#)s_expm1.c 5.1 93/09/24 */
2/*
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
5 *
6 * Developed at SunPro, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice

--- 174 unchanged lines hidden (view full) ---

183 /* x is now in primary range */
184 hfx = 0.5*x;
185 hxs = x*hfx;
186 r1 = one+hxs*(Q1+hxs*(Q2+hxs*(Q3+hxs*(Q4+hxs*Q5))));
187 t = 3.0-r1*hfx;
188 e = hxs*((r1-t)/(6.0 - x*t));
189 if(k==0) return x - (x*e-hxs); /* c is 0 */
190 else {
1/* @(#)s_expm1.c 5.1 93/09/24 */
2/*
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
5 *
6 * Developed at SunPro, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice

--- 174 unchanged lines hidden (view full) ---

183 /* x is now in primary range */
184 hfx = 0.5*x;
185 hxs = x*hfx;
186 r1 = one+hxs*(Q1+hxs*(Q2+hxs*(Q3+hxs*(Q4+hxs*Q5))));
187 t = 3.0-r1*hfx;
188 e = hxs*((r1-t)/(6.0 - x*t));
189 if(k==0) return x - (x*e-hxs); /* c is 0 */
190 else {
191 INSERT_WORDS(twopk,0x3ff00000+(k<<20),0); /* 2^k */
191 INSERT_WORDS(twopk,((u_int32_t)(0x3ff+k))<<20,0); /* 2^k */
192 e = (x*(e-c)-c);
193 e -= hxs;
194 if(k== -1) return 0.5*(x-e)-0.5;
195 if(k==1) {
196 if(x < -0.25) return -2.0*(e-(x+0.5));
197 else return one+2.0*(x-e);
198 }
199 if (k <= -2 || k>56) { /* suffice to return exp(x)-1 */

--- 23 unchanged lines hidden ---
192 e = (x*(e-c)-c);
193 e -= hxs;
194 if(k== -1) return 0.5*(x-e)-0.5;
195 if(k==1) {
196 if(x < -0.25) return -2.0*(e-(x+0.5));
197 else return one+2.0*(x-e);
198 }
199 if (k <= -2 || k>56) { /* suffice to return exp(x)-1 */

--- 23 unchanged lines hidden ---