s_erf.c (019ffb5df85597b509adef7654096d4261506a81) s_erf.c (3b5e0d0f96cb7adde49e9296306648d79b3804e9)
1/* @(#)s_erf.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

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

237 S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(sb5+s*(sb6+s*sb7))))));
238 }
239 z = x;
240 SET_LOW_WORD(z,0);
241 r = __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S);
242 if(hx>=0) return one-r/x; else return r/x-one;
243}
244
1/* @(#)s_erf.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

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

237 S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(sb5+s*(sb6+s*sb7))))));
238 }
239 z = x;
240 SET_LOW_WORD(z,0);
241 r = __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S);
242 if(hx>=0) return one-r/x; else return r/x-one;
243}
244
245#if (LDBL_MANT_DIG == 53)
246__weak_reference(erf, erfl);
247#endif
248
245double
246erfc(double x)
247{
248 int32_t hx,ix;
249 double R,S,P,Q,s,y,z,r;
250 GET_HIGH_WORD(hx,x);
251 ix = hx&0x7fffffff;
252 if(ix>=0x7ff00000) { /* erfc(nan)=nan */

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

294 z = x;
295 SET_LOW_WORD(z,0);
296 r = __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S);
297 if(hx>0) return r/x; else return two-r/x;
298 } else {
299 if(hx>0) return tiny*tiny; else return two-tiny;
300 }
301}
249double
250erfc(double x)
251{
252 int32_t hx,ix;
253 double R,S,P,Q,s,y,z,r;
254 GET_HIGH_WORD(hx,x);
255 ix = hx&0x7fffffff;
256 if(ix>=0x7ff00000) { /* erfc(nan)=nan */

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

298 z = x;
299 SET_LOW_WORD(z,0);
300 r = __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S);
301 if(hx>0) return r/x; else return two-r/x;
302 } else {
303 if(hx>0) return tiny*tiny; else return two-tiny;
304 }
305}
306
307#if (LDBL_MANT_DIG == 53)
308__weak_reference(erfc, erfcl);
309#endif