diff options
Diffstat (limited to 'lib/msun/src')
161 files changed, 1036 insertions, 1036 deletions
diff --git a/lib/msun/src/e_acos.c b/lib/msun/src/e_acos.c index 0958a325a1f1..5f09e63d1e62 100644 --- a/lib/msun/src/e_acos.c +++ b/lib/msun/src/e_acos.c @@ -5,24 +5,24 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_acos.c,v 1.6 1994/08/18 23:04:51 jtc Exp $"; +static char rcsid[] = "$Id: e_acos.c,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $"; #endif /* __ieee754_acos(x) - * Method : + * Method : * acos(x) = pi/2 - asin(x) * acos(-x) = pi/2 + asin(x) * For |x|<=0.5 * acos(x) = pi/2 - (x + x*x^2*R(x^2)) (see asin.c) * For x>0.5 * acos(x) = pi/2 - (pi/2 - 2asin(sqrt((1-x)/2))) - * = 2asin(sqrt((1-x)/2)) + * = 2asin(sqrt((1-x)/2)) * = 2s + 2s*z*R(z) ...z=(1-x)/2, s=sqrt(z) * = 2f + (2c + 2s*z*R(z)) * where f=hi part of s, and c = (z-f*f)/(s+f) is the correction term @@ -42,9 +42,9 @@ static char rcsid[] = "$Id: e_acos.c,v 1.6 1994/08/18 23:04:51 jtc Exp $"; #include "math_private.h" #ifdef __STDC__ -static const double +static const double #else -static double +static double #endif one= 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ pi = 3.14159265358979311600e+00, /* 0x400921FB, 0x54442D18 */ diff --git a/lib/msun/src/e_acosf.c b/lib/msun/src/e_acosf.c index b3703fe37da6..e220a72e20a1 100644 --- a/lib/msun/src/e_acosf.c +++ b/lib/msun/src/e_acosf.c @@ -8,22 +8,22 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_acosf.c,v 1.2 1994/08/18 23:04:53 jtc Exp $"; +static char rcsid[] = "$Id: e_acosf.c,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $"; #endif #include "math.h" #include "math_private.h" #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif one = 1.0000000000e+00, /* 0x3F800000 */ pi = 3.1415925026e+00, /* 0x40490fda */ diff --git a/lib/msun/src/e_acosh.c b/lib/msun/src/e_acosh.c index f54ba32879e3..efaefea51a0a 100644 --- a/lib/msun/src/e_acosh.c +++ b/lib/msun/src/e_acosh.c @@ -5,18 +5,18 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_acosh.c,v 1.6 1994/08/18 23:04:54 jtc Exp $"; +static char rcsid[] = "$Id: e_acosh.c,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $"; #endif /* __ieee754_acosh(x) * Method : - * Based on + * Based on * acosh(x) = log [ x + sqrt(x*x-1) ] * we have * acosh(x) := log(x)+ln2, if x is large; else @@ -32,9 +32,9 @@ static char rcsid[] = "$Id: e_acosh.c,v 1.6 1994/08/18 23:04:54 jtc Exp $"; #include "math_private.h" #ifdef __STDC__ -static const double +static const double #else -static double +static double #endif one = 1.0, ln2 = 6.93147180559945286227e-01; /* 0x3FE62E42, 0xFEFA39EF */ @@ -45,7 +45,7 @@ ln2 = 6.93147180559945286227e-01; /* 0x3FE62E42, 0xFEFA39EF */ double __ieee754_acosh(x) double x; #endif -{ +{ double t; int32_t hx; u_int32_t lx; @@ -55,7 +55,7 @@ ln2 = 6.93147180559945286227e-01; /* 0x3FE62E42, 0xFEFA39EF */ } else if(hx >=0x41b00000) { /* x > 2**28 */ if(hx >=0x7ff00000) { /* x is inf of NaN */ return x+x; - } else + } else return __ieee754_log(x)+ln2; /* acosh(huge)=log(2x) */ } else if(((hx-0x3ff00000)|lx)==0) { return 0.0; /* acosh(1) = 0 */ diff --git a/lib/msun/src/e_acoshf.c b/lib/msun/src/e_acoshf.c index 23ead6f468df..53080e9485df 100644 --- a/lib/msun/src/e_acoshf.c +++ b/lib/msun/src/e_acoshf.c @@ -8,22 +8,22 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_acoshf.c,v 1.2 1994/08/18 23:04:57 jtc Exp $"; +static char rcsid[] = "$Id: e_acoshf.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $"; #endif #include "math.h" #include "math_private.h" #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif one = 1.0, ln2 = 6.9314718246e-01; /* 0x3f317218 */ @@ -34,7 +34,7 @@ ln2 = 6.9314718246e-01; /* 0x3f317218 */ float __ieee754_acoshf(x) float x; #endif -{ +{ float t; int32_t hx; GET_FLOAT_WORD(hx,x); @@ -43,7 +43,7 @@ ln2 = 6.9314718246e-01; /* 0x3f317218 */ } else if(hx >=0x4d800000) { /* x > 2**28 */ if(hx >=0x7f800000) { /* x is inf of NaN */ return x+x; - } else + } else return __ieee754_logf(x)+ln2; /* acosh(huge)=log(2x) */ } else if (hx==0x3f800000) { return 0.0; /* acosh(1) = 0 */ diff --git a/lib/msun/src/e_asin.c b/lib/msun/src/e_asin.c index 7f6a915108f0..390ea5f4c3de 100644 --- a/lib/msun/src/e_asin.c +++ b/lib/msun/src/e_asin.c @@ -5,22 +5,22 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_asin.c,v 1.6 1994/08/18 23:05:01 jtc Exp $"; +static char rcsid[] = "$Id: e_asin.c,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $"; #endif /* __ieee754_asin(x) - * Method : + * Method : * Since asin(x) = x + x^3/6 + x^5*3/40 + x^7*15/336 + ... * we approximate asin(x) on [0,0.5] by * asin(x) = x + x*x^2*R(x^2) * where - * R(x^2) is a rational approximation of (asin(x)-x)/x^3 + * R(x^2) is a rational approximation of (asin(x)-x)/x^3 * and its remez error is bounded by * |(asin(x)-x)/x^3 - R(x^2)| < 2^(-58.75) * @@ -49,9 +49,9 @@ static char rcsid[] = "$Id: e_asin.c,v 1.6 1994/08/18 23:05:01 jtc Exp $"; #include "math_private.h" #ifdef __STDC__ -static const double +static const double #else -static double +static double #endif one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ huge = 1.000e+300, @@ -86,12 +86,12 @@ qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */ GET_LOW_WORD(lx,x); if(((ix-0x3ff00000)|lx)==0) /* asin(1)=+-pi/2 with inexact */ - return x*pio2_hi+x*pio2_lo; - return (x-x)/(x-x); /* asin(|x|>1) is NaN */ + return x*pio2_hi+x*pio2_lo; + return (x-x)/(x-x); /* asin(|x|>1) is NaN */ } else if (ix<0x3fe00000) { /* |x|<0.5 */ if(ix<0x3e400000) { /* if |x| < 2**-27 */ if(huge+x>one) return x;/* return x with inexact if x!=0*/ - } else + } else t = x*x; p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5))))); q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4))); @@ -115,6 +115,6 @@ qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */ p = 2.0*s*r-(pio2_lo-2.0*c); q = pio4_hi-2.0*w; t = pio4_hi-(p-q); - } - if(hx>0) return t; else return -t; + } + if(hx>0) return t; else return -t; } diff --git a/lib/msun/src/e_asinf.c b/lib/msun/src/e_asinf.c index 7945874dcbb5..1f075796392a 100644 --- a/lib/msun/src/e_asinf.c +++ b/lib/msun/src/e_asinf.c @@ -8,22 +8,22 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_asinf.c,v 1.2 1994/08/18 23:05:05 jtc Exp $"; +static char rcsid[] = "$Id: e_asinf.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $"; #endif #include "math.h" #include "math_private.h" #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif one = 1.0000000000e+00, /* 0x3F800000 */ huge = 1.000e+30, @@ -55,13 +55,13 @@ qS4 = 7.7038154006e-02; /* 0x3d9dc62e */ ix = hx&0x7fffffff; if(ix==0x3f800000) { /* asin(1)=+-pi/2 with inexact */ - return x*pio2_hi+x*pio2_lo; + return x*pio2_hi+x*pio2_lo; } else if(ix> 0x3f800000) { /* |x|>= 1 */ - return (x-x)/(x-x); /* asin(|x|>1) is NaN */ + return (x-x)/(x-x); /* asin(|x|>1) is NaN */ } else if (ix<0x3f000000) { /* |x|<0.5 */ if(ix<0x32000000) { /* if |x| < 2**-27 */ if(huge+x>one) return x;/* return x with inexact if x!=0*/ - } else + } else t = x*x; p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5))))); q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4))); @@ -87,6 +87,6 @@ qS4 = 7.7038154006e-02; /* 0x3d9dc62e */ p = (float)2.0*s*r-(pio2_lo-(float)2.0*c); q = pio4_hi-(float)2.0*w; t = pio4_hi-(p-q); - } - if(hx>0) return t; else return -t; + } + if(hx>0) return t; else return -t; } diff --git a/lib/msun/src/e_atan2.c b/lib/msun/src/e_atan2.c index 8221de669836..233d8b67e2da 100644 --- a/lib/msun/src/e_atan2.c +++ b/lib/msun/src/e_atan2.c @@ -5,19 +5,19 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_atan2.c,v 1.6 1994/08/18 23:05:08 jtc Exp $"; +static char rcsid[] = "$Id: e_atan2.c,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $"; #endif /* __ieee754_atan2(y,x) * Method : * 1. Reduce y to positive by atan2(y,x)=-atan2(-y,x). - * 2. Reduce x to positive by (if x and y are unexceptional): + * 2. Reduce x to positive by (if x and y are unexceptional): * ARG (x+iy) = arctan(y/x) ... if x > 0, * ARG (x+iy) = pi - arctan[y/(-x)] ... if x < 0, * @@ -35,9 +35,9 @@ static char rcsid[] = "$Id: e_atan2.c,v 1.6 1994/08/18 23:05:08 jtc Exp $"; * ATAN2(+-INF, (anything but,0,NaN, and INF)) is +-pi/2; * * Constants: - * The hexadecimal values are the intended ones for the following - * constants. The decimal values may be used, provided that the - * compiler will convert from decimal to binary accurately enough + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough * to produce the hexadecimal values shown. */ @@ -45,9 +45,9 @@ static char rcsid[] = "$Id: e_atan2.c,v 1.6 1994/08/18 23:05:08 jtc Exp $"; #include "math_private.h" #ifdef __STDC__ -static const double +static const double #else -static double +static double #endif tiny = 1.0e-300, zero = 0.0, @@ -62,7 +62,7 @@ pi_lo = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */ double __ieee754_atan2(y,x) double y,x; #endif -{ +{ double z; int32_t k,m,hx,hy,ix,iy; u_int32_t lx,ly; @@ -80,7 +80,7 @@ pi_lo = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */ /* when y = 0 */ if((iy|ly)==0) { switch(m) { - case 0: + case 0: case 1: return y; /* atan(+-0,+anything)=+-0 */ case 2: return pi+tiny;/* atan(+0,-anything) = pi */ case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */ @@ -88,7 +88,7 @@ pi_lo = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */ } /* when x = 0 */ if((ix|lx)==0) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; - + /* when x is INF */ if(ix==0x7ff00000) { if(iy==0x7ff00000) { diff --git a/lib/msun/src/e_atan2f.c b/lib/msun/src/e_atan2f.c index 8493ca43537d..39aa779eeef9 100644 --- a/lib/msun/src/e_atan2f.c +++ b/lib/msun/src/e_atan2f.c @@ -8,22 +8,22 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_atan2f.c,v 1.2 1994/08/18 23:05:11 jtc Exp $"; +static char rcsid[] = "$Id: e_atan2f.c,v 1.1.1.1 1994/08/19 09:39:54 jkh Exp $"; #endif #include "math.h" #include "math_private.h" #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif tiny = 1.0e-30, zero = 0.0, @@ -38,7 +38,7 @@ pi_lo = 1.5099578832e-07; /* 0x34222168 */ float __ieee754_atan2f(y,x) float y,x; #endif -{ +{ float z; int32_t k,m,hx,hy,ix,iy; @@ -55,7 +55,7 @@ pi_lo = 1.5099578832e-07; /* 0x34222168 */ /* when y = 0 */ if(iy==0) { switch(m) { - case 0: + case 0: case 1: return y; /* atan(+-0,+anything)=+-0 */ case 2: return pi+tiny;/* atan(+0,-anything) = pi */ case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */ @@ -63,7 +63,7 @@ pi_lo = 1.5099578832e-07; /* 0x34222168 */ } /* when x = 0 */ if(ix==0) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; - + /* when x is INF */ if(ix==0x7f800000) { if(iy==0x7f800000) { diff --git a/lib/msun/src/e_atanh.c b/lib/msun/src/e_atanh.c index 7d8502315523..aeb8a75444fa 100644 --- a/lib/msun/src/e_atanh.c +++ b/lib/msun/src/e_atanh.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_atanh.c,v 1.6 1994/08/18 23:05:12 jtc Exp $"; +static char rcsid[] = "$Id: e_atanh.c,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $"; #endif /* __ieee754_atanh(x) @@ -21,7 +21,7 @@ static char rcsid[] = "$Id: e_atanh.c,v 1.6 1994/08/18 23:05:12 jtc Exp $"; * 1 2x x * atanh(x) = --- * log(1 + -------) = 0.5 * log1p(2 * --------) * 2 1 - x 1 - x - * + * * For x<0.5 * atanh(x) = 0.5*log1p(2x+2x*x/(1-x)) * @@ -61,14 +61,14 @@ static double zero = 0.0; ix = hx&0x7fffffff; if ((ix|((lx|(-lx))>>31))>0x3ff00000) /* |x|>1 */ return (x-x)/(x-x); - if(ix==0x3ff00000) + if(ix==0x3ff00000) return x/zero; if(ix<0x3e300000&&(huge+x)>zero) return x; /* x<2**-28 */ SET_HIGH_WORD(x,ix); if(ix<0x3fe00000) { /* x < 0.5 */ t = x+x; t = 0.5*log1p(t+t*x/(one-x)); - } else + } else t = 0.5*log1p((x+x)/(one-x)); if(hx>=0) return t; else return -t; } diff --git a/lib/msun/src/e_atanhf.c b/lib/msun/src/e_atanhf.c index 3a941cc751a1..1c2cc6450fca 100644 --- a/lib/msun/src/e_atanhf.c +++ b/lib/msun/src/e_atanhf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_atanhf.c,v 1.2 1994/08/18 23:05:14 jtc Exp $"; +static char rcsid[] = "$Id: e_atanhf.c,v 1.1.1.1 1994/08/19 09:39:54 jkh Exp $"; #endif #include "math.h" @@ -45,14 +45,14 @@ static float zero = 0.0; ix = hx&0x7fffffff; if (ix>0x3f800000) /* |x|>1 */ return (x-x)/(x-x); - if(ix==0x3f800000) + if(ix==0x3f800000) return x/zero; if(ix<0x31800000&&(huge+x)>zero) return x; /* x<2**-28 */ SET_FLOAT_WORD(x,ix); if(ix<0x3f000000) { /* x < 0.5 */ t = x+x; t = (float)0.5*log1pf(t+t*x/(one-x)); - } else + } else t = (float)0.5*log1pf((x+x)/(one-x)); if(hx>=0) return t; else return -t; } diff --git a/lib/msun/src/e_cosh.c b/lib/msun/src/e_cosh.c index b54fc3f48b13..2153e6979900 100644 --- a/lib/msun/src/e_cosh.c +++ b/lib/msun/src/e_cosh.c @@ -5,28 +5,28 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_cosh.c,v 1.5 1994/08/18 23:05:15 jtc Exp $"; +static char rcsid[] = "$Id: e_cosh.c,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $"; #endif /* __ieee754_cosh(x) - * Method : + * Method : * mathematically cosh(x) if defined to be (exp(x)+exp(-x))/2 - * 1. Replace x by |x| (cosh(x) = cosh(-x)). - * 2. - * [ exp(x) - 1 ]^2 + * 1. Replace x by |x| (cosh(x) = cosh(-x)). + * 2. + * [ exp(x) - 1 ]^2 * 0 <= x <= ln2/2 : cosh(x) := 1 + ------------------- * 2*exp(x) * * exp(x) + 1/exp(x) * ln2/2 <= x <= 22 : cosh(x) := ------------------- * 2 - * 22 <= x <= lnovft : cosh(x) := exp(x)/2 + * 22 <= x <= lnovft : cosh(x) := exp(x)/2 * lnovft <= x <= ln2ovft: cosh(x) := exp(x/2)/2 * exp(x/2) * ln2ovft < x : cosh(x) := huge*huge (overflow) * @@ -50,7 +50,7 @@ static double one = 1.0, half=0.5, huge = 1.0e300; double __ieee754_cosh(x) double x; #endif -{ +{ double t,w; int32_t ix; u_int32_t lx; @@ -60,7 +60,7 @@ static double one = 1.0, half=0.5, huge = 1.0e300; ix &= 0x7fffffff; /* x is INF or NaN */ - if(ix>=0x7ff00000) return x*x; + if(ix>=0x7ff00000) return x*x; /* |x| in [0,0.5*ln2], return 1+expm1(|x|)^2/(2*exp(|x|)) */ if(ix<0x3fd62e43) { @@ -81,7 +81,7 @@ static double one = 1.0, half=0.5, huge = 1.0e300; /* |x| in [log(maxdouble), overflowthresold] */ GET_LOW_WORD(lx,x); - if (ix<0x408633CE || + if (ix<0x408633CE || (ix==0x408633ce)&&(lx<=(u_int32_t)0x8fb9f87d)) { w = __ieee754_exp(half*fabs(x)); t = half*w; diff --git a/lib/msun/src/e_coshf.c b/lib/msun/src/e_coshf.c index 6c30ae55e4aa..25bb9e30aa19 100644 --- a/lib/msun/src/e_coshf.c +++ b/lib/msun/src/e_coshf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_coshf.c,v 1.2 1994/08/18 23:05:17 jtc Exp $"; +static char rcsid[] = "$Id: e_coshf.c,v 1.1.1.1 1994/08/19 09:39:54 jkh Exp $"; #endif #include "math.h" @@ -32,7 +32,7 @@ static float one = 1.0, half=0.5, huge = 1.0e30; float __ieee754_coshf(x) float x; #endif -{ +{ float t,w; int32_t ix; @@ -40,7 +40,7 @@ static float one = 1.0, half=0.5, huge = 1.0e30; ix &= 0x7fffffff; /* x is INF or NaN */ - if(ix>=0x7f800000) return x*x; + if(ix>=0x7f800000) return x*x; /* |x| in [0,0.5*ln2], return 1+expm1(|x|)^2/(2*exp(|x|)) */ if(ix<0x3eb17218) { diff --git a/lib/msun/src/e_exp.c b/lib/msun/src/e_exp.c index 4c76930e7c0c..9b833be6894a 100644 --- a/lib/msun/src/e_exp.c +++ b/lib/msun/src/e_exp.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_exp.c,v 1.6 1994/08/18 23:05:18 jtc Exp $"; +static char rcsid[] = "$Id: e_exp.c,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $"; #endif /* __ieee754_exp(x) @@ -22,36 +22,36 @@ static char rcsid[] = "$Id: e_exp.c,v 1.6 1994/08/18 23:05:18 jtc Exp $"; * Reduce x to an r so that |r| <= 0.5*ln2 ~ 0.34658. * Given x, find r and integer k such that * - * x = k*ln2 + r, |r| <= 0.5*ln2. + * x = k*ln2 + r, |r| <= 0.5*ln2. * - * Here r will be represented as r = hi-lo for better + * Here r will be represented as r = hi-lo for better * accuracy. * * 2. Approximation of exp(r) by a special rational function on * the interval [0,0.34658]: * Write * R(r**2) = r*(exp(r)+1)/(exp(r)-1) = 2 + r*r/6 - r**4/360 + ... - * We use a special Reme algorithm on [0,0.34658] to generate - * a polynomial of degree 5 to approximate R. The maximum error + * We use a special Reme algorithm on [0,0.34658] to generate + * a polynomial of degree 5 to approximate R. The maximum error * of this polynomial approximation is bounded by 2**-59. In * other words, * R(z) ~ 2.0 + P1*z + P2*z**2 + P3*z**3 + P4*z**4 + P5*z**5 * (where z=r*r, and the values of P1 to P5 are listed below) * and * | 5 | -59 - * | 2.0+P1*z+...+P5*z - R(z) | <= 2 + * | 2.0+P1*z+...+P5*z - R(z) | <= 2 * | | * The computation of exp(r) thus becomes * 2*r * exp(r) = 1 + ------- * R - r - * r*R1(r) + * r*R1(r) * = 1 + r + ----------- (for better accuracy) * 2 - R1(r) * where * 2 4 10 * R1(r) = r - (P1*r + P2*r + ... + P5*r ). - * + * * 3. Scale back to obtain exp(x): * From step 1, we have * exp(x) = 2^k * exp(r) @@ -66,13 +66,13 @@ static char rcsid[] = "$Id: e_exp.c,v 1.6 1994/08/18 23:05:18 jtc Exp $"; * 1 ulp (unit in the last place). * * Misc. info. - * For IEEE double + * For IEEE double * if x > 7.09782712893383973096e+02 then exp(x) overflow * if x < -7.45133219101941108420e+02 then exp(x) underflow * * Constants: - * The hexadecimal values are the intended ones for the following - * constants. The decimal values may be used, provided that the + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the * compiler will convert from decimal to binary accurately enough * to produce the hexadecimal values shown. */ @@ -123,7 +123,7 @@ P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */ if(hx>=0x7ff00000) { u_int32_t lx; GET_LOW_WORD(lx,x); - if(((hx&0xfffff)|lx)!=0) + if(((hx&0xfffff)|lx)!=0) return x+x; /* NaN */ else return (xsb==0)? x:0.0; /* exp(+-inf)={inf,0} */ } @@ -132,7 +132,7 @@ P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */ } /* argument reduction */ - if(hx > 0x3fd62e42) { /* if |x| > 0.5 ln2 */ + if(hx > 0x3fd62e42) { /* if |x| > 0.5 ln2 */ if(hx < 0x3FF0A2B2) { /* and |x| < 1.5 ln2 */ hi = x-ln2HI[xsb]; lo=ln2LO[xsb]; k = 1-xsb-xsb; } else { @@ -142,7 +142,7 @@ P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */ lo = t*ln2LO[0]; } x = hi - lo; - } + } else if(hx < 0x3e300000) { /* when |x|<2**-28 */ if(huge+x>one) return one+x;/* trigger inexact */ } @@ -151,7 +151,7 @@ P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */ /* x is now in primary range */ t = x*x; c = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5)))); - if(k==0) return one-((x*c)/(c-2.0)-x); + if(k==0) return one-((x*c)/(c-2.0)-x); else y = one-((lo-(x*c)/(2.0-c))-hi); if(k >= -1021) { u_int32_t hy; diff --git a/lib/msun/src/e_expf.c b/lib/msun/src/e_expf.c index e4df68eccbdd..19ff4ac2388f 100644 --- a/lib/msun/src/e_expf.c +++ b/lib/msun/src/e_expf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_expf.c,v 1.2 1994/08/18 23:05:20 jtc Exp $"; +static char rcsid[] = "$Id: e_expf.c,v 1.1.1.1 1994/08/19 09:39:54 jkh Exp $"; #endif #include "math.h" @@ -68,7 +68,7 @@ P5 = 4.1381369442e-08; /* 0x3331bb4c */ } /* argument reduction */ - if(hx > 0x3eb17218) { /* if |x| > 0.5 ln2 */ + if(hx > 0x3eb17218) { /* if |x| > 0.5 ln2 */ if(hx < 0x3F851592) { /* and |x| < 1.5 ln2 */ hi = x-ln2HI[xsb]; lo=ln2LO[xsb]; k = 1-xsb-xsb; } else { @@ -78,7 +78,7 @@ P5 = 4.1381369442e-08; /* 0x3331bb4c */ lo = t*ln2LO[0]; } x = hi - lo; - } + } else if(hx < 0x31800000) { /* when |x|<2**-28 */ if(huge+x>one) return one+x;/* trigger inexact */ } @@ -87,7 +87,7 @@ P5 = 4.1381369442e-08; /* 0x3331bb4c */ /* x is now in primary range */ t = x*x; c = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5)))); - if(k==0) return one-((x*c)/(c-(float)2.0)-x); + if(k==0) return one-((x*c)/(c-(float)2.0)-x); else y = one-((lo-(x*c)/((float)2.0-c))-hi); if(k >= -125) { u_int32_t hy; diff --git a/lib/msun/src/e_fmod.c b/lib/msun/src/e_fmod.c index 0733d47a7ad5..d784c6848bac 100644 --- a/lib/msun/src/e_fmod.c +++ b/lib/msun/src/e_fmod.c @@ -5,16 +5,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_fmod.c,v 1.6 1994/08/18 23:05:21 jtc Exp $"; +static char rcsid[] = "$Id: e_fmod.c,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $"; #endif -/* +/* * __ieee754_fmod(x,y) * Return x mod y in exact arithmetic * Method: shift and subtract @@ -51,7 +51,7 @@ static double one = 1.0, Zero[] = {0.0, -0.0,}; return (x*y)/(x*y); if(hx<=hy) { if((hx<hy)||(lx<ly)) return x; /* |x|<|y| return x */ - if(lx==ly) + if(lx==ly) return Zero[(u_int32_t)sx>>31]; /* |x|=|y| return x*0*/ } @@ -74,7 +74,7 @@ static double one = 1.0, Zero[] = {0.0, -0.0,}; } else iy = (hy>>20)-1023; /* set up {hx,lx}, {hy,ly} and align y to x */ - if(ix >= -1022) + if(ix >= -1022) hx = 0x00100000|(0x000fffff&hx); else { /* subnormal x, shift x to normal */ n = -1022-ix; @@ -86,7 +86,7 @@ static double one = 1.0, Zero[] = {0.0, -0.0,}; lx = 0; } } - if(iy >= -1022) + if(iy >= -1022) hy = 0x00100000|(0x000fffff&hy); else { /* subnormal y, shift y to normal */ n = -1022-iy; @@ -115,7 +115,7 @@ static double one = 1.0, Zero[] = {0.0, -0.0,}; /* convert back to floating value and restore the sign */ if((hx|lx)==0) /* return sign(x)*0 */ - return Zero[(u_int32_t)sx>>31]; + return Zero[(u_int32_t)sx>>31]; while(hx<0x00100000) { /* normalize x */ hx = hx+hx+(lx>>31); lx = lx+lx; iy -= 1; diff --git a/lib/msun/src/e_fmodf.c b/lib/msun/src/e_fmodf.c index 5e547f5d7771..4a54d1818b08 100644 --- a/lib/msun/src/e_fmodf.c +++ b/lib/msun/src/e_fmodf.c @@ -8,16 +8,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_fmodf.c,v 1.2 1994/08/18 23:05:23 jtc Exp $"; +static char rcsid[] = "$Id: e_fmodf.c,v 1.1.1.1 1994/08/19 09:39:54 jkh Exp $"; #endif -/* +/* * __ieee754_fmodf(x,y) * Return x mod y in exact arithmetic * Method: shift and subtract @@ -66,13 +66,13 @@ static float one = 1.0, Zero[] = {0.0, -0.0,}; } else iy = (hy>>23)-127; /* set up {hx,lx}, {hy,ly} and align y to x */ - if(ix >= -126) + if(ix >= -126) hx = 0x00800000|(0x007fffff&hx); else { /* subnormal x, shift x to normal */ n = -126-ix; hx = hx<<n; } - if(iy >= -126) + if(iy >= -126) hy = 0x00800000|(0x007fffff&hy); else { /* subnormal y, shift y to normal */ n = -126-iy; @@ -95,7 +95,7 @@ static float one = 1.0, Zero[] = {0.0, -0.0,}; /* convert back to floating value and restore the sign */ if(hx==0) /* return sign(x)*0 */ - return Zero[(u_int32_t)sx>>31]; + return Zero[(u_int32_t)sx>>31]; while(hx<0x00800000) { /* normalize x */ hx = hx+hx; iy -= 1; diff --git a/lib/msun/src/e_gamma.c b/lib/msun/src/e_gamma.c index a3e6a4b18a2b..699dc54acad6 100644 --- a/lib/msun/src/e_gamma.c +++ b/lib/msun/src/e_gamma.c @@ -5,14 +5,14 @@ * * 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. * ==================================================== * */ #ifndef lint -static char rcsid[] = "$Id: e_gamma.c,v 1.4 1994/08/10 20:30:51 jtc Exp $"; +static char rcsid[] = "$Id: e_gamma.c,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $"; #endif /* __ieee754_gamma(x) diff --git a/lib/msun/src/e_gamma_r.c b/lib/msun/src/e_gamma_r.c index 8b6cb8fe4889..699af100b171 100644 --- a/lib/msun/src/e_gamma_r.c +++ b/lib/msun/src/e_gamma_r.c @@ -5,18 +5,18 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_gamma_r.c,v 1.4 1994/08/10 20:30:52 jtc Exp $"; +static char rcsid[] = "$Id: e_gamma_r.c,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $"; #endif /* __ieee754_gamma_r(x, signgamp) - * Reentrant version of the logarithm of the Gamma function - * with user provide pointer for the sign of Gamma(x). + * Reentrant version of the logarithm of the Gamma function + * with user provide pointer for the sign of Gamma(x). * * Method: See __ieee754_lgamma_r */ diff --git a/lib/msun/src/e_gammaf.c b/lib/msun/src/e_gammaf.c index 593ae128462a..039c25784e36 100644 --- a/lib/msun/src/e_gammaf.c +++ b/lib/msun/src/e_gammaf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_gammaf.c,v 1.1 1994/08/10 20:30:53 jtc Exp $"; +static char rcsid[] = "$Id: e_gammaf.c,v 1.1.1.1 1994/08/19 09:39:54 jkh Exp $"; #endif /* __ieee754_gammaf(x) diff --git a/lib/msun/src/e_gammaf_r.c b/lib/msun/src/e_gammaf_r.c index b74657a4c5f1..93f17fb825b4 100644 --- a/lib/msun/src/e_gammaf_r.c +++ b/lib/msun/src/e_gammaf_r.c @@ -8,18 +8,18 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_gammaf_r.c,v 1.1 1994/08/10 20:30:54 jtc Exp $"; +static char rcsid[] = "$Id: e_gammaf_r.c,v 1.1.1.1 1994/08/19 09:39:54 jkh Exp $"; #endif /* __ieee754_gammaf_r(x, signgamp) - * Reentrant version of the logarithm of the Gamma function - * with user provide pointer for the sign of Gamma(x). + * Reentrant version of the logarithm of the Gamma function + * with user provide pointer for the sign of Gamma(x). * * Method: See __ieee754_lgammaf_r */ diff --git a/lib/msun/src/e_hypot.c b/lib/msun/src/e_hypot.c index 045f8a3a03cb..2f6e30ff44bf 100644 --- a/lib/msun/src/e_hypot.c +++ b/lib/msun/src/e_hypot.c @@ -5,23 +5,23 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_hypot.c,v 1.6 1994/08/18 23:05:24 jtc Exp $"; +static char rcsid[] = "$Id: e_hypot.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $"; #endif /* __ieee754_hypot(x,y) * - * Method : - * If (assume round-to-nearest) z=x*x+y*y - * has error less than sqrt(2)/2 ulp, than + * Method : + * If (assume round-to-nearest) z=x*x+y*y + * has error less than sqrt(2)/2 ulp, than * sqrt(z) has error less than 1 ulp (exercise). * - * So, compute sqrt(x*x+y*y) with some care as + * So, compute sqrt(x*x+y*y) with some care as * follows to get the error below 1 ulp: * * Assume x>y>0; @@ -31,10 +31,10 @@ static char rcsid[] = "$Id: e_hypot.c,v 1.6 1994/08/18 23:05:24 jtc Exp $"; * where x1 = x with lower 32 bits cleared, x2 = x-x1; else * 2. if x <= 2y use * t1*y1+((x-y)*(x-y)+(t1*y2+t2*y)) - * where t1 = 2x with lower 32 bits cleared, t2 = 2x-t1, + * where t1 = 2x with lower 32 bits cleared, t2 = 2x-t1, * y1= y with lower 32 bits chopped, y2 = y-y1. - * - * NOTE: scaling may be necessary if some argument is too + * + * NOTE: scaling may be necessary if some argument is too * large or too tiny * * Special cases: @@ -42,8 +42,8 @@ static char rcsid[] = "$Id: e_hypot.c,v 1.6 1994/08/18 23:05:24 jtc Exp $"; * hypot(x,y) is NAN if x or y is NAN. * * Accuracy: - * hypot(x,y) returns sqrt(x^2+y^2) with error less - * than 1 ulps (units in the last place) + * hypot(x,y) returns sqrt(x^2+y^2) with error less + * than 1 ulps (units in the last place) */ #include "math.h" @@ -84,7 +84,7 @@ static char rcsid[] = "$Id: e_hypot.c,v 1.6 1994/08/18 23:05:24 jtc Exp $"; SET_HIGH_WORD(b,hb); } if(hb < 0x20b00000) { /* b < 2**-500 */ - if(hb <= 0x000fffff) { /* subnormal b or 0 */ + if(hb <= 0x000fffff) { /* subnormal b or 0 */ u_int32_t low; GET_LOW_WORD(low,b); if((hb|low)==0) return a; diff --git a/lib/msun/src/e_hypotf.c b/lib/msun/src/e_hypotf.c index 874d7eeadd16..66b9e17004d9 100644 --- a/lib/msun/src/e_hypotf.c +++ b/lib/msun/src/e_hypotf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_hypotf.c,v 1.2 1994/08/18 23:05:26 jtc Exp $"; +static char rcsid[] = "$Id: e_hypotf.c,v 1.1.1.1 1994/08/19 09:39:55 jkh Exp $"; #endif #include "math.h" @@ -52,7 +52,7 @@ static char rcsid[] = "$Id: e_hypotf.c,v 1.2 1994/08/18 23:05:26 jtc Exp $"; SET_FLOAT_WORD(b,hb); } if(hb < 0x26800000) { /* b < 2**-50 */ - if(hb <= 0x007fffff) { /* subnormal b or 0 */ + if(hb <= 0x007fffff) { /* subnormal b or 0 */ if(hb==0) return a; SET_FLOAT_WORD(t1,0x3f000000); /* t1=2^126 */ b *= t1; diff --git a/lib/msun/src/e_j0.c b/lib/msun/src/e_j0.c index 508f7210d6f3..3a11397a3262 100644 --- a/lib/msun/src/e_j0.c +++ b/lib/msun/src/e_j0.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_j0.c,v 1.6 1994/08/18 23:05:29 jtc Exp $"; +static char rcsid[] = "$Id: e_j0.c,v 1.1.1.1 1994/08/19 09:39:43 jkh Exp $"; #endif /* __ieee754_j0(x), __ieee754_y0(x) @@ -33,20 +33,20 @@ static char rcsid[] = "$Id: e_j0.c,v 1.6 1994/08/18 23:05:29 jtc Exp $"; * (To avoid cancellation, use * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x)) * to compute the worse one.) - * + * * 3 Special cases * j0(nan)= nan * j0(0) = 1 * j0(inf) = 0 - * + * * Method -- y0(x): * 1. For x<2. - * Since + * Since * y0(x) = 2/pi*(j0(x)*(ln(x/2)+Euler) + x^2/4 - ...) * therefore y0(x)-2/pi*j0(x)*ln(x) is an even function. * We use the following function to approximate y0, * y0(x) = U(z)/V(z) + (2/pi)*(j0(x)*ln(x)), z= x^2 - * where + * where * U(z) = u00 + u01*z + ... + u06*z^6 * V(z) = 1 + v01*z + ... + v04*z^4 * with absolute approximation error bounded by 2**-72. @@ -69,9 +69,9 @@ static double pzero(), qzero(); #endif #ifdef __STDC__ -static const double +static const double #else -static double +static double #endif huge = 1e300, one = 1.0, @@ -94,9 +94,9 @@ static double zero = 0.0; #endif #ifdef __STDC__ - double __ieee754_j0(double x) + double __ieee754_j0(double x) #else - double __ieee754_j0(x) + double __ieee754_j0(x) double x; #endif { @@ -163,9 +163,9 @@ v03 = 2.59150851840457805467e-07, /* 0x3E91642D, 0x7FF202FD */ v04 = 4.41110311332675467403e-10; /* 0x3DFE5018, 0x3BD6D9EF */ #ifdef __STDC__ - double __ieee754_y0(double x) + double __ieee754_y0(double x) #else - double __ieee754_y0(x) + double __ieee754_y0(x) double x; #endif { @@ -175,7 +175,7 @@ v04 = 4.41110311332675467403e-10; /* 0x3DFE5018, 0x3BD6D9EF */ EXTRACT_WORDS(hx,lx,x); ix = 0x7fffffff&hx; /* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0 */ - if(ix>=0x7ff00000) return one/(x+x*x); + if(ix>=0x7ff00000) return one/(x+x*x); if((ix|lx)==0) return -one/zero; if(hx<0) return zero/zero; if(ix >= 0x40000000) { /* |x| >= 2.0 */ @@ -349,7 +349,7 @@ static double pS2[5] = { s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4])))); return one+ r/s; } - + /* For x >= 8, the asymptotic expansions of qzero is * -1/8 s + 75/1024 s^3 - ..., where s = 1/x. diff --git a/lib/msun/src/e_j0f.c b/lib/msun/src/e_j0f.c index ce8e510be634..ce416fab70e8 100644 --- a/lib/msun/src/e_j0f.c +++ b/lib/msun/src/e_j0f.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_j0f.c,v 1.2 1994/08/18 23:05:32 jtc Exp $"; +static char rcsid[] = "$Id: e_j0f.c,v 1.1.1.1 1994/08/19 09:39:55 jkh Exp $"; #endif #include "math.h" @@ -27,9 +27,9 @@ static float pzerof(), qzerof(); #endif #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif huge = 1e30, one = 1.0, @@ -52,9 +52,9 @@ static float zero = 0.0; #endif #ifdef __STDC__ - float __ieee754_j0f(float x) + float __ieee754_j0f(float x) #else - float __ieee754_j0f(x) + float __ieee754_j0f(x) float x; #endif { @@ -121,9 +121,9 @@ v03 = 2.5915085189e-07, /* 0x348b216c */ v04 = 4.4111031494e-10; /* 0x2ff280c2 */ #ifdef __STDC__ - float __ieee754_y0f(float x) + float __ieee754_y0f(float x) #else - float __ieee754_y0f(x) + float __ieee754_y0f(x) float x; #endif { @@ -133,7 +133,7 @@ v04 = 4.4111031494e-10; /* 0x2ff280c2 */ GET_FLOAT_WORD(hx,x); ix = 0x7fffffff&hx; /* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0 */ - if(ix>=0x7f800000) return one/(x+x*x); + if(ix>=0x7f800000) return one/(x+x*x); if(ix==0) return -one/zero; if(hx<0) return zero/zero; if(ix >= 0x40000000) { /* |x| >= 2.0 */ @@ -306,7 +306,7 @@ static float pS2[5] = { s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4])))); return one+ r/s; } - + /* For x >= 8, the asymptotic expansions of qzero is * -1/8 s + 75/1024 s^3 - ..., where s = 1/x. diff --git a/lib/msun/src/e_j1.c b/lib/msun/src/e_j1.c index 407b84cbb6af..f577368048ed 100644 --- a/lib/msun/src/e_j1.c +++ b/lib/msun/src/e_j1.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_j1.c,v 1.6 1994/08/18 23:05:33 jtc Exp $"; +static char rcsid[] = "$Id: e_j1.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $"; #endif /* __ieee754_j1(x), __ieee754_y1(x) @@ -34,16 +34,16 @@ static char rcsid[] = "$Id: e_j1.c,v 1.6 1994/08/18 23:05:33 jtc Exp $"; * (To avoid cancellation, use * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x)) * to compute the worse one.) - * + * * 3 Special cases * j1(nan)= nan * j1(0) = 0 * j1(inf) = 0 - * + * * Method -- y1(x): - * 1. screen out x<=0 cases: y1(0)=-inf, y1(x<0)=NaN + * 1. screen out x<=0 cases: y1(0)=-inf, y1(x<0)=NaN * 2. For x<2. - * Since + * Since * y1(x) = 2/pi*(j1(x)*(ln(x/2)+Euler)-1/x-x/2+5/64*x^3-...) * therefore y1(x)-2/pi*j1(x)*ln(x)-1/x is an odd function. * We use the following function to approximate y1, @@ -69,9 +69,9 @@ static double pone(), qone(); #endif #ifdef __STDC__ -static const double +static const double #else -static double +static double #endif huge = 1e300, one = 1.0, @@ -95,9 +95,9 @@ static double zero = 0.0; #endif #ifdef __STDC__ - double __ieee754_j1(double x) + double __ieee754_j1(double x) #else - double __ieee754_j1(x) + double __ieee754_j1(x) double x; #endif { @@ -164,9 +164,9 @@ static double V0[5] = { }; #ifdef __STDC__ - double __ieee754_y1(double x) + double __ieee754_y1(double x) #else - double __ieee754_y1(x) + double __ieee754_y1(x) double x; #endif { @@ -176,7 +176,7 @@ static double V0[5] = { EXTRACT_WORDS(hx,lx,x); ix = 0x7fffffff&hx; /* if Y1(NaN) is NaN, Y1(-inf) is NaN, Y1(inf) is 0 */ - if(ix>=0x7ff00000) return one/(x+x*x); + if(ix>=0x7ff00000) return one/(x+x*x); if((ix|lx)==0) return -one/zero; if(hx<0) return zero/zero; if(ix >= 0x40000000) { /* |x| >= 2.0 */ @@ -206,10 +206,10 @@ static double V0[5] = { z = invsqrtpi*(u*ss+v*cc)/sqrt(x); } return z; - } + } if(ix<=0x3c900000) { /* x < 2**-54 */ return(-tpi/x); - } + } z = x*x; u = U0[0]+z*(U0[1]+z*(U0[2]+z*(U0[3]+z*U0[4]))); v = one+z*(V0[0]+z*(V0[1]+z*(V0[2]+z*(V0[3]+z*V0[4])))); @@ -347,7 +347,7 @@ static double ps2[5] = { s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4])))); return one+ r/s; } - + /* For x >= 8, the asymptotic expansions of qone is * 3/8 s - 105/1024 s^3 - ..., where s = 1/x. diff --git a/lib/msun/src/e_j1f.c b/lib/msun/src/e_j1f.c index 9fa43fcd8f1d..f06b30006f2d 100644 --- a/lib/msun/src/e_j1f.c +++ b/lib/msun/src/e_j1f.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_j1f.c,v 1.2 1994/08/18 23:05:35 jtc Exp $"; +static char rcsid[] = "$Id: e_j1f.c,v 1.1.1.1 1994/08/19 09:39:55 jkh Exp $"; #endif #include "math.h" @@ -27,9 +27,9 @@ static float ponef(), qonef(); #endif #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif huge = 1e30, one = 1.0, @@ -53,9 +53,9 @@ static float zero = 0.0; #endif #ifdef __STDC__ - float __ieee754_j1f(float x) + float __ieee754_j1f(float x) #else - float __ieee754_j1f(x) + float __ieee754_j1f(x) float x; #endif { @@ -122,9 +122,9 @@ static float V0[5] = { }; #ifdef __STDC__ - float __ieee754_y1f(float x) + float __ieee754_y1f(float x) #else - float __ieee754_y1f(x) + float __ieee754_y1f(x) float x; #endif { @@ -134,7 +134,7 @@ static float V0[5] = { GET_FLOAT_WORD(hx,x); ix = 0x7fffffff&hx; /* if Y1(NaN) is NaN, Y1(-inf) is NaN, Y1(inf) is 0 */ - if(ix>=0x7f800000) return one/(x+x*x); + if(ix>=0x7f800000) return one/(x+x*x); if(ix==0) return -one/zero; if(hx<0) return zero/zero; if(ix >= 0x40000000) { /* |x| >= 2.0 */ @@ -164,10 +164,10 @@ static float V0[5] = { z = invsqrtpi*(u*ss+v*cc)/sqrtf(x); } return z; - } + } if(ix<=0x24800000) { /* x < 2**-54 */ return(-tpi/x); - } + } z = x*x; u = U0[0]+z*(U0[1]+z*(U0[2]+z*(U0[3]+z*U0[4]))); v = one+z*(V0[0]+z*(V0[1]+z*(V0[2]+z*(V0[3]+z*V0[4])))); @@ -305,7 +305,7 @@ static float ps2[5] = { s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4])))); return one+ r/s; } - + /* For x >= 8, the asymptotic expansions of qone is * 3/8 s - 105/1024 s^3 - ..., where s = 1/x. diff --git a/lib/msun/src/e_jn.c b/lib/msun/src/e_jn.c index b06414942849..ae309f0e6b74 100644 --- a/lib/msun/src/e_jn.c +++ b/lib/msun/src/e_jn.c @@ -5,20 +5,20 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_jn.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $"; +static char rcsid[] = "$Id: e_jn.c,v 1.2 1995/04/07 23:13:42 bde Exp $"; #endif /* * __ieee754_jn(n, x), __ieee754_yn(n, x) * floating point Bessel's function of the 1st and 2nd kind * of order n - * + * * Special cases: * y0(0)=y1(0)=yn(n,0) = -inf with division by zero signal; * y0(-ve)=y1(-ve)=yn(n,-ve) are NaN with invalid signal. @@ -37,7 +37,7 @@ static char rcsid[] = "$Id: e_jn.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $"; * yn(n,x) is similar in all respects, except * that forward recursion is used for all * values of n>1. - * + * */ #include "math.h" @@ -76,7 +76,7 @@ static double zero = 0.00000000000000000000e+00; ix = 0x7fffffff&hx; /* if J(n,NaN) is NaN */ if((ix|((u_int32_t)(lx|-lx))>>31)>0x7ff00000) return x+x; - if(n<0){ + if(n<0){ n = -n; x = -x; hx ^= 0x80000000; @@ -87,13 +87,13 @@ static double zero = 0.00000000000000000000e+00; x = fabs(x); if((ix|lx)==0||ix>=0x7ff00000) /* if x is 0 or inf */ b = zero; - else if((double)n<=x) { + else if((double)n<=x) { /* Safe to use J(n+1,x)=2n/x *J(n,x)-J(n-1,x) */ if(ix>=0x52D00000) { /* x > 2**302 */ - /* (x >> n**2) + /* (x >> n**2) * Jn(x) = cos(x-(2n+1)*pi/4)*sqrt(2/x*pi) * Yn(x) = sin(x-(2n+1)*pi/4)*sqrt(2/x*pi) - * Let s=sin(x), c=cos(x), + * Let s=sin(x), c=cos(x), * xn=x-(2n+1)*pi/4, sqt2 = sqrt(2),then * * n sin(xn)*sqt2 cos(xn)*sqt2 @@ -110,7 +110,7 @@ static double zero = 0.00000000000000000000e+00; case 3: temp = cos(x)-sin(x); break; } b = invsqrtpi*temp/sqrt(x); - } else { + } else { a = __ieee754_j0(x); b = __ieee754_j1(x); for(i=1;i<n;i++){ @@ -121,7 +121,7 @@ static double zero = 0.00000000000000000000e+00; } } else { if(ix<0x3e100000) { /* x < 2**-29 */ - /* x is tiny, return the first Taylor expansion of J(n,x) + /* x is tiny, return the first Taylor expansion of J(n,x) * J(n,x) = 1/n!*(x/2)^n - ... */ if(n>33) /* underflow */ @@ -136,14 +136,14 @@ static double zero = 0.00000000000000000000e+00; } } else { /* use backward recurrence */ - /* x x^2 x^2 + /* x x^2 x^2 * J(n,x)/J(n-1,x) = ---- ------ ------ ..... * 2n - 2(n+1) - 2(n+2) * - * 1 1 1 + * 1 1 1 * (for large x) = ---- ------ ------ ..... * 2n 2(n+1) 2(n+2) - * -- - ------ - ------ - + * -- - ------ - ------ - * x x x * * Let w = 2n/x and h=2/x, then the above quotient @@ -159,9 +159,9 @@ static double zero = 0.00000000000000000000e+00; * To determine how many terms needed, let * Q(0) = w, Q(1) = w(w+h) - 1, * Q(k) = (w+k*h)*Q(k-1) - Q(k-2), - * When Q(k) > 1e4 good for single - * When Q(k) > 1e9 good for double - * When Q(k) > 1e17 good for quadruple + * When Q(k) > 1e4 good for single + * When Q(k) > 1e9 good for double + * When Q(k) > 1e17 good for quadruple */ /* determine k */ double t,v; @@ -183,7 +183,7 @@ static double zero = 0.00000000000000000000e+00; * single 8.8722839355e+01 * double 7.09782712893383973096e+02 * long double 1.1356523406294143949491931077970765006170e+04 - * then recurrent value may overflow and the result is + * then recurrent value may overflow and the result is * likely underflow to zero */ tmp = n; @@ -219,9 +219,9 @@ static double zero = 0.00000000000000000000e+00; } #ifdef __STDC__ - double __ieee754_yn(int n, double x) + double __ieee754_yn(int n, double x) #else - double __ieee754_yn(n,x) + double __ieee754_yn(n,x) int n; double x; #endif { @@ -244,10 +244,10 @@ static double zero = 0.00000000000000000000e+00; if(n==1) return(sign*__ieee754_y1(x)); if(ix==0x7ff00000) return zero; if(ix>=0x52D00000) { /* x > 2**302 */ - /* (x >> n**2) + /* (x >> n**2) * Jn(x) = cos(x-(2n+1)*pi/4)*sqrt(2/x*pi) * Yn(x) = sin(x-(2n+1)*pi/4)*sqrt(2/x*pi) - * Let s=sin(x), c=cos(x), + * Let s=sin(x), c=cos(x), * xn=x-(2n+1)*pi/4, sqt2 = sqrt(2),then * * n sin(xn)*sqt2 cos(xn)*sqt2 @@ -270,7 +270,7 @@ static double zero = 0.00000000000000000000e+00; b = __ieee754_y1(x); /* quit if b is -inf */ GET_HIGH_WORD(high,b); - for(i=1;i<n&&high!=0xfff00000;i++){ + for(i=1;i<n&&high!=0xfff00000;i++){ temp = b; b = ((double)(i+i)/x)*b - a; GET_HIGH_WORD(high,b); diff --git a/lib/msun/src/e_jnf.c b/lib/msun/src/e_jnf.c index 4662bce1718b..6393f83df5c1 100644 --- a/lib/msun/src/e_jnf.c +++ b/lib/msun/src/e_jnf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_jnf.c,v 1.1.1.1 1994/08/19 09:39:55 jkh Exp $"; +static char rcsid[] = "$Id: e_jnf.c,v 1.2 1995/04/07 23:13:43 bde Exp $"; #endif #include "math.h" @@ -53,7 +53,7 @@ static float zero = 0.0000000000e+00; ix = 0x7fffffff&hx; /* if J(n,NaN) is NaN */ if(ix>0x7f800000) return x+x; - if(n<0){ + if(n<0){ n = -n; x = -x; hx ^= 0x80000000; @@ -64,7 +64,7 @@ static float zero = 0.0000000000e+00; x = fabsf(x); if(ix==0||ix>=0x7f800000) /* if x is 0 or inf */ b = zero; - else if((float)n<=x) { + else if((float)n<=x) { /* Safe to use J(n+1,x)=2n/x *J(n,x)-J(n-1,x) */ a = __ieee754_j0f(x); b = __ieee754_j1f(x); @@ -75,7 +75,7 @@ static float zero = 0.0000000000e+00; } } else { if(ix<0x30800000) { /* x < 2**-29 */ - /* x is tiny, return the first Taylor expansion of J(n,x) + /* x is tiny, return the first Taylor expansion of J(n,x) * J(n,x) = 1/n!*(x/2)^n - ... */ if(n>33) /* underflow */ @@ -90,14 +90,14 @@ static float zero = 0.0000000000e+00; } } else { /* use backward recurrence */ - /* x x^2 x^2 + /* x x^2 x^2 * J(n,x)/J(n-1,x) = ---- ------ ------ ..... * 2n - 2(n+1) - 2(n+2) * - * 1 1 1 + * 1 1 1 * (for large x) = ---- ------ ------ ..... * 2n 2(n+1) 2(n+2) - * -- - ------ - ------ - + * -- - ------ - ------ - * x x x * * Let w = 2n/x and h=2/x, then the above quotient @@ -113,9 +113,9 @@ static float zero = 0.0000000000e+00; * To determine how many terms needed, let * Q(0) = w, Q(1) = w(w+h) - 1, * Q(k) = (w+k*h)*Q(k-1) - Q(k-2), - * When Q(k) > 1e4 good for single - * When Q(k) > 1e9 good for double - * When Q(k) > 1e17 good for quadruple + * When Q(k) > 1e4 good for single + * When Q(k) > 1e9 good for double + * When Q(k) > 1e17 good for quadruple */ /* determine k */ float t,v; @@ -137,7 +137,7 @@ static float zero = 0.0000000000e+00; * single 8.8722839355e+01 * double 7.09782712893383973096e+02 * long double 1.1356523406294143949491931077970765006170e+04 - * then recurrent value may overflow and the result is + * then recurrent value may overflow and the result is * likely underflow to zero */ tmp = n; @@ -173,9 +173,9 @@ static float zero = 0.0000000000e+00; } #ifdef __STDC__ - float __ieee754_ynf(int n, float x) + float __ieee754_ynf(int n, float x) #else - float __ieee754_ynf(n,x) + float __ieee754_ynf(n,x) int n; float x; #endif { @@ -202,7 +202,7 @@ static float zero = 0.0000000000e+00; b = __ieee754_y1f(x); /* quit if b is -inf */ GET_FLOAT_WORD(ib,b); - for(i=1;i<n&&ib!=0xff800000;i++){ + for(i=1;i<n&&ib!=0xff800000;i++){ temp = b; b = ((float)(i+i)/x)*b - a; GET_FLOAT_WORD(ib,b); diff --git a/lib/msun/src/e_lgamma.c b/lib/msun/src/e_lgamma.c index 04852a2af99c..39de847aa175 100644 --- a/lib/msun/src/e_lgamma.c +++ b/lib/msun/src/e_lgamma.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_lgamma.c,v 1.4 1994/08/10 20:31:05 jtc Exp $"; +static char rcsid[] = "$Id: e_lgamma.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $"; #endif /* __ieee754_lgamma(x) diff --git a/lib/msun/src/e_lgamma_r.c b/lib/msun/src/e_lgamma_r.c index 1b8d0c75709b..57b24d414de4 100644 --- a/lib/msun/src/e_lgamma_r.c +++ b/lib/msun/src/e_lgamma_r.c @@ -5,22 +5,22 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_lgamma_r.c,v 1.5 1994/08/10 20:31:07 jtc Exp $"; +static char rcsid[] = "$Id: e_lgamma_r.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $"; #endif /* __ieee754_lgamma_r(x, signgamp) - * Reentrant version of the logarithm of the Gamma function - * with user provide pointer for the sign of Gamma(x). + * Reentrant version of the logarithm of the Gamma function + * with user provide pointer for the sign of Gamma(x). * * Method: * 1. Argument Reduction for 0 < x <= 8 - * Since gamma(1+s)=s*gamma(s), for x in [0,8], we may + * Since gamma(1+s)=s*gamma(s), for x in [0,8], we may * reduce x to a number in [1.5,2.5] by * lgamma(1+s) = log(s) + lgamma(s) * for example, @@ -58,36 +58,36 @@ static char rcsid[] = "$Id: e_lgamma_r.c,v 1.5 1994/08/10 20:31:07 jtc Exp $"; * by * 3 5 11 * w = w0 + w1*z + w2*z + w3*z + ... + w6*z - * where + * where * |w - f(z)| < 2**-58.74 - * + * * 4. For negative x, since (G is gamma function) * -x*G(-x)*G(x) = pi/sin(pi*x), * we have * G(x) = pi/(sin(pi*x)*(-x)*G(-x)) * since G(-x) is positive, sign(G(x)) = sign(sin(pi*x)) for x<0 - * Hence, for x<0, signgam = sign(sin(pi*x)) and + * Hence, for x<0, signgam = sign(sin(pi*x)) and * lgamma(x) = log(|Gamma(x)|) * = log(pi/(|x*sin(pi*x)|)) - lgamma(-x); - * Note: one should avoid compute pi*(-x) directly in the + * Note: one should avoid compute pi*(-x) directly in the * computation of sin(pi*(-x)). - * + * * 5. Special Cases * lgamma(2+s) ~ s*(1-Euler) for tiny s * lgamma(1)=lgamma(2)=0 * lgamma(x) ~ -log(x) for tiny x * lgamma(0) = lgamma(inf) = inf * lgamma(-integer) = +-inf - * + * */ #include "math.h" #include "math_private.h" #ifdef __STDC__ -static const double +static const double #else -static double +static double #endif two52= 4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */ half= 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */ @@ -200,9 +200,9 @@ static double zero= 0.00000000000000000000e+00; } switch (n) { case 0: y = __kernel_sin(pi*y,zero,0); break; - case 1: + case 1: case 2: y = __kernel_cos(pi*(0.5-y),zero); break; - case 3: + case 3: case 4: y = __kernel_sin(pi*(one-y),zero,0); break; case 5: case 6: y = -__kernel_cos(pi*(y-1.5),zero); break; @@ -275,7 +275,7 @@ static double zero= 0.00000000000000000000e+00; p3 = t2+w*(t5+w*(t8+w*(t11+w*t14))); p = z*p1-(tt-w*(p2+y*p3)); r += (tf + p); break; - case 2: + case 2: p1 = y*(u0+y*(u1+y*(u2+y*(u3+y*(u4+y*u5))))); p2 = one+y*(v1+y*(v2+y*(v3+y*(v4+y*v5)))); r += (-0.5*y + p1/p2); @@ -304,7 +304,7 @@ static double zero= 0.00000000000000000000e+00; y = z*z; w = w0+z*(w1+y*(w2+y*(w3+y*(w4+y*(w5+y*w6))))); r = (x-half)*(t-one)+w; - } else + } else /* 2**58 <= x <= inf */ r = x*(__ieee754_log(x)-one); if(hx<0) r = nadj - r; diff --git a/lib/msun/src/e_lgammaf.c b/lib/msun/src/e_lgammaf.c index c65b29b65e66..1d90cdd692a9 100644 --- a/lib/msun/src/e_lgammaf.c +++ b/lib/msun/src/e_lgammaf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_lgammaf.c,v 1.1 1994/08/10 20:31:08 jtc Exp $"; +static char rcsid[] = "$Id: e_lgammaf.c,v 1.1.1.1 1994/08/19 09:39:55 jkh Exp $"; #endif /* __ieee754_lgammaf(x) diff --git a/lib/msun/src/e_lgammaf_r.c b/lib/msun/src/e_lgammaf_r.c index 9765002cc027..2cd8ec8ca9c4 100644 --- a/lib/msun/src/e_lgammaf_r.c +++ b/lib/msun/src/e_lgammaf_r.c @@ -8,22 +8,22 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_lgammaf_r.c,v 1.1 1994/08/10 20:31:09 jtc Exp $"; +static char rcsid[] = "$Id: e_lgammaf_r.c,v 1.1.1.1 1994/08/19 09:39:55 jkh Exp $"; #endif #include "math.h" #include "math_private.h" #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif two23= 8.3886080000e+06, /* 0x4b000000 */ half= 5.0000000000e-01, /* 0x3f000000 */ @@ -136,9 +136,9 @@ static float zero= 0.0000000000e+00; } switch (n) { case 0: y = __kernel_sinf(pi*y,zero,0); break; - case 1: + case 1: case 2: y = __kernel_cosf(pi*((float)0.5-y),zero); break; - case 3: + case 3: case 4: y = __kernel_sinf(pi*(one-y),zero,0); break; case 5: case 6: y = -__kernel_cosf(pi*(y-(float)1.5),zero); break; @@ -211,7 +211,7 @@ static float zero= 0.0000000000e+00; p3 = t2+w*(t5+w*(t8+w*(t11+w*t14))); p = z*p1-(tt-w*(p2+y*p3)); r += (tf + p); break; - case 2: + case 2: p1 = y*(u0+y*(u1+y*(u2+y*(u3+y*(u4+y*u5))))); p2 = one+y*(v1+y*(v2+y*(v3+y*(v4+y*v5)))); r += (-(float)0.5*y + p1/p2); @@ -240,7 +240,7 @@ static float zero= 0.0000000000e+00; y = z*z; w = w0+z*(w1+y*(w2+y*(w3+y*(w4+y*(w5+y*w6))))); r = (x-half)*(t-one)+w; - } else + } else /* 2**58 <= x <= inf */ r = x*(__ieee754_logf(x)-one); if(hx<0) r = nadj - r; diff --git a/lib/msun/src/e_log.c b/lib/msun/src/e_log.c index 222152da8738..67e2d216b7fa 100644 --- a/lib/msun/src/e_log.c +++ b/lib/msun/src/e_log.c @@ -5,29 +5,29 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_log.c,v 1.6 1994/08/18 23:05:41 jtc Exp $"; +static char rcsid[] = "$Id: e_log.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $"; #endif /* __ieee754_log(x) * Return the logrithm of x * - * Method : - * 1. Argument Reduction: find k and f such that - * x = 2^k * (1+f), + * Method : + * 1. Argument Reduction: find k and f such that + * x = 2^k * (1+f), * where sqrt(2)/2 < 1+f < sqrt(2) . * * 2. Approximation of log(1+f). * Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s) * = 2s + 2/3 s**3 + 2/5 s**5 + ....., * = 2s + s*R - * We use a special Reme algorithm on [0,0.1716] to generate - * a polynomial of degree 14 to approximate R The maximum error + * We use a special Reme algorithm on [0,0.1716] to generate + * a polynomial of degree 14 to approximate R The maximum error * of this polynomial approximation is bounded by 2**-58.45. In * other words, * 2 4 6 8 10 12 14 @@ -35,22 +35,22 @@ static char rcsid[] = "$Id: e_log.c,v 1.6 1994/08/18 23:05:41 jtc Exp $"; * (the values of Lg1 to Lg7 are listed in the program) * and * | 2 14 | -58.45 - * | Lg1*s +...+Lg7*s - R(z) | <= 2 + * | Lg1*s +...+Lg7*s - R(z) | <= 2 * | | * Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2. * In order to guarantee error in log below 1ulp, we compute log * by * log(1+f) = f - s*(f - R) (if f is not too large) * log(1+f) = f - (hfsq - s*(hfsq+R)). (better accuracy) - * - * 3. Finally, log(x) = k*ln2 + log(1+f). + * + * 3. Finally, log(x) = k*ln2 + log(1+f). * = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo))) - * Here ln2 is split into two floating point number: + * Here ln2 is split into two floating point number: * ln2_hi + ln2_lo, * where n*ln2_hi is always exact for |n| < 2000. * * Special cases: - * log(x) is NaN with signal if x < 0 (including -INF) ; + * log(x) is NaN with signal if x < 0 (including -INF) ; * log(+INF) is +INF; log(0) is -INF with signal; * log(NaN) is that NaN with no signal. * @@ -59,9 +59,9 @@ static char rcsid[] = "$Id: e_log.c,v 1.6 1994/08/18 23:05:41 jtc Exp $"; * 1 ulp (unit in the last place). * * Constants: - * The hexadecimal values are the intended ones for the following - * constants. The decimal values may be used, provided that the - * compiler will convert from decimal to binary accurately enough + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough * to produce the hexadecimal values shown. */ @@ -105,12 +105,12 @@ static double zero = 0.0; k=0; if (hx < 0x00100000) { /* x < 2**-1022 */ - if (((hx&0x7fffffff)|lx)==0) + if (((hx&0x7fffffff)|lx)==0) return -two54/zero; /* log(+-0)=-inf */ if (hx<0) return (x-x)/zero; /* log(-#) = NaN */ k -= 54; x *= two54; /* subnormal number, scale up x */ GET_HIGH_WORD(hx,x); - } + } if (hx >= 0x7ff00000) return x+x; k += (hx>>20)-1023; hx &= 0x000fffff; @@ -125,14 +125,14 @@ static double zero = 0.0; if(k==0) return f-R; else {dk=(double)k; return dk*ln2_hi-((R-dk*ln2_lo)-f);} } - s = f/(2.0+f); + s = f/(2.0+f); dk = (double)k; z = s*s; i = hx-0x6147a; w = z*z; j = 0x6b851-hx; - t1= w*(Lg2+w*(Lg4+w*Lg6)); - t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7))); + t1= w*(Lg2+w*(Lg4+w*Lg6)); + t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7))); i |= j; R = t2+t1; if(i>0) { diff --git a/lib/msun/src/e_log10.c b/lib/msun/src/e_log10.c index 69a235653ed6..4f4ed28933fd 100644 --- a/lib/msun/src/e_log10.c +++ b/lib/msun/src/e_log10.c @@ -5,37 +5,37 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_log10.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $"; +static char rcsid[] = "$Id: e_log10.c,v 1.2 1995/04/07 23:23:23 bde Exp $"; #endif /* __ieee754_log10(x) * Return the base 10 logarithm of x - * + * * Method : * Let log10_2hi = leading 40 bits of log10(2) and * log10_2lo = log10(2) - log10_2hi, * ivln10 = 1/log(10) rounded. * Then - * n = ilogb(x), + * n = ilogb(x), * if(n<0) n = n+1; * x = scalbn(x,-n); * log10(x) := n*log10_2hi + (n*log10_2lo + ivln10*log(x)) * * Note 1: - * To guarantee log10(10**n)=n, where 10**n is normal, the rounding + * To guarantee log10(10**n)=n, where 10**n is normal, the rounding * mode must set to Round-to-Nearest. * Note 2: * [1/log(10)] rounded to 53 bits has error .198 ulps; * log10 is monotonic at all binary break points. * * Special cases: - * log10(x) is NaN with signal if x < 0; + * log10(x) is NaN with signal if x < 0; * log10(+INF) is +INF with no signal; log10(0) is -INF with signal; * log10(NaN) is that NaN with no signal; * log10(10**N) = N for N=0,1,...,22. diff --git a/lib/msun/src/e_log10f.c b/lib/msun/src/e_log10f.c index d493ad8ba780..3caa25abba35 100644 --- a/lib/msun/src/e_log10f.c +++ b/lib/msun/src/e_log10f.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_log10f.c,v 1.1.1.1 1994/08/19 09:39:56 jkh Exp $"; +static char rcsid[] = "$Id: e_log10f.c,v 1.2 1995/04/07 23:23:23 bde Exp $"; #endif #include "math.h" diff --git a/lib/msun/src/e_logf.c b/lib/msun/src/e_logf.c index b18bc7654092..1baef0470b73 100644 --- a/lib/msun/src/e_logf.c +++ b/lib/msun/src/e_logf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_logf.c,v 1.2 1994/08/18 23:05:48 jtc Exp $"; +static char rcsid[] = "$Id: e_logf.c,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $"; #endif #include "math.h" @@ -56,12 +56,12 @@ static float zero = 0.0; k=0; if (ix < 0x00800000) { /* x < 2**-126 */ - if ((ix&0x7fffffff)==0) + if ((ix&0x7fffffff)==0) return -two25/zero; /* log(+-0)=-inf */ if (ix<0) return (x-x)/zero; /* log(-#) = NaN */ k -= 25; x *= two25; /* subnormal number, scale up x */ GET_FLOAT_WORD(ix,x); - } + } if (ix >= 0x7f800000) return x+x; k += (ix>>23)-127; ix &= 0x007fffff; @@ -76,14 +76,14 @@ static float zero = 0.0; if(k==0) return f-R; else {dk=(float)k; return dk*ln2_hi-((R-dk*ln2_lo)-f);} } - s = f/((float)2.0+f); + s = f/((float)2.0+f); dk = (float)k; z = s*s; i = ix-(0x6147a<<3); w = z*z; j = (0x6b851<<3)-ix; - t1= w*(Lg2+w*(Lg4+w*Lg6)); - t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7))); + t1= w*(Lg2+w*(Lg4+w*Lg6)); + t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7))); i |= j; R = t2+t1; if(i>0) { diff --git a/lib/msun/src/e_pow.c b/lib/msun/src/e_pow.c index 80ac795c9d02..8bdc8a862e5f 100644 --- a/lib/msun/src/e_pow.c +++ b/lib/msun/src/e_pow.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_pow.c,v 1.5 1994/08/18 23:05:51 jtc Exp $"; +static char rcsid[] = "$Id: e_pow.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $"; #endif /* __ieee754_pow(x,y) return x**y @@ -21,7 +21,7 @@ static char rcsid[] = "$Id: e_pow.c,v 1.5 1994/08/18 23:05:51 jtc Exp $"; * 1. Compute and return log2(x) in two pieces: * log2(x) = w1 + w2, * where w1 has 53-24 = 29 bit trailing zeros. - * 2. Perform y*log2(x) = n+y' by simulating muti-precision + * 2. Perform y*log2(x) = n+y' by simulating muti-precision * arithmetic, where |y'|<=0.5. * 3. Return x**y = 2**n*exp(y'*log2) * @@ -49,13 +49,13 @@ static char rcsid[] = "$Id: e_pow.c,v 1.5 1994/08/18 23:05:51 jtc Exp $"; * Accuracy: * pow(x,y) returns x**y nearly rounded. In particular * pow(integer,integer) - * always returns the correct integer provided it is + * always returns the correct integer provided it is * representable. * * Constants : - * The hexadecimal values are the intended ones for the following - * constants. The decimal values may be used, provided that the - * compiler will convert from decimal to binary accurately enough + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough * to produce the hexadecimal values shown. */ @@ -63,9 +63,9 @@ static char rcsid[] = "$Id: e_pow.c,v 1.5 1994/08/18 23:05:51 jtc Exp $"; #include "math_private.h" #ifdef __STDC__ -static const double +static const double #else -static double +static double #endif bp[] = {1.0, 1.5,}, dp_h[] = { 0.0, 5.84962487220764160156e-01,}, /* 0x3FE2B803, 0x40000000 */ @@ -117,12 +117,12 @@ ivln2_l = 1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail*/ ix = hx&0x7fffffff; iy = hy&0x7fffffff; /* y==zero: x**0 = 1 */ - if((iy|ly)==0) return one; + if((iy|ly)==0) return one; /* +-NaN return x+y */ if(ix > 0x7ff00000 || ((ix==0x7ff00000)&&(lx!=0)) || - iy > 0x7ff00000 || ((iy==0x7ff00000)&&(ly!=0))) - return x+y; + iy > 0x7ff00000 || ((iy==0x7ff00000)&&(ly!=0))) + return x+y; /* determine if y is an odd int when x < 0 * yisint = 0 ... y is not an integer @@ -130,7 +130,7 @@ ivln2_l = 1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail*/ * yisint = 2 ... y is an even int */ yisint = 0; - if(hx<0) { + if(hx<0) { if(iy>=0x43400000) yisint = 2; /* even integer y */ else if(iy>=0x3ff00000) { k = (iy>>20)-0x3ff; /* exponent */ @@ -141,11 +141,11 @@ ivln2_l = 1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail*/ j = iy>>(20-k); if((j<<(20-k))==iy) yisint = 2-(j&1); } - } - } + } + } /* special value of y */ - if(ly==0) { + if(ly==0) { if (iy==0x7ff00000) { /* y is +-inf */ if(((ix-0x3ff00000)|lx)==0) return y - y; /* inf**+-1 is NaN */ @@ -153,14 +153,14 @@ ivln2_l = 1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail*/ return (hy>=0)? y: zero; else /* (|x|<1)**-,+inf = inf,0 */ return (hy<0)?-y: zero; - } + } if(iy==0x3ff00000) { /* y is +-1 */ if(hy<0) return one/x; else return x; } if(hy==0x40000000) return x*x; /* y is 2 */ if(hy==0x3fe00000) { /* y is 0.5 */ if(hx>=0) /* x >= +0 */ - return sqrt(x); + return sqrt(x); } } @@ -173,13 +173,13 @@ ivln2_l = 1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail*/ if(hx<0) { if(((ix-0x3ff00000)|yisint)==0) { z = (z-z)/(z-z); /* (-1)**non-int is NaN */ - } else if(yisint==1) + } else if(yisint==1) z = -z; /* (x<0)**odd = -(|x|**odd) */ } return z; } } - + /* (x<0)**(non-int) is NaN */ /* CYGNUS LOCAL: This used to be if((((hx>>31)+1)|yisint)==0) return (x-x)/(x-x); @@ -196,7 +196,7 @@ ivln2_l = 1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail*/ /* over/underflow if x is not close to one */ if(ix<0x3fefffff) return (hy<0)? huge*huge:tiny*tiny; if(ix>0x3ff00000) return (hy>0)? huge*huge:tiny*tiny; - /* now |1-x| is tiny <= 2**-20, suffice to compute + /* now |1-x| is tiny <= 2**-20, suffice to compute log(x) by x-x^2/2+x^3/3-x^4/4 */ t = x-1; /* t has 20 trailing zeros */ w = (t*t)*(0.5-t*(0.3333333333333333333333-t*0.25)); @@ -293,7 +293,7 @@ ivln2_l = 1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail*/ n = ((n&0x000fffff)|0x00100000)>>(20-k); if(j<0) n = -n; p_h -= t; - } + } t = p_l+p_h; SET_LOW_WORD(t,0); u = t*lg2_h; diff --git a/lib/msun/src/e_powf.c b/lib/msun/src/e_powf.c index 2d1ef4a38214..7b268d36fe23 100644 --- a/lib/msun/src/e_powf.c +++ b/lib/msun/src/e_powf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_powf.c,v 1.2 1994/08/18 23:05:54 jtc Exp $"; +static char rcsid[] = "$Id: e_powf.c,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $"; #endif #include "math.h" @@ -74,12 +74,12 @@ ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/ ix = hx&0x7fffffff; iy = hy&0x7fffffff; /* y==zero: x**0 = 1 */ - if(iy==0) return one; + if(iy==0) return one; /* +-NaN return x+y */ if(ix > 0x7f800000 || iy > 0x7f800000) - return x+y; + return x+y; /* determine if y is an odd int when x < 0 * yisint = 0 ... y is not an integer @@ -87,14 +87,14 @@ ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/ * yisint = 2 ... y is an even int */ yisint = 0; - if(hx<0) { + if(hx<0) { if(iy>=0x4b800000) yisint = 2; /* even integer y */ else if(iy>=0x3f800000) { k = (iy>>23)-0x7f; /* exponent */ j = iy>>(23-k); if((j<<(23-k))==iy) yisint = 2-(j&1); - } - } + } + } /* special value of y */ if (iy==0x7f800000) { /* y is +-inf */ @@ -104,14 +104,14 @@ ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/ return (hy>=0)? y: zero; else /* (|x|<1)**-,+inf = inf,0 */ return (hy<0)?-y: zero; - } + } if(iy==0x3f800000) { /* y is +-1 */ if(hy<0) return one/x; else return x; } if(hy==0x40000000) return x*x; /* y is 2 */ if(hy==0x3f000000) { /* y is 0.5 */ if(hx>=0) /* x >= +0 */ - return sqrtf(x); + return sqrtf(x); } ax = fabsf(x); @@ -122,12 +122,12 @@ ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/ if(hx<0) { if(((ix-0x3f800000)|yisint)==0) { z = (z-z)/(z-z); /* (-1)**non-int is NaN */ - } else if(yisint==1) + } else if(yisint==1) z = -z; /* (x<0)**odd = -(|x|**odd) */ } return z; } - + /* (x<0)**(non-int) is NaN */ if(((((u_int32_t)hx>>31)-1)|yisint)==0) return (x-x)/(x-x); @@ -136,7 +136,7 @@ ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/ /* over/underflow if x is not close to one */ if(ix<0x3f7ffff8) return (hy<0)? huge*huge:tiny*tiny; if(ix>0x3f800007) return (hy>0)? huge*huge:tiny*tiny; - /* now |1-x| is tiny <= 2**-20, suffice to compute + /* now |1-x| is tiny <= 2**-20, suffice to compute log(x) by x-x^2/2+x^3/3-x^4/4 */ t = x-1; /* t has 20 trailing zeros */ w = (t*t)*((float)0.5-t*((float)0.333333333333-t*(float)0.25)); @@ -233,7 +233,7 @@ ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/ n = ((n&0x007fffff)|0x00800000)>>(23-k); if(j<0) n = -n; p_h -= t; - } + } t = p_l+p_h; GET_FLOAT_WORD(is,t); SET_FLOAT_WORD(t,is&0xfffff000); diff --git a/lib/msun/src/e_rem_pio2.c b/lib/msun/src/e_rem_pio2.c index be7cd502f5fb..5b1c3bf26403 100644 --- a/lib/msun/src/e_rem_pio2.c +++ b/lib/msun/src/e_rem_pio2.c @@ -5,18 +5,18 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_rem_pio2.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $"; +static char rcsid[] = "$Id: e_rem_pio2.c,v 1.2 1995/04/07 23:23:24 bde Exp $"; #endif /* __ieee754_rem_pio2(x,y) - * - * return the remainder of x rem pi/2 in y[0]+y[1] + * + * return the remainder of x rem pi/2 in y[0]+y[1] * use __kernel_rem_pio2() */ @@ -24,24 +24,24 @@ static char rcsid[] = "$Id: e_rem_pio2.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $ #include "math_private.h" /* - * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi + * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi */ #ifdef __STDC__ static const int32_t two_over_pi[] = { #else static int32_t two_over_pi[] = { #endif -0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1, 0xF534DD, 0xC0DB62, -0x95993C, 0x439041, 0xFE5163, 0xABDEBB, 0xC561B7, 0x246E3A, -0x424DD2, 0xE00649, 0x2EEA09, 0xD1921C, 0xFE1DEB, 0x1CB129, -0xA73EE8, 0x8235F5, 0x2EBB44, 0x84E99C, 0x7026B4, 0x5F7E41, -0x3991D6, 0x398353, 0x39F49C, 0x845F8B, 0xBDF928, 0x3B1FF8, -0x97FFDE, 0x05980F, 0xEF2F11, 0x8B5A0A, 0x6D1F6D, 0x367ECF, -0x27CB09, 0xB74F46, 0x3F669E, 0x5FEA2D, 0x7527BA, 0xC7EBE5, -0xF17B3D, 0x0739F7, 0x8A5292, 0xEA6BFB, 0x5FB11F, 0x8D5D08, -0x560330, 0x46FC7B, 0x6BABF0, 0xCFBC20, 0x9AF436, 0x1DA9E3, -0x91615E, 0xE61B08, 0x659985, 0x5F14A0, 0x68408D, 0xFFD880, -0x4D7327, 0x310606, 0x1556CA, 0x73A8C9, 0x60E27B, 0xC08C6B, +0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1, 0xF534DD, 0xC0DB62, +0x95993C, 0x439041, 0xFE5163, 0xABDEBB, 0xC561B7, 0x246E3A, +0x424DD2, 0xE00649, 0x2EEA09, 0xD1921C, 0xFE1DEB, 0x1CB129, +0xA73EE8, 0x8235F5, 0x2EBB44, 0x84E99C, 0x7026B4, 0x5F7E41, +0x3991D6, 0x398353, 0x39F49C, 0x845F8B, 0xBDF928, 0x3B1FF8, +0x97FFDE, 0x05980F, 0xEF2F11, 0x8B5A0A, 0x6D1F6D, 0x367ECF, +0x27CB09, 0xB74F46, 0x3F669E, 0x5FEA2D, 0x7527BA, 0xC7EBE5, +0xF17B3D, 0x0739F7, 0x8A5292, 0xEA6BFB, 0x5FB11F, 0x8D5D08, +0x560330, 0x46FC7B, 0x6BABF0, 0xCFBC20, 0x9AF436, 0x1DA9E3, +0x91615E, 0xE61B08, 0x659985, 0x5F14A0, 0x68408D, 0xFFD880, +0x4D7327, 0x310606, 0x1556CA, 0x73A8C9, 0x60E27B, 0xC08C6B, }; #ifdef __STDC__ @@ -68,9 +68,9 @@ static int32_t npio2_hw[] = { */ #ifdef __STDC__ -static const double +static const double #else -static double +static double #endif zero = 0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */ half = 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */ @@ -100,7 +100,7 @@ pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */ if(ix<=0x3fe921fb) /* |x| ~<= pi/4 , no need for reduction */ {y[0] = x; y[1] = 0; return 0;} if(ix<0x4002d97c) { /* |x| < 3pi/4, special case with n=+-1 */ - if(hx>0) { + if(hx>0) { z = x - pio2_1; if(ix!=0x3ff921fb) { /* 33+53 bit pi is good enough */ y[0] = z - pio2_1t; @@ -130,27 +130,27 @@ pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */ fn = (double)n; r = t-fn*pio2_1; w = fn*pio2_1t; /* 1st round good to 85 bit */ - if(n<32&&ix!=npio2_hw[n-1]) { + if(n<32&&ix!=npio2_hw[n-1]) { y[0] = r-w; /* quick check no cancellation */ } else { u_int32_t high; j = ix>>20; - y[0] = r-w; + y[0] = r-w; GET_HIGH_WORD(high,y[0]); i = j-((high>>20)&0x7ff); if(i>16) { /* 2nd iteration needed, good to 118 */ t = r; - w = fn*pio2_2; + w = fn*pio2_2; r = t-w; - w = fn*pio2_2t-((t-r)-w); + w = fn*pio2_2t-((t-r)-w); y[0] = r-w; GET_HIGH_WORD(high,y[0]); i = j-((high>>20)&0x7ff); if(i>49) { /* 3rd iteration need, 151 bits acc */ t = r; /* will cover all possible cases */ - w = fn*pio2_3; + w = fn*pio2_3; r = t-w; - w = fn*pio2_3t-((t-r)-w); + w = fn*pio2_3t-((t-r)-w); y[0] = r-w; } } @@ -159,7 +159,7 @@ pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */ if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;} else return n; } - /* + /* * all other (large) arguments */ if(ix>=0x7ff00000) { /* x is inf or NaN */ diff --git a/lib/msun/src/e_rem_pio2f.c b/lib/msun/src/e_rem_pio2f.c index 153a8c406db2..98c305fd9f13 100644 --- a/lib/msun/src/e_rem_pio2f.c +++ b/lib/msun/src/e_rem_pio2f.c @@ -8,18 +8,18 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_rem_pio2f.c,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $"; +static char rcsid[] = "$Id: e_rem_pio2f.c,v 1.2 1995/04/07 23:23:25 bde Exp $"; #endif /* __ieee754_rem_pio2f(x,y) - * - * return the remainder of x rem pi/2 in y[0]+y[1] + * + * return the remainder of x rem pi/2 in y[0]+y[1] * use __kernel_rem_pio2f() */ @@ -27,7 +27,7 @@ static char rcsid[] = "$Id: e_rem_pio2f.c,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp #include "math_private.h" /* - * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi + * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi */ #ifdef __STDC__ static const int32_t two_over_pi[] = { @@ -35,27 +35,27 @@ static const int32_t two_over_pi[] = { static int32_t two_over_pi[] = { #endif 0xA2, 0xF9, 0x83, 0x6E, 0x4E, 0x44, 0x15, 0x29, 0xFC, -0x27, 0x57, 0xD1, 0xF5, 0x34, 0xDD, 0xC0, 0xDB, 0x62, +0x27, 0x57, 0xD1, 0xF5, 0x34, 0xDD, 0xC0, 0xDB, 0x62, 0x95, 0x99, 0x3C, 0x43, 0x90, 0x41, 0xFE, 0x51, 0x63, -0xAB, 0xDE, 0xBB, 0xC5, 0x61, 0xB7, 0x24, 0x6E, 0x3A, +0xAB, 0xDE, 0xBB, 0xC5, 0x61, 0xB7, 0x24, 0x6E, 0x3A, 0x42, 0x4D, 0xD2, 0xE0, 0x06, 0x49, 0x2E, 0xEA, 0x09, -0xD1, 0x92, 0x1C, 0xFE, 0x1D, 0xEB, 0x1C, 0xB1, 0x29, +0xD1, 0x92, 0x1C, 0xFE, 0x1D, 0xEB, 0x1C, 0xB1, 0x29, 0xA7, 0x3E, 0xE8, 0x82, 0x35, 0xF5, 0x2E, 0xBB, 0x44, -0x84, 0xE9, 0x9C, 0x70, 0x26, 0xB4, 0x5F, 0x7E, 0x41, +0x84, 0xE9, 0x9C, 0x70, 0x26, 0xB4, 0x5F, 0x7E, 0x41, 0x39, 0x91, 0xD6, 0x39, 0x83, 0x53, 0x39, 0xF4, 0x9C, -0x84, 0x5F, 0x8B, 0xBD, 0xF9, 0x28, 0x3B, 0x1F, 0xF8, +0x84, 0x5F, 0x8B, 0xBD, 0xF9, 0x28, 0x3B, 0x1F, 0xF8, 0x97, 0xFF, 0xDE, 0x05, 0x98, 0x0F, 0xEF, 0x2F, 0x11, -0x8B, 0x5A, 0x0A, 0x6D, 0x1F, 0x6D, 0x36, 0x7E, 0xCF, +0x8B, 0x5A, 0x0A, 0x6D, 0x1F, 0x6D, 0x36, 0x7E, 0xCF, 0x27, 0xCB, 0x09, 0xB7, 0x4F, 0x46, 0x3F, 0x66, 0x9E, -0x5F, 0xEA, 0x2D, 0x75, 0x27, 0xBA, 0xC7, 0xEB, 0xE5, +0x5F, 0xEA, 0x2D, 0x75, 0x27, 0xBA, 0xC7, 0xEB, 0xE5, 0xF1, 0x7B, 0x3D, 0x07, 0x39, 0xF7, 0x8A, 0x52, 0x92, -0xEA, 0x6B, 0xFB, 0x5F, 0xB1, 0x1F, 0x8D, 0x5D, 0x08, +0xEA, 0x6B, 0xFB, 0x5F, 0xB1, 0x1F, 0x8D, 0x5D, 0x08, 0x56, 0x03, 0x30, 0x46, 0xFC, 0x7B, 0x6B, 0xAB, 0xF0, -0xCF, 0xBC, 0x20, 0x9A, 0xF4, 0x36, 0x1D, 0xA9, 0xE3, +0xCF, 0xBC, 0x20, 0x9A, 0xF4, 0x36, 0x1D, 0xA9, 0xE3, 0x91, 0x61, 0x5E, 0xE6, 0x1B, 0x08, 0x65, 0x99, 0x85, -0x5F, 0x14, 0xA0, 0x68, 0x40, 0x8D, 0xFF, 0xD8, 0x80, +0x5F, 0x14, 0xA0, 0x68, 0x40, 0x8D, 0xFF, 0xD8, 0x80, 0x4D, 0x73, 0x27, 0x31, 0x06, 0x06, 0x15, 0x56, 0xCA, -0x73, 0xA8, 0xC9, 0x60, 0xE2, 0x7B, 0xC0, 0x8C, 0x6B, +0x73, 0xA8, 0xC9, 0x60, 0xE2, 0x7B, 0xC0, 0x8C, 0x6B, }; /* This array is like the one in e_rem_pio2.c, but the numbers are @@ -84,9 +84,9 @@ static int32_t npio2_hw[] = { */ #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif zero = 0.0000000000e+00, /* 0x00000000 */ half = 5.0000000000e-01, /* 0x3f000000 */ @@ -115,7 +115,7 @@ pio2_3t = 6.1232342629e-17; /* 0x248d3132 */ if(ix<=0x3f490fd8) /* |x| ~<= pi/4 , no need for reduction */ {y[0] = x; y[1] = 0; return 0;} if(ix<0x4016cbe4) { /* |x| < 3pi/4, special case with n=+-1 */ - if(hx>0) { + if(hx>0) { z = x - pio2_1; if((ix&0xfffffff0)!=0x3fc90fd0) { /* 24+24 bit pi OK */ y[0] = z - pio2_1t; @@ -145,27 +145,27 @@ pio2_3t = 6.1232342629e-17; /* 0x248d3132 */ fn = (float)n; r = t-fn*pio2_1; w = fn*pio2_1t; /* 1st round good to 40 bit */ - if(n<32&&(ix&0xffffff00)!=npio2_hw[n-1]) { + if(n<32&&(ix&0xffffff00)!=npio2_hw[n-1]) { y[0] = r-w; /* quick check no cancellation */ } else { u_int32_t high; j = ix>>23; - y[0] = r-w; + y[0] = r-w; GET_FLOAT_WORD(high,y[0]); i = j-((high>>23)&0xff); if(i>8) { /* 2nd iteration needed, good to 57 */ t = r; - w = fn*pio2_2; + w = fn*pio2_2; r = t-w; - w = fn*pio2_2t-((t-r)-w); + w = fn*pio2_2t-((t-r)-w); y[0] = r-w; GET_FLOAT_WORD(high,y[0]); i = j-((high>>23)&0xff); if(i>25) { /* 3rd iteration need, 74 bits acc */ t = r; /* will cover all possible cases */ - w = fn*pio2_3; + w = fn*pio2_3; r = t-w; - w = fn*pio2_3t-((t-r)-w); + w = fn*pio2_3t-((t-r)-w); y[0] = r-w; } } @@ -174,7 +174,7 @@ pio2_3t = 6.1232342629e-17; /* 0x248d3132 */ if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;} else return n; } - /* + /* * all other (large) arguments */ if(ix>=0x7f800000) { /* x is inf or NaN */ diff --git a/lib/msun/src/e_remainder.c b/lib/msun/src/e_remainder.c index cf82a49f3a5f..430418d2ea2f 100644 --- a/lib/msun/src/e_remainder.c +++ b/lib/msun/src/e_remainder.c @@ -5,21 +5,21 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_remainder.c,v 1.6 1994/08/18 23:06:00 jtc Exp $"; +static char rcsid[] = "$Id: e_remainder.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $"; #endif /* __ieee754_remainder(x,p) - * Return : - * returns x REM p = x - [x/p]*p as if in infinite - * precise arithmetic, where [x/p] is the (infinite bit) + * Return : + * returns x REM p = x - [x/p]*p as if in infinite + * precise arithmetic, where [x/p] is the (infinite bit) * integer nearest x/p (in half way case choose the even one). - * Method : + * Method : * Based on fmod() return x-[x/p]chopped*p exactlp. */ diff --git a/lib/msun/src/e_remainderf.c b/lib/msun/src/e_remainderf.c index 966b2165a7b3..cc66ba454aec 100644 --- a/lib/msun/src/e_remainderf.c +++ b/lib/msun/src/e_remainderf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_remainderf.c,v 1.2 1994/08/18 23:06:02 jtc Exp $"; +static char rcsid[] = "$Id: e_remainderf.c,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $"; #endif #include "math.h" diff --git a/lib/msun/src/e_scalb.c b/lib/msun/src/e_scalb.c index 32a2703d2ce0..1000bc7e1de0 100644 --- a/lib/msun/src/e_scalb.c +++ b/lib/msun/src/e_scalb.c @@ -5,18 +5,18 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_scalb.c,v 1.4 1994/08/10 20:31:26 jtc Exp $"; +static char rcsid[] = "$Id: e_scalb.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $"; #endif /* * __ieee754_scalb(x, fn) is provide for - * passing various standard test suite. One + * passing various standard test suite. One * should use scalbn() instead. */ diff --git a/lib/msun/src/e_scalbf.c b/lib/msun/src/e_scalbf.c index 6906c24d8359..0dff855c37c2 100644 --- a/lib/msun/src/e_scalbf.c +++ b/lib/msun/src/e_scalbf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_scalbf.c,v 1.1 1994/08/10 20:31:27 jtc Exp $"; +static char rcsid[] = "$Id: e_scalbf.c,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $"; #endif #include "math.h" diff --git a/lib/msun/src/e_sinh.c b/lib/msun/src/e_sinh.c index f39019c06297..9f68f4365d0b 100644 --- a/lib/msun/src/e_sinh.c +++ b/lib/msun/src/e_sinh.c @@ -5,25 +5,25 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_sinh.c,v 1.5 1994/08/18 23:06:03 jtc Exp $"; +static char rcsid[] = "$Id: e_sinh.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $"; #endif /* __ieee754_sinh(x) - * Method : + * Method : * mathematically sinh(x) if defined to be (exp(x)-exp(-x))/2 - * 1. Replace x by |x| (sinh(-x) = -sinh(x)). - * 2. + * 1. Replace x by |x| (sinh(-x) = -sinh(x)). + * 2. * E + E/(E+1) * 0 <= x <= 22 : sinh(x) := --------------, E=expm1(x) * 2 * - * 22 <= x <= lnovft : sinh(x) := exp(x)/2 + * 22 <= x <= lnovft : sinh(x) := exp(x)/2 * lnovft <= x <= ln2ovft: sinh(x) := exp(x/2)/2 * exp(x/2) * ln2ovft < x : sinh(x) := x*shuge (overflow) * @@ -47,7 +47,7 @@ static double one = 1.0, shuge = 1.0e307; double __ieee754_sinh(x) double x; #endif -{ +{ double t,w,h; int32_t ix,jx; u_int32_t lx; @@ -57,7 +57,7 @@ static double one = 1.0, shuge = 1.0e307; ix = jx&0x7fffffff; /* x is INF or NaN */ - if(ix>=0x7ff00000) return x+x; + if(ix>=0x7ff00000) return x+x; h = 0.5; if (jx<0) h = -h; diff --git a/lib/msun/src/e_sinhf.c b/lib/msun/src/e_sinhf.c index 5c064403373e..9c6e45bed155 100644 --- a/lib/msun/src/e_sinhf.c +++ b/lib/msun/src/e_sinhf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_sinhf.c,v 1.2 1994/08/18 23:06:04 jtc Exp $"; +static char rcsid[] = "$Id: e_sinhf.c,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $"; #endif #include "math.h" @@ -32,7 +32,7 @@ static float one = 1.0, shuge = 1.0e37; float __ieee754_sinhf(x) float x; #endif -{ +{ float t,w,h; int32_t ix,jx; @@ -40,7 +40,7 @@ static float one = 1.0, shuge = 1.0e37; ix = jx&0x7fffffff; /* x is INF or NaN */ - if(ix>=0x7f800000) return x+x; + if(ix>=0x7f800000) return x+x; h = 0.5; if (jx<0) h = -h; diff --git a/lib/msun/src/e_sqrt.c b/lib/msun/src/e_sqrt.c index 257f498ba746..d805e33ab867 100644 --- a/lib/msun/src/e_sqrt.c +++ b/lib/msun/src/e_sqrt.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_sqrt.c,v 1.6 1994/08/18 23:06:06 jtc Exp $"; +static char rcsid[] = "$Id: e_sqrt.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $"; #endif /* __ieee754_sqrt(x) @@ -19,10 +19,10 @@ static char rcsid[] = "$Id: e_sqrt.c,v 1.6 1994/08/18 23:06:06 jtc Exp $"; * ------------------------------------------ * | Use the hardware sqrt if you have one | * ------------------------------------------ - * Method: - * Bit by bit method using integer arithmetic. (Slow, but portable) + * Method: + * Bit by bit method using integer arithmetic. (Slow, but portable) * 1. Normalization - * Scale x to y in [1,4) with even powers of 2: + * Scale x to y in [1,4) with even powers of 2: * find an integer k such that 1 <= (y=x*2^(2k)) < 4, then * sqrt(x) = 2^k * sqrt(y) * 2. Bit by bit computation @@ -31,9 +31,9 @@ static char rcsid[] = "$Id: e_sqrt.c,v 1.6 1994/08/18 23:06:06 jtc Exp $"; * i+1 2 * s = 2*q , and y = 2 * ( y - q ). (1) * i i i i - * - * To compute q from q , one checks whether - * i+1 i + * + * To compute q from q , one checks whether + * i+1 i * * -(i+1) 2 * (q + 2 ) <= y. (2) @@ -43,12 +43,12 @@ static char rcsid[] = "$Id: e_sqrt.c,v 1.6 1994/08/18 23:06:06 jtc Exp $"; * i+1 i i+1 i * * With some algebric manipulation, it is not difficult to see - * that (2) is equivalent to + * that (2) is equivalent to * -(i+1) * s + 2 <= y (3) * i i * - * The advantage of (3) is that s and y can be computed by + * The advantage of (3) is that s and y can be computed by * i i * the following recurrence formula: * if (3) is false @@ -60,10 +60,10 @@ static char rcsid[] = "$Id: e_sqrt.c,v 1.6 1994/08/18 23:06:06 jtc Exp $"; * -i -(i+1) * s = s + 2 , y = y - s - 2 (5) * i+1 i i+1 i i - * - * One may easily use induction to prove (4) and (5). + * + * One may easily use induction to prove (4) and (5). * Note. Since the left hand side of (3) contain only i+2 bits, - * it does not necessary to do a full (53-bit) comparison + * it does not necessary to do a full (53-bit) comparison * in (3). * 3. Final rounding * After generating the 53 bits result, we compute one more bit. @@ -73,7 +73,7 @@ static char rcsid[] = "$Id: e_sqrt.c,v 1.6 1994/08/18 23:06:06 jtc Exp $"; * The rounding mode can be detected by checking whether * huge + tiny is equal to huge, and whether huge - tiny is * equal to huge for some floating point number "huge" and "tiny". - * + * * Special cases: * sqrt(+-0) = +-0 ... exact * sqrt(inf) = inf @@ -101,17 +101,17 @@ static double one = 1.0, tiny=1.0e-300; #endif { double z; - int32_t sign = (int)0x80000000; + int32_t sign = (int)0x80000000; int32_t ix0,s0,q,m,t,i; u_int32_t r,t1,s1,ix1,q1; EXTRACT_WORDS(ix0,ix1,x); /* take care of Inf and NaN */ - if((ix0&0x7ff00000)==0x7ff00000) { + if((ix0&0x7ff00000)==0x7ff00000) { return x*x+x; /* sqrt(NaN)=NaN, sqrt(+inf)=+inf sqrt(-inf)=sNaN */ - } + } /* take care of zero */ if(ix0<=0) { if(((ix0&(~sign))|ix1)==0) return x;/* sqrt(+-0) = +-0 */ @@ -145,12 +145,12 @@ static double one = 1.0, tiny=1.0e-300; r = 0x00200000; /* r = moving bit from right to left */ while(r!=0) { - t = s0+r; - if(t<=ix0) { - s0 = t+r; - ix0 -= t; - q += r; - } + t = s0+r; + if(t<=ix0) { + s0 = t+r; + ix0 -= t; + q += r; + } ix0 += ix0 + ((ix1&sign)>>31); ix1 += ix1; r>>=1; @@ -158,9 +158,9 @@ static double one = 1.0, tiny=1.0e-300; r = sign; while(r!=0) { - t1 = s1+r; + t1 = s1+r; t = s0; - if((t<ix0)||((t==ix0)&&(t1<=ix1))) { + if((t<ix0)||((t==ix0)&&(t1<=ix1))) { s1 = t1+r; if(((t1&sign)==sign)&&(s1&sign)==0) s0 += 1; ix0 -= t; @@ -181,7 +181,7 @@ static double one = 1.0, tiny=1.0e-300; if (q1==(u_int32_t)0xffffffff) { q1=0; q += 1;} else if (z>one) { if (q1==(u_int32_t)0xfffffffe) q+=1; - q1+=2; + q1+=2; } else q1 += (q1&1); } @@ -197,18 +197,18 @@ static double one = 1.0, tiny=1.0e-300; /* Other methods (use floating-point arithmetic) ------------- -(This is a copy of a drafted paper by Prof W. Kahan +(This is a copy of a drafted paper by Prof W. Kahan and K.C. Ng, written in May, 1986) - Two algorithms are given here to implement sqrt(x) + Two algorithms are given here to implement sqrt(x) (IEEE double precision arithmetic) in software. Both supply sqrt(x) correctly rounded. The first algorithm (in Section A) uses newton iterations and involves four divisions. The second one uses reciproot iterations to avoid division, but requires more multiplications. Both algorithms need the ability - to chop results of arithmetic operations instead of round them, + to chop results of arithmetic operations instead of round them, and the INEXACT flag to indicate when an arithmetic operation - is executed exactly with no roundoff error, all part of the + is executed exactly with no roundoff error, all part of the standard (IEEE 754-1985). The ability to perform shift, add, subtract and logical AND operations upon 32-bit words is needed too, though not part of the standard. @@ -218,7 +218,7 @@ A. sqrt(x) by Newton Iteration (1) Initial approximation Let x0 and x1 be the leading and the trailing 32-bit words of - a floating point number x (in IEEE double format) respectively + a floating point number x (in IEEE double format) respectively 1 11 52 ...widths ------------------------------------------------------ @@ -226,7 +226,7 @@ A. sqrt(x) by Newton Iteration ------------------------------------------------------ msb lsb msb lsb ...order - + ------------------------ ------------------------ x0: |s| e | f1 | x1: | f2 | ------------------------ ------------------------ @@ -251,7 +251,7 @@ A. sqrt(x) by Newton Iteration (2) Iterative refinement - Apply Heron's rule three times to y, we have y approximates + Apply Heron's rule three times to y, we have y approximates sqrt(x) to within 1 ulp (Unit in the Last Place): y := (y+x/y)/2 ... almost 17 sig. bits @@ -276,12 +276,12 @@ A. sqrt(x) by Newton Iteration it requires more multiplications and additions. Also x must be scaled in advance to avoid spurious overflow in evaluating the expression 3y*y+x. Hence it is not recommended uless division - is slow. If division is very slow, then one should use the + is slow. If division is very slow, then one should use the reciproot algorithm given in section B. (3) Final adjustment - By twiddling y's last bit it is possible to force y to be + By twiddling y's last bit it is possible to force y to be correctly rounded according to the prevailing rounding mode as follows. Let r and i be copies of the rounding mode and inexact flag before entering the square root program. Also we @@ -312,7 +312,7 @@ A. sqrt(x) by Newton Iteration I := i; ... restore inexact flag R := r; ... restore rounded mode return sqrt(x):=y. - + (4) Special cases Square root of +inf, +-0, or NaN is itself; @@ -331,7 +331,7 @@ B. sqrt(x) by Reciproot Iteration k := 0x5fe80000 - (x0>>1); y0:= k - T2[63&(k>>14)]. ... y ~ 1/sqrt(x) to 7.8 bits - Here k is a 32-bit integer and T2[] is an integer array + Here k is a 32-bit integer and T2[] is an integer array containing correction terms. Now magically the floating value of y (y's leading 32-bit word is y0, the value of its trailing word y1 is set to zero) approximates 1/sqrt(x) @@ -352,9 +352,9 @@ B. sqrt(x) by Reciproot Iteration Apply Reciproot iteration three times to y and multiply the result by x to get an approximation z that matches sqrt(x) - to about 1 ulp. To be exact, we will have + to about 1 ulp. To be exact, we will have -1ulp < sqrt(x)-z<1.0625ulp. - + ... set rounding mode to Round-to-nearest y := y*(1.5-0.5*x*y*y) ... almost 15 sig. bits to 1/sqrt(x) y := y*((1.5-2^-30)+0.5*x*y*y)... about 29 sig. bits to 1/sqrt(x) @@ -363,14 +363,14 @@ B. sqrt(x) by Reciproot Iteration z := z + 0.5*z*(1-z*y) ... about 1 ulp to sqrt(x) Remark 2. The constant 1.5-2^-30 is chosen to bias the error so that - (a) the term z*y in the final iteration is always less than 1; + (a) the term z*y in the final iteration is always less than 1; (b) the error in the final result is biased upward so that -1 ulp < sqrt(x) - z < 1.0625 ulp instead of |sqrt(x)-z|<1.03125ulp. (3) Final adjustment - By twiddling y's last bit it is possible to force y to be + By twiddling y's last bit it is possible to force y to be correctly rounded according to the prevailing rounding mode as follows. Let r and i be copies of the rounding mode and inexact flag before entering the square root program. Also we @@ -410,27 +410,27 @@ B. sqrt(x) by Reciproot Iteration I := 1; ... Raise Inexact flag: z is not exact else { j := 1 - [(x0>>20)&1] ... j = logb(x) mod 2 - k := z1 >> 26; ... get z's 25-th and 26-th + k := z1 >> 26; ... get z's 25-th and 26-th fraction bits I := i or (k&j) or ((k&(j+j+1))!=(x1&3)); } R:= r ... restore rounded mode return sqrt(x):=z. - If multiplication is cheaper then the foregoing red tape, the + If multiplication is cheaper then the foregoing red tape, the Inexact flag can be evaluated by I := i; I := (z*z!=x) or I. - Note that z*z can overwrite I; this value must be sensed if it is + Note that z*z can overwrite I; this value must be sensed if it is True. Remark 4. If z*z = x exactly, then bit 25 to bit 0 of z1 must be zero. -------------------- - z1: | f2 | + z1: | f2 | -------------------- bit 31 bit 0 @@ -447,7 +447,7 @@ B. sqrt(x) by Reciproot Iteration 11 01 even ------------------------------------------------- - (4) Special cases (see (4) of Section A). - + (4) Special cases (see (4) of Section A). + */ - + diff --git a/lib/msun/src/e_sqrtf.c b/lib/msun/src/e_sqrtf.c index 28a9428fe6d0..a4cb172e1bdc 100644 --- a/lib/msun/src/e_sqrtf.c +++ b/lib/msun/src/e_sqrtf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: e_sqrtf.c,v 1.2 1994/08/18 23:06:07 jtc Exp $"; +static char rcsid[] = "$Id: e_sqrtf.c,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $"; #endif #include "math.h" @@ -34,17 +34,17 @@ static float one = 1.0, tiny=1.0e-30; #endif { float z; - int32_t sign = (int)0x80000000; + int32_t sign = (int)0x80000000; int32_t ix,s,q,m,t,i; u_int32_t r; GET_FLOAT_WORD(ix,x); /* take care of Inf and NaN */ - if((ix&0x7f800000)==0x7f800000) { + if((ix&0x7f800000)==0x7f800000) { return x*x+x; /* sqrt(NaN)=NaN, sqrt(+inf)=+inf sqrt(-inf)=sNaN */ - } + } /* take care of zero */ if(ix<=0) { if((ix&(~sign))==0) return x;/* sqrt(+-0) = +-0 */ @@ -69,12 +69,12 @@ static float one = 1.0, tiny=1.0e-30; r = 0x01000000; /* r = moving bit from right to left */ while(r!=0) { - t = s+r; - if(t<=ix) { - s = t+r; - ix -= t; - q += r; - } + t = s+r; + if(t<=ix) { + s = t+r; + ix -= t; + q += r; + } ix += ix; r>>=1; } diff --git a/lib/msun/src/k_cos.c b/lib/msun/src/k_cos.c index 12600116e9da..57ebe6219613 100644 --- a/lib/msun/src/k_cos.c +++ b/lib/msun/src/k_cos.c @@ -5,20 +5,20 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: k_cos.c,v 1.6 1994/08/18 23:06:08 jtc Exp $"; +static char rcsid[] = "$Id: k_cos.c,v 1.1.1.1 1994/08/19 09:39:44 jkh Exp $"; #endif /* * __kernel_cos( x, y ) * kernel cos function on [-pi/4, pi/4], pi/4 ~ 0.785398164 * Input x is assumed to be bounded by ~pi/4 in magnitude. - * Input y is the tail of x. + * Input y is the tail of x. * * Algorithm * 1. Since cos(-x) = cos(x), we need only to consider positive x. @@ -28,15 +28,15 @@ static char rcsid[] = "$Id: k_cos.c,v 1.6 1994/08/18 23:06:08 jtc Exp $"; * 4 14 * cos(x) ~ 1 - x*x/2 + C1*x + ... + C6*x * where the remez error is - * + * * | 2 4 6 8 10 12 14 | -58 * |cos(x)-(1-.5*x +C1*x +C2*x +C3*x +C4*x +C5*x +C6*x )| <= 2 - * | | - * - * 4 6 8 10 12 14 + * | | + * + * 4 6 8 10 12 14 * 4. let r = C1*x +C2*x +C3*x +C4*x +C5*x +C6*x , then * cos(x) = 1 - x*x/2 + r - * since cos(x+y) ~ cos(x) - sin(x)*y + * since cos(x+y) ~ cos(x) - sin(x)*y * ~ cos(x) - x*y, * a correction term is necessary in cos(x) and hence * cos(x+y) = 1 - (x*x/2 - (r - x*y)) @@ -53,9 +53,9 @@ static char rcsid[] = "$Id: k_cos.c,v 1.6 1994/08/18 23:06:08 jtc Exp $"; #include "math_private.h" #ifdef __STDC__ -static const double +static const double #else -static double +static double #endif one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ C1 = 4.16666666666666019037e-02, /* 0x3FA55555, 0x5555554C */ @@ -81,7 +81,7 @@ C6 = -1.13596475577881948265e-11; /* 0xBDA8FAE9, 0xBE8838D4 */ } z = x*x; r = z*(C1+z*(C2+z*(C3+z*(C4+z*(C5+z*C6))))); - if(ix < 0x3FD33333) /* if |x| < 0.3 */ + if(ix < 0x3FD33333) /* if |x| < 0.3 */ return one - (0.5*z - (z*r - x*y)); else { if(ix > 0x3fe90000) { /* x > 0.78125 */ diff --git a/lib/msun/src/k_cosf.c b/lib/msun/src/k_cosf.c index 9a2b83b922d9..09e2ff72cc2e 100644 --- a/lib/msun/src/k_cosf.c +++ b/lib/msun/src/k_cosf.c @@ -8,22 +8,22 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: k_cosf.c,v 1.2 1994/08/18 23:06:10 jtc Exp $"; +static char rcsid[] = "$Id: k_cosf.c,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $"; #endif #include "math.h" #include "math_private.h" #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif one = 1.0000000000e+00, /* 0x3f800000 */ C1 = 4.1666667908e-02, /* 0x3d2aaaab */ @@ -49,7 +49,7 @@ C6 = -1.1359647598e-11; /* 0xad47d74e */ } z = x*x; r = z*(C1+z*(C2+z*(C3+z*(C4+z*(C5+z*C6))))); - if(ix < 0x3e99999a) /* if |x| < 0.3 */ + if(ix < 0x3e99999a) /* if |x| < 0.3 */ return one - ((float)0.5*z - (z*r - x*y)); else { if(ix > 0x3f480000) { /* x > 0.78125 */ diff --git a/lib/msun/src/k_rem_pio2.c b/lib/msun/src/k_rem_pio2.c index b4611fe2230e..25faf35f40ea 100644 --- a/lib/msun/src/k_rem_pio2.c +++ b/lib/msun/src/k_rem_pio2.c @@ -5,24 +5,24 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: k_rem_pio2.c,v 1.5 1994/08/18 23:06:11 jtc Exp $"; +static char rcsid[] = "$Id: k_rem_pio2.c,v 1.1.1.1 1994/08/19 09:39:45 jkh Exp $"; #endif /* * __kernel_rem_pio2(x,y,e0,nx,prec,ipio2) * double x[],y[]; int e0,nx,prec; int ipio2[]; - * - * __kernel_rem_pio2 return the last three digits of N with + * + * __kernel_rem_pio2 return the last three digits of N with * y = x - N*pi/2 * so that |y| < pi/2. * - * The method is to compute the integer (mod 8) and fraction parts of + * The method is to compute the integer (mod 8) and fraction parts of * (2/pi)*x without doing the full multiplication. In general we * skip the part of the product that are known to be a huge integer ( * more accurately, = 0 mod 8 ). Thus the number of operations are @@ -31,10 +31,10 @@ static char rcsid[] = "$Id: k_rem_pio2.c,v 1.5 1994/08/18 23:06:11 jtc Exp $"; * (2/pi) is represented by an array of 24-bit integers in ipio2[]. * * Input parameters: - * x[] The input value (must be positive) is broken into nx + * x[] The input value (must be positive) is broken into nx * pieces of 24-bit integers in double precision format. - * x[i] will be the i-th 24 bit of x. The scaled exponent - * of x[0] is given in input parameter e0 (i.e., x[0]*2^e0 + * x[i] will be the i-th 24 bit of x. The scaled exponent + * of x[0] is given in input parameter e0 (i.e., x[0]*2^e0 * match x's up to 24 bits. * * Example of breaking a double positive z into x[0]+x[1]+x[2]: @@ -71,8 +71,8 @@ static char rcsid[] = "$Id: k_rem_pio2.c,v 1.5 1994/08/18 23:06:11 jtc Exp $"; * 3 113 bits (quad) * * ipio2[] - * integer array, contains the (24*i)-th to (24*i+23)-th - * bit of 2/pi after binary point. The corresponding + * integer array, contains the (24*i)-th to (24*i+23)-th + * bit of 2/pi after binary point. The corresponding * floating value is * * ipio2[i] * 2^(-24(i+1)). @@ -87,8 +87,8 @@ static char rcsid[] = "$Id: k_rem_pio2.c,v 1.5 1994/08/18 23:06:11 jtc Exp $"; * in the computation. The recommended value is 2,3,4, * 6 for single, double, extended,and quad. * - * jz local integer variable indicating the number of - * terms of ipio2[] used. + * jz local integer variable indicating the number of + * terms of ipio2[] used. * * jx nx - 1 * @@ -108,9 +108,9 @@ static char rcsid[] = "$Id: k_rem_pio2.c,v 1.5 1994/08/18 23:06:11 jtc Exp $"; * exponent for q[i] would be q0-24*i. * * PIo2[] double precision array, obtained by cutting pi/2 - * into 24 bits chunks. + * into 24 bits chunks. * - * f[] ipio2[] in floating point + * f[] ipio2[] in floating point * * iq[] integer array by breaking up q[] in 24-bits chunk. * @@ -124,9 +124,9 @@ static char rcsid[] = "$Id: k_rem_pio2.c,v 1.5 1994/08/18 23:06:11 jtc Exp $"; /* * Constants: - * The hexadecimal values are the intended ones for the following - * constants. The decimal values may be used, provided that the - * compiler will convert from decimal to binary accurately enough + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough * to produce the hexadecimal values shown. */ @@ -136,7 +136,7 @@ static char rcsid[] = "$Id: k_rem_pio2.c,v 1.5 1994/08/18 23:06:11 jtc Exp $"; #ifdef __STDC__ static const int init_jk[] = {2,3,4,6}; /* initial value for jk */ #else -static int init_jk[] = {2,3,4,6}; +static int init_jk[] = {2,3,4,6}; #endif #ifdef __STDC__ @@ -155,9 +155,9 @@ static double PIo2[] = { }; #ifdef __STDC__ -static const double +static const double #else -static double +static double #endif zero = 0.0, one = 1.0, @@ -165,9 +165,9 @@ two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */ twon24 = 5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */ #ifdef __STDC__ - int __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, const int32_t *ipio2) + int __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, const int32_t *ipio2) #else - int __kernel_rem_pio2(x,y,e0,nx,prec,ipio2) + int __kernel_rem_pio2(x,y,e0,nx,prec,ipio2) double x[], y[]; int e0,nx,prec; int32_t ipio2[]; #endif { @@ -211,7 +211,7 @@ recompute: i = (iq[jz-1]>>(24-q0)); n += i; iq[jz-1] -= i<<(24-q0); ih = iq[jz-1]>>(23-q0); - } + } else if(q0==0) ih = iq[jz-1]>>23; else if(z>=0.5) ih=2; @@ -262,7 +262,7 @@ recompute: while(iq[jz]==0) { jz--; q0-=24;} } else { /* break z into 24-bit if necessary */ z = scalbn(z,-q0); - if(z>=two24) { + if(z>=two24) { fw = (double)((int32_t)(twon24*z)); iq[jz] = (int32_t)(z-two24*fw); jz += 1; q0 += 24; @@ -287,29 +287,29 @@ recompute: case 0: fw = 0.0; for (i=jz;i>=0;i--) fw += fq[i]; - y[0] = (ih==0)? fw: -fw; + y[0] = (ih==0)? fw: -fw; break; case 1: case 2: fw = 0.0; - for (i=jz;i>=0;i--) fw += fq[i]; - y[0] = (ih==0)? fw: -fw; + for (i=jz;i>=0;i--) fw += fq[i]; + y[0] = (ih==0)? fw: -fw; fw = fq[0]-fw; for (i=1;i<=jz;i++) fw += fq[i]; - y[1] = (ih==0)? fw: -fw; + y[1] = (ih==0)? fw: -fw; break; case 3: /* painful */ for (i=jz;i>0;i--) { - fw = fq[i-1]+fq[i]; + fw = fq[i-1]+fq[i]; fq[i] += fq[i-1]-fw; fq[i-1] = fw; } for (i=jz;i>1;i--) { - fw = fq[i-1]+fq[i]; + fw = fq[i-1]+fq[i]; fq[i] += fq[i-1]-fw; fq[i-1] = fw; } - for (fw=0.0,i=jz;i>=2;i--) fw += fq[i]; + for (fw=0.0,i=jz;i>=2;i--) fw += fq[i]; if(ih==0) { y[0] = fq[0]; y[1] = fq[1]; y[2] = fw; } else { diff --git a/lib/msun/src/k_rem_pio2f.c b/lib/msun/src/k_rem_pio2f.c index c243a56a590b..10615386eb81 100644 --- a/lib/msun/src/k_rem_pio2f.c +++ b/lib/msun/src/k_rem_pio2f.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: k_rem_pio2f.c,v 1.2 1994/08/18 23:06:12 jtc Exp $"; +static char rcsid[] = "$Id: k_rem_pio2f.c,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $"; #endif #include "math.h" @@ -26,7 +26,7 @@ static char rcsid[] = "$Id: k_rem_pio2f.c,v 1.2 1994/08/18 23:06:12 jtc Exp $"; #ifdef __STDC__ static const int init_jk[] = {4,7,9}; /* initial value for jk */ #else -static int init_jk[] = {4,7,9}; +static int init_jk[] = {4,7,9}; #endif #ifdef __STDC__ @@ -48,9 +48,9 @@ static float PIo2[] = { }; #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif zero = 0.0, one = 1.0, @@ -58,9 +58,9 @@ two8 = 2.5600000000e+02, /* 0x43800000 */ twon8 = 3.9062500000e-03; /* 0x3b800000 */ #ifdef __STDC__ - int __kernel_rem_pio2f(float *x, float *y, int e0, int nx, int prec, const int32_t *ipio2) + int __kernel_rem_pio2f(float *x, float *y, int e0, int nx, int prec, const int32_t *ipio2) #else - int __kernel_rem_pio2f(x,y,e0,nx,prec,ipio2) + int __kernel_rem_pio2f(x,y,e0,nx,prec,ipio2) float x[], y[]; int e0,nx,prec; int32_t ipio2[]; #endif { @@ -104,7 +104,7 @@ recompute: i = (iq[jz-1]>>(8-q0)); n += i; iq[jz-1] -= i<<(8-q0); ih = iq[jz-1]>>(7-q0); - } + } else if(q0==0) ih = iq[jz-1]>>8; else if(z>=(float)0.5) ih=2; @@ -155,7 +155,7 @@ recompute: while(iq[jz]==0) { jz--; q0-=8;} } else { /* break z into 8-bit if necessary */ z = scalbnf(z,-q0); - if(z>=two8) { + if(z>=two8) { fw = (float)((int32_t)(twon8*z)); iq[jz] = (int32_t)(z-two8*fw); jz += 1; q0 += 8; @@ -180,29 +180,29 @@ recompute: case 0: fw = 0.0; for (i=jz;i>=0;i--) fw += fq[i]; - y[0] = (ih==0)? fw: -fw; + y[0] = (ih==0)? fw: -fw; break; case 1: case 2: fw = 0.0; - for (i=jz;i>=0;i--) fw += fq[i]; - y[0] = (ih==0)? fw: -fw; + for (i=jz;i>=0;i--) fw += fq[i]; + y[0] = (ih==0)? fw: -fw; fw = fq[0]-fw; for (i=1;i<=jz;i++) fw += fq[i]; - y[1] = (ih==0)? fw: -fw; + y[1] = (ih==0)? fw: -fw; break; case 3: /* painful */ for (i=jz;i>0;i--) { - fw = fq[i-1]+fq[i]; + fw = fq[i-1]+fq[i]; fq[i] += fq[i-1]-fw; fq[i-1] = fw; } for (i=jz;i>1;i--) { - fw = fq[i-1]+fq[i]; + fw = fq[i-1]+fq[i]; fq[i] += fq[i-1]-fw; fq[i-1] = fw; } - for (fw=0.0,i=jz;i>=2;i--) fw += fq[i]; + for (fw=0.0,i=jz;i>=2;i--) fw += fq[i]; if(ih==0) { y[0] = fq[0]; y[1] = fq[1]; y[2] = fw; } else { diff --git a/lib/msun/src/k_sin.c b/lib/msun/src/k_sin.c index f0229014f8dd..394df9276811 100644 --- a/lib/msun/src/k_sin.c +++ b/lib/msun/src/k_sin.c @@ -5,37 +5,37 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: k_sin.c,v 1.6 1994/08/18 23:06:14 jtc Exp $"; +static char rcsid[] = "$Id: k_sin.c,v 1.1.1.1 1994/08/19 09:39:45 jkh Exp $"; #endif /* __kernel_sin( x, y, iy) * kernel sin function on [-pi/4, pi/4], pi/4 ~ 0.7854 * Input x is assumed to be bounded by ~pi/4 in magnitude. * Input y is the tail of x. - * Input iy indicates whether y is 0. (if iy=0, y assume to be 0). + * Input iy indicates whether y is 0. (if iy=0, y assume to be 0). * * Algorithm - * 1. Since sin(-x) = -sin(x), we need only to consider positive x. + * 1. Since sin(-x) = -sin(x), we need only to consider positive x. * 2. if x < 2^-27 (hx<0x3e400000 0), return x with inexact if x!=0. * 3. sin(x) is approximated by a polynomial of degree 13 on * [0,pi/4] * 3 13 * sin(x) ~ x + S1*x + ... + S6*x * where - * + * * |sin(x) 2 4 6 8 10 12 | -58 * |----- - (1+S1*x +S2*x +S3*x +S4*x +S5*x +S6*x )| <= 2 - * | x | - * + * | x | + * * 4. sin(x+y) = sin(x) + sin'(x')*y * ~ sin(x) + (1-x*x/2)*y - * For better accuracy, let + * For better accuracy, let * 3 2 2 2 2 * r = x *(S2+x *(S3+x *(S4+x *(S5+x *S6)))) * then 3 2 @@ -46,9 +46,9 @@ static char rcsid[] = "$Id: k_sin.c,v 1.6 1994/08/18 23:06:14 jtc Exp $"; #include "math_private.h" #ifdef __STDC__ -static const double +static const double #else -static double +static double #endif half = 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */ S1 = -1.66666666666666324348e-01, /* 0xBFC55555, 0x55555549 */ diff --git a/lib/msun/src/k_sinf.c b/lib/msun/src/k_sinf.c index ad19fb484306..b7c3db935dde 100644 --- a/lib/msun/src/k_sinf.c +++ b/lib/msun/src/k_sinf.c @@ -8,22 +8,22 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: k_sinf.c,v 1.2 1994/08/18 23:06:15 jtc Exp $"; +static char rcsid[] = "$Id: k_sinf.c,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $"; #endif #include "math.h" #include "math_private.h" #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif half = 5.0000000000e-01,/* 0x3f000000 */ S1 = -1.6666667163e-01, /* 0xbe2aaaab */ diff --git a/lib/msun/src/k_standard.c b/lib/msun/src/k_standard.c index aa01a796e4f8..d32362e386b8 100644 --- a/lib/msun/src/k_standard.c +++ b/lib/msun/src/k_standard.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: k_standard.c,v 1.4 1994/08/10 20:31:44 jtc Exp $"; +static char rcsid[] = "$Id: k_standard.c,v 1.1.1.1 1994/08/19 09:39:45 jkh Exp $"; #endif #include "math.h" @@ -33,7 +33,7 @@ static const double zero = 0.0; /* used as const */ static double zero = 0.0; /* used as const */ #endif -/* +/* * Standard conformance (non-IEEE) on exception cases. * Mapping: * 1 -- acos(|x|>1) @@ -58,7 +58,7 @@ static double zero = 0.0; /* used as const */ * 20-- pow(0.0,0.0) * 21-- pow(x,y) overflow * 22-- pow(x,y) underflow - * 23-- pow(0,negative) + * 23-- pow(0,negative) * 24-- pow(neg,non-integral) * 25-- sinh(finite) overflow * 26-- sqrt(negative) @@ -82,14 +82,14 @@ static double zero = 0.0; /* used as const */ #ifdef __STDC__ - double __kernel_standard(double x, double y, int type) + double __kernel_standard(double x, double y, int type) #else - double __kernel_standard(x,y,type) + double __kernel_standard(x,y,type) double x,y; int type; #endif { struct exception exc; -#ifndef HUGE_VAL /* this is the only routine that uses HUGE_VAL */ +#ifndef HUGE_VAL /* this is the only routine that uses HUGE_VAL */ #define HUGE_VAL inf double inf = 0.0; @@ -469,7 +469,7 @@ static double zero = 0.0; /* used as const */ /* 0**neg */ exc.type = DOMAIN; exc.name = type < 100 ? "pow" : "powf"; - if (_LIB_VERSION == _SVID_) + if (_LIB_VERSION == _SVID_) exc.retval = zero; else exc.retval = -HUGE_VAL; @@ -487,11 +487,11 @@ static double zero = 0.0; /* used as const */ /* neg**non-integral */ exc.type = DOMAIN; exc.name = type < 100 ? "pow" : "powf"; - if (_LIB_VERSION == _SVID_) + if (_LIB_VERSION == _SVID_) exc.retval = zero; - else + else exc.retval = zero/zero; /* X/Open allow NaN */ - if (_LIB_VERSION == _POSIX_) + if (_LIB_VERSION == _POSIX_) errno = EDOM; else if (!matherr(&exc)) { if (_LIB_VERSION == _SVID_) { @@ -649,7 +649,7 @@ static double zero = 0.0; /* used as const */ (void) WRITE2(": TLOSS error\n", 14); } errno = ERANGE; - } + } break; case 35: case 135: @@ -665,7 +665,7 @@ static double zero = 0.0; /* used as const */ (void) WRITE2(": TLOSS error\n", 14); } errno = ERANGE; - } + } break; case 36: case 136: @@ -681,7 +681,7 @@ static double zero = 0.0; /* used as const */ (void) WRITE2(": TLOSS error\n", 14); } errno = ERANGE; - } + } break; case 37: case 137: @@ -697,7 +697,7 @@ static double zero = 0.0; /* used as const */ (void) WRITE2(": TLOSS error\n", 14); } errno = ERANGE; - } + } break; case 38: case 138: @@ -713,7 +713,7 @@ static double zero = 0.0; /* used as const */ (void) WRITE2(": TLOSS error\n", 14); } errno = ERANGE; - } + } break; case 39: case 139: @@ -729,7 +729,7 @@ static double zero = 0.0; /* used as const */ (void) WRITE2(": TLOSS error\n", 14); } errno = ERANGE; - } + } break; case 40: case 140: @@ -778,5 +778,5 @@ static double zero = 0.0; /* used as const */ } break; } - return exc.retval; + return exc.retval; } diff --git a/lib/msun/src/k_tan.c b/lib/msun/src/k_tan.c index 27abc1ca80bd..d5851cf2f0f8 100644 --- a/lib/msun/src/k_tan.c +++ b/lib/msun/src/k_tan.c @@ -5,38 +5,38 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: k_tan.c,v 1.6 1994/08/18 23:06:16 jtc Exp $"; +static char rcsid[] = "$Id: k_tan.c,v 1.1.1.1 1994/08/19 09:39:45 jkh Exp $"; #endif /* __kernel_tan( x, y, k ) * kernel tan function on [-pi/4, pi/4], pi/4 ~ 0.7854 * Input x is assumed to be bounded by ~pi/4 in magnitude. * Input y is the tail of x. - * Input k indicates whether tan (if k=1) or + * Input k indicates whether tan (if k=1) or * -1/tan (if k= -1) is returned. * * Algorithm - * 1. Since tan(-x) = -tan(x), we need only to consider positive x. + * 1. Since tan(-x) = -tan(x), we need only to consider positive x. * 2. if x < 2^-28 (hx<0x3e300000 0), return x with inexact if x!=0. * 3. tan(x) is approximated by a odd polynomial of degree 27 on * [0,0.67434] * 3 27 * tan(x) ~ x + T1*x + ... + T13*x * where - * + * * |tan(x) 2 4 26 | -59.2 * |----- - (1+T1*x +T2*x +.... +T13*x )| <= 2 - * | x | - * + * | x | + * * Note: tan(x+y) = tan(x) + tan'(x)*y * ~ tan(x) + (1+x*x)*y - * Therefore, for better accuracy in computing tan(x+y), let + * Therefore, for better accuracy in computing tan(x+y), let * 3 2 2 2 2 * r = x *(T2+x *(T3+x *(...+x *(T12+x *T13)))) * then @@ -51,9 +51,9 @@ static char rcsid[] = "$Id: k_tan.c,v 1.6 1994/08/18 23:06:16 jtc Exp $"; #include "math.h" #include "math_private.h" #ifdef __STDC__ -static const double +static const double #else -static double +static double #endif one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ pio4 = 7.85398163397448278999e-01, /* 0x3FE921FB, 0x54442D18 */ @@ -116,7 +116,7 @@ T[] = { return (double)(1-((hx>>30)&2))*(v-2.0*(x-(w*w/(w+v)-r))); } if(iy==1) return w; - else { /* if allow error up to 2 ulp, + else { /* if allow error up to 2 ulp, simply return -1.0/(x+r) here */ /* compute -1.0/(x+r) accurately */ double a,t; diff --git a/lib/msun/src/k_tanf.c b/lib/msun/src/k_tanf.c index f4d13edd78c5..9be8d378ade6 100644 --- a/lib/msun/src/k_tanf.c +++ b/lib/msun/src/k_tanf.c @@ -8,21 +8,21 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: k_tanf.c,v 1.2 1994/08/18 23:06:18 jtc Exp $"; +static char rcsid[] = "$Id: k_tanf.c,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $"; #endif #include "math.h" #include "math_private.h" #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif one = 1.0000000000e+00, /* 0x3f800000 */ pio4 = 7.8539812565e-01, /* 0x3f490fda */ @@ -83,7 +83,7 @@ T[] = { return (float)(1-((hx>>30)&2))*(v-(float)2.0*(x-(w*w/(w+v)-r))); } if(iy==1) return w; - else { /* if allow error up to 2 ulp, + else { /* if allow error up to 2 ulp, simply return -1.0/(x+r) here */ /* compute -1.0/(x+r) accurately */ float a,t; diff --git a/lib/msun/src/math.h b/lib/msun/src/math.h index eff080f8f84d..74b021ff06a7 100644 --- a/lib/msun/src/math.h +++ b/lib/msun/src/math.h @@ -4,14 +4,14 @@ * * 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. * ==================================================== */ /* * from: @(#)fdlibm.h 5.1 93/09/24 - * $Id: math.h,v 1.1 1994/08/10 20:31:49 jtc Exp $ + * $Id: math.h,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $ */ #ifndef _MATH_H_ @@ -48,15 +48,15 @@ extern int signgam; enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix}; #define _LIB_VERSION_TYPE enum fdversion -#define _LIB_VERSION _fdlib_version +#define _LIB_VERSION _fdlib_version -/* if global variable _LIB_VERSION is not desirable, one may - * change the following to be a constant by: +/* if global variable _LIB_VERSION is not desirable, one may + * change the following to be a constant by: * #define _LIB_VERSION_TYPE const enum version * In that case, after one initializes the value _LIB_VERSION (see * s_lib_version.c) during compile time, it cannot be modified * in the middle of a program - */ + */ extern _LIB_VERSION_TYPE _LIB_VERSION; #define _IEEE_ fdlibm_ieee @@ -74,12 +74,12 @@ struct exception { #define HUGE MAXFLOAT -/* +/* * set X_TLOSS = pi*2**52, which is possibly defined in <values.h> * (one may replace the following line by "#include <values.h>") */ -#define X_TLOSS 1.41484755040568800000e+16 +#define X_TLOSS 1.41484755040568800000e+16 #define DOMAIN 1 #define SING 2 diff --git a/lib/msun/src/math_private.h b/lib/msun/src/math_private.h index 2183c9f2c166..232f65b8712f 100644 --- a/lib/msun/src/math_private.h +++ b/lib/msun/src/math_private.h @@ -4,14 +4,14 @@ * * 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. * ==================================================== */ /* * from: @(#)fdlibm.h 5.1 93/09/24 - * $Id: math_private.h,v 1.2 1994/08/18 23:06:19 jtc Exp $ + * $Id: math_private.h,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $ */ #ifndef _MATH_PRIVATE_H_ @@ -36,10 +36,10 @@ #if BYTE_ORDER == BIG_ENDIAN -typedef union +typedef union { double value; - struct + struct { u_int32_t msw; u_int32_t lsw; @@ -50,10 +50,10 @@ typedef union #if BYTE_ORDER == LITTLE_ENDIAN -typedef union +typedef union { double value; - struct + struct { u_int32_t lsw; u_int32_t msw; @@ -149,13 +149,13 @@ do { \ } while (0) /* ieee style elementary functions */ -extern double __ieee754_sqrt __P((double)); -extern double __ieee754_acos __P((double)); -extern double __ieee754_acosh __P((double)); -extern double __ieee754_log __P((double)); -extern double __ieee754_atanh __P((double)); -extern double __ieee754_asin __P((double)); -extern double __ieee754_atan2 __P((double,double)); +extern double __ieee754_sqrt __P((double)); +extern double __ieee754_acos __P((double)); +extern double __ieee754_acosh __P((double)); +extern double __ieee754_log __P((double)); +extern double __ieee754_atanh __P((double)); +extern double __ieee754_asin __P((double)); +extern double __ieee754_atan2 __P((double,double)); extern double __ieee754_exp __P((double)); extern double __ieee754_cosh __P((double)); extern double __ieee754_fmod __P((double,double)); @@ -178,7 +178,7 @@ extern int __ieee754_rem_pio2 __P((double,double*)); extern double __ieee754_scalb __P((double,double)); /* fdlibm kernel function */ -extern double __kernel_standard __P((double,double,int)); +extern double __kernel_standard __P((double,double,int)); extern double __kernel_sin __P((double,double,int)); extern double __kernel_cos __P((double,double)); extern double __kernel_tan __P((double,double,int)); @@ -186,13 +186,13 @@ extern int __kernel_rem_pio2 __P((double*,double*,int,int,int,const int*)); /* ieee style elementary float functions */ -extern float __ieee754_sqrtf __P((float)); -extern float __ieee754_acosf __P((float)); -extern float __ieee754_acoshf __P((float)); -extern float __ieee754_logf __P((float)); -extern float __ieee754_atanhf __P((float)); -extern float __ieee754_asinf __P((float)); -extern float __ieee754_atan2f __P((float,float)); +extern float __ieee754_sqrtf __P((float)); +extern float __ieee754_acosf __P((float)); +extern float __ieee754_acoshf __P((float)); +extern float __ieee754_logf __P((float)); +extern float __ieee754_atanhf __P((float)); +extern float __ieee754_asinf __P((float)); +extern float __ieee754_atan2f __P((float,float)); extern float __ieee754_expf __P((float)); extern float __ieee754_coshf __P((float)); extern float __ieee754_fmodf __P((float,float)); diff --git a/lib/msun/src/s_asinh.c b/lib/msun/src/s_asinh.c index f9e1304ee48f..64de8defe96f 100644 --- a/lib/msun/src/s_asinh.c +++ b/lib/msun/src/s_asinh.c @@ -5,37 +5,37 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_asinh.c,v 1.6 1994/08/18 23:06:20 jtc Exp $"; +static char rcsid[] = "$Id: s_asinh.c,v 1.1.1.1 1994/08/19 09:39:45 jkh Exp $"; #endif /* asinh(x) * Method : - * Based on + * Based on * asinh(x) = sign(x) * log [ |x| + sqrt(x*x+1) ] * we have * asinh(x) := x if 1+x*x=1, * := sign(x)*(log(x)+ln2)) for large |x|, else * := sign(x)*log(2|x|+1/(|x|+sqrt(x*x+1))) if|x|>2, else - * := sign(x)*log1p(|x| + x^2/(1 + sqrt(1+x^2))) + * := sign(x)*log1p(|x| + x^2/(1 + sqrt(1+x^2))) */ #include "math.h" #include "math_private.h" #ifdef __STDC__ -static const double +static const double #else -static double +static double #endif one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ ln2 = 6.93147180559945286227e-01, /* 0x3FE62E42, 0xFEFA39EF */ -huge= 1.00000000000000000000e+300; +huge= 1.00000000000000000000e+300; #ifdef __STDC__ double asinh(double x) @@ -43,7 +43,7 @@ huge= 1.00000000000000000000e+300; double asinh(x) double x; #endif -{ +{ double t,w; int32_t hx,ix; GET_HIGH_WORD(hx,x); @@ -51,7 +51,7 @@ huge= 1.00000000000000000000e+300; if(ix>=0x7ff00000) return x+x; /* x is inf or NaN */ if(ix< 0x3e300000) { /* |x|<2**-28 */ if(huge+x>one) return x; /* return x inexact except 0 */ - } + } if(ix>0x41b00000) { /* |x| > 2**28 */ w = __ieee754_log(fabs(x))+ln2; } else if (ix>0x40000000) { /* 2**28 > |x| > 2.0 */ diff --git a/lib/msun/src/s_asinhf.c b/lib/msun/src/s_asinhf.c index 3d4f2425c9c5..e96704fc9bf2 100644 --- a/lib/msun/src/s_asinhf.c +++ b/lib/msun/src/s_asinhf.c @@ -8,26 +8,26 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_asinhf.c,v 1.2 1994/08/18 23:06:21 jtc Exp $"; +static char rcsid[] = "$Id: s_asinhf.c,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $"; #endif #include "math.h" #include "math_private.h" #ifdef __STDC__ -static const float +static const float #else -static float +static float #endif one = 1.0000000000e+00, /* 0x3F800000 */ ln2 = 6.9314718246e-01, /* 0x3f317218 */ -huge= 1.0000000000e+30; +huge= 1.0000000000e+30; #ifdef __STDC__ float asinhf(float x) @@ -35,7 +35,7 @@ huge= 1.0000000000e+30; float asinhf(x) float x; #endif -{ +{ float t,w; int32_t hx,ix; GET_FLOAT_WORD(hx,x); @@ -43,7 +43,7 @@ huge= 1.0000000000e+30; if(ix>=0x7f800000) return x+x; /* x is inf or NaN */ if(ix< 0x31800000) { /* |x|<2**-28 */ if(huge+x>one) return x; /* return x inexact except 0 */ - } + } if(ix>0x4d800000) { /* |x| > 2**28 */ w = __ieee754_logf(fabsf(x))+ln2; } else if (ix>0x40000000) { /* 2**28 > |x| > 2.0 */ diff --git a/lib/msun/src/s_atan.c b/lib/msun/src/s_atan.c index dd7966517339..f53462bb3895 100644 --- a/lib/msun/src/s_atan.c +++ b/lib/msun/src/s_atan.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_atan.c,v 1.6 1994/08/18 23:06:23 jtc Exp $"; +static char rcsid[] = "$Id: s_atan.c,v 1.1.1.1 1994/08/19 09:39:45 jkh Exp $"; #endif /* atan(x) @@ -28,9 +28,9 @@ static char rcsid[] = "$Id: s_atan.c,v 1.6 1994/08/18 23:06:23 jtc Exp $"; * [39/16,INF] atan(x) = atan(INF) + atan( -1/t ) * * Constants: - * The hexadecimal values are the intended ones for the following - * constants. The decimal values may be used, provided that the - * compiler will convert from decimal to binary accurately enough + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough * to produce the hexadecimal values shown. */ @@ -78,9 +78,9 @@ static double aT[] = { }; #ifdef __STDC__ - static const double + static const double #else - static double + static double #endif one = 1.0, huge = 1.0e300; @@ -114,9 +114,9 @@ huge = 1.0e300; x = fabs(x); if (ix < 0x3ff30000) { /* |x| < 1.1875 */ if (ix < 0x3fe60000) { /* 7/16 <=|x|<11/16 */ - id = 0; x = (2.0*x-one)/(2.0+x); + id = 0; x = (2.0*x-one)/(2.0+x); } else { /* 11/16<=|x|< 19/16 */ - id = 1; x = (x-one)/(x+one); + id = 1; x = (x-one)/(x+one); } } else { if (ix < 0x40038000) { /* |x| < 2.4375 */ diff --git a/lib/msun/src/s_atanf.c b/lib/msun/src/s_atanf.c index f9d51600a698..52beebfcf5ec 100644 --- a/lib/msun/src/s_atanf.c +++ b/lib/msun/src/s_atanf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_atanf.c,v 1.2 1994/08/18 23:06:24 jtc Exp $"; +static char rcsid[] = "$Id: s_atanf.c,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $"; #endif #include "math.h" @@ -61,9 +61,9 @@ static float aT[] = { }; #ifdef __STDC__ - static const float + static const float #else - static float + static float #endif one = 1.0, huge = 1.0e30; @@ -94,9 +94,9 @@ huge = 1.0e30; x = fabsf(x); if (ix < 0x3f980000) { /* |x| < 1.1875 */ if (ix < 0x3f300000) { /* 7/16 <=|x|<11/16 */ - id = 0; x = ((float)2.0*x-one)/((float)2.0+x); + id = 0; x = ((float)2.0*x-one)/((float)2.0+x); } else { /* 11/16<=|x|< 19/16 */ - id = 1; x = (x-one)/(x+one); + id = 1; x = (x-one)/(x+one); } } else { if (ix < 0x401c0000) { /* |x| < 2.4375 */ diff --git a/lib/msun/src/s_cbrt.c b/lib/msun/src/s_cbrt.c index cbf50abe0f9b..a3fcc0215b47 100644 --- a/lib/msun/src/s_cbrt.c +++ b/lib/msun/src/s_cbrt.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_cbrt.c,v 1.6 1994/08/18 23:06:25 jtc Exp $"; +static char rcsid[] = "$Id: s_cbrt.c,v 1.1.1.1 1994/08/19 09:39:51 jkh Exp $"; #endif #include "math.h" @@ -40,9 +40,9 @@ F = 1.60714285714285720630e+00, /* 45/28 = 0x3FF9B6DB, 0x6DB6DB6E */ G = 3.57142857142857150787e-01; /* 5/14 = 0x3FD6DB6D, 0xB6DB6DB7 */ #ifdef __STDC__ - double cbrt(double x) + double cbrt(double x) #else - double cbrt(x) + double cbrt(x) double x; #endif { @@ -56,7 +56,7 @@ G = 3.57142857142857150787e-01; /* 5/14 = 0x3FD6DB6D, 0xB6DB6DB7 */ hx ^=sign; if(hx>=0x7ff00000) return(x+x); /* cbrt(NaN,INF) is itself */ GET_LOW_WORD(low,x); - if((hx|low)==0) + if((hx|low)==0) return(x); /* cbrt(0) is itself */ SET_HIGH_WORD(x,hx); /* x <- |x| */ @@ -72,9 +72,9 @@ G = 3.57142857142857150787e-01; /* 5/14 = 0x3FD6DB6D, 0xB6DB6DB7 */ /* new cbrt to 23 bits, may be implemented in single precision */ r=t*t/x; s=C+r*t; - t*=G+F/(s+E+D/s); + t*=G+F/(s+E+D/s); - /* chopped to 20 bits and make it larger than cbrt(x) */ + /* chopped to 20 bits and make it larger than cbrt(x) */ GET_HIGH_WORD(high,t); INSERT_WORDS(t,high+0x00000001,0); diff --git a/lib/msun/src/s_cbrtf.c b/lib/msun/src/s_cbrtf.c index 4b38c5066678..8bee2beb4a57 100644 --- a/lib/msun/src/s_cbrtf.c +++ b/lib/msun/src/s_cbrtf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_cbrtf.c,v 1.2 1994/08/18 23:06:27 jtc Exp $"; +static char rcsid[] = "$Id: s_cbrtf.c,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $"; #endif #include "math.h" @@ -24,9 +24,9 @@ static char rcsid[] = "$Id: s_cbrtf.c,v 1.2 1994/08/18 23:06:27 jtc Exp $"; * Return cube root of x */ #ifdef __STDC__ -static const unsigned +static const unsigned #else -static unsigned +static unsigned #endif B1 = 709958130, /* B1 = (84+2/3-0.03306235651)*2**23 */ B2 = 642849266; /* B2 = (76+2/3-0.03306235651)*2**23 */ @@ -43,9 +43,9 @@ F = 1.6071428061e+00, /* 45/28 = 0x3fcdb6db */ G = 3.5714286566e-01; /* 5/14 = 0x3eb6db6e */ #ifdef __STDC__ - float cbrtf(float x) + float cbrtf(float x) #else - float cbrtf(x) + float cbrtf(x) float x; #endif { @@ -58,7 +58,7 @@ G = 3.5714286566e-01; /* 5/14 = 0x3eb6db6e */ sign=hx&0x80000000; /* sign= sign(x) */ hx ^=sign; if(hx>=0x7f800000) return(x+x); /* cbrt(NaN,INF) is itself */ - if(hx==0) + if(hx==0) return(x); /* cbrt(0) is itself */ SET_FLOAT_WORD(x,hx); /* x <- |x| */ @@ -74,7 +74,7 @@ G = 3.5714286566e-01; /* 5/14 = 0x3eb6db6e */ /* new cbrt to 23 bits */ r=t*t/x; s=C+r*t; - t*=G+F/(s+E+D/s); + t*=G+F/(s+E+D/s); /* retore the sign bit */ GET_FLOAT_WORD(high,t); diff --git a/lib/msun/src/s_ceil.c b/lib/msun/src/s_ceil.c index d1c55986e248..749bc606bb9a 100644 --- a/lib/msun/src/s_ceil.c +++ b/lib/msun/src/s_ceil.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_ceil.c,v 1.6 1994/08/18 23:06:29 jtc Exp $"; +static char rcsid[] = "$Id: s_ceil.c,v 1.1.1.1 1994/08/19 09:39:51 jkh Exp $"; #endif /* @@ -46,7 +46,7 @@ static double huge = 1.0e300; if(j0<20) { if(j0<0) { /* raise inexact if x != 0 */ if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */ - if(i0<0) {i0=0x80000000;i1=0;} + if(i0<0) {i0=0x80000000;i1=0;} else if((i0|i1)!=0) { i0=0x3ff00000;i1=0;} } } else { @@ -65,7 +65,7 @@ static double huge = 1.0e300; if((i1&i)==0) return x; /* x is integral */ if(huge+x>0.0) { /* raise inexact flag */ if(i0>0) { - if(j0==20) i0+=1; + if(j0==20) i0+=1; else { j = i1 + (1<<(52-j0)); if(j<i1) i0+=1; /* got a carry */ diff --git a/lib/msun/src/s_ceilf.c b/lib/msun/src/s_ceilf.c index 76334f1a603e..b30f5ba8e816 100644 --- a/lib/msun/src/s_ceilf.c +++ b/lib/msun/src/s_ceilf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_ceilf.c,v 1.2 1994/08/18 23:06:30 jtc Exp $"; +static char rcsid[] = "$Id: s_ceilf.c,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $"; #endif #include "math.h" @@ -41,7 +41,7 @@ static float huge = 1.0e30; if(j0<23) { if(j0<0) { /* raise inexact if x != 0 */ if(huge+x>(float)0.0) {/* return 0*sign(x) if |x|<1 */ - if(i0<0) {i0=0x80000000;} + if(i0<0) {i0=0x80000000;} else if(i0!=0) { i0=0x3f800000;} } } else { diff --git a/lib/msun/src/s_copysign.c b/lib/msun/src/s_copysign.c index 93f39c09f7b7..30fea0e6a314 100644 --- a/lib/msun/src/s_copysign.c +++ b/lib/msun/src/s_copysign.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_copysign.c,v 1.6 1994/08/18 23:06:31 jtc Exp $"; +static char rcsid[] = "$Id: s_copysign.c,v 1.1.1.1 1994/08/19 09:39:51 jkh Exp $"; #endif /* diff --git a/lib/msun/src/s_copysignf.c b/lib/msun/src/s_copysignf.c index 219f35f00bd5..07b1a530ab14 100644 --- a/lib/msun/src/s_copysignf.c +++ b/lib/msun/src/s_copysignf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_copysignf.c,v 1.2 1994/08/18 23:06:33 jtc Exp $"; +static char rcsid[] = "$Id: s_copysignf.c,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $"; #endif /* diff --git a/lib/msun/src/s_cos.c b/lib/msun/src/s_cos.c index 821af1ca66d9..b3666d33eb48 100644 --- a/lib/msun/src/s_cos.c +++ b/lib/msun/src/s_cos.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_cos.c,v 1.5 1994/08/18 23:06:34 jtc Exp $"; +static char rcsid[] = "$Id: s_cos.c,v 1.1.1.1 1994/08/19 09:39:51 jkh Exp $"; #endif /* cos(x) @@ -23,8 +23,8 @@ static char rcsid[] = "$Id: s_cos.c,v 1.5 1994/08/18 23:06:34 jtc Exp $"; * __ieee754_rem_pio2 ... argument reduction routine * * Method. - * Let S,C and T denote the sin, cos and tan respectively on - * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 + * Let S,C and T denote the sin, cos and tan respectively on + * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 * in [-pi/4 , +pi/4], and let n = k mod 4. * We have * @@ -42,7 +42,7 @@ static char rcsid[] = "$Id: s_cos.c,v 1.5 1994/08/18 23:06:34 jtc Exp $"; * trig(NaN) is that NaN; * * Accuracy: - * TRIG(x) returns trig(x) nearly rounded + * TRIG(x) returns trig(x) nearly rounded */ #include "math.h" diff --git a/lib/msun/src/s_cosf.c b/lib/msun/src/s_cosf.c index f51fff48b95c..95fe4e7723d6 100644 --- a/lib/msun/src/s_cosf.c +++ b/lib/msun/src/s_cosf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_cosf.c,v 1.2 1994/08/18 23:06:35 jtc Exp $"; +static char rcsid[] = "$Id: s_cosf.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; #endif #include "math.h" diff --git a/lib/msun/src/s_erf.c b/lib/msun/src/s_erf.c index 45f66366835c..4a06e2043ed2 100644 --- a/lib/msun/src/s_erf.c +++ b/lib/msun/src/s_erf.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_erf.c,v 1.6 1994/08/18 23:06:36 jtc Exp $"; +static char rcsid[] = "$Id: s_erf.c,v 1.1.1.1 1994/08/19 09:39:51 jkh Exp $"; #endif /* double erf(double x) @@ -19,11 +19,11 @@ static char rcsid[] = "$Id: s_erf.c,v 1.6 1994/08/18 23:06:36 jtc Exp $"; * x * 2 |\ * erf(x) = --------- | exp(-t*t)dt - * sqrt(pi) \| + * sqrt(pi) \| * 0 * * erfc(x) = 1-erf(x) - * Note that + * Note that * erf(-x) = -erf(x) * erfc(-x) = 2 - erfc(x) * @@ -36,7 +36,7 @@ static char rcsid[] = "$Id: s_erf.c,v 1.6 1994/08/18 23:06:36 jtc Exp $"; * Q is an odd poly of degree 10. * -57.90 * | R - (erf(x)-x)/x | <= 2 - * + * * * Remark. The formula is derived by noting * erf(x) = (2/sqrt(pi))*(x - x^3/3 + x^5/10 - x^7/42 + ....) @@ -59,14 +59,14 @@ static char rcsid[] = "$Id: s_erf.c,v 1.6 1994/08/18 23:06:36 jtc Exp $"; * That is, we use rational approximation to approximate * erf(1+s) - (c = (single)0.84506291151) * Note that |P1/Q1|< 0.078 for x in [0.84375,1.25] - * where + * where * P1(s) = degree 6 poly in s * Q1(s) = degree 6 poly in s * - * 3. For x in [1.25,1/0.35(~2.857143)], + * 3. For x in [1.25,1/0.35(~2.857143)], * erfc(x) = (1/x)*exp(-x*x-0.5625+R1/S1) * erf(x) = 1 - erfc(x) - * where + * where * R1(z) = degree 7 poly in z, (z=1/x^2) * S1(z) = degree 8 poly in z * @@ -84,7 +84,7 @@ static char rcsid[] = "$Id: s_erf.c,v 1.6 1994/08/18 23:06:36 jtc Exp $"; * To compute exp(-x*x-0.5625+R/S), let s be a single * precision number and s := x; then * -x*x = -s*s + (s-x)*(s+x) - * exp(-x*x-0.5626+R/S) = + * exp(-x*x-0.5626+R/S) = * exp(-s*s-0.5625)*exp((s-x)*(s+x)+R/S); * Note2: * Here 4 and 5 make use of the asymptotic series @@ -104,7 +104,7 @@ static char rcsid[] = "$Id: s_erf.c,v 1.6 1994/08/18 23:06:36 jtc Exp $"; * * 7. Special case: * erf(0) = 0, erf(inf) = 1, erf(-inf) = -1, - * erfc(0) = 1, erfc(inf) = 0, erfc(-inf) = 2, + * erfc(0) = 1, erfc(inf) = 0, erfc(-inf) = 2, * erfc/erf(NaN) is NaN */ @@ -139,7 +139,7 @@ qq3 = 5.08130628187576562776e-03, /* 0x3F74D022, 0xC4D36B0F */ qq4 = 1.32494738004321644526e-04, /* 0x3F215DC9, 0x221C1A10 */ qq5 = -3.96022827877536812320e-06, /* 0xBED09C43, 0x42A26120 */ /* - * Coefficients for approximation to erf in [0.84375,1.25] + * Coefficients for approximation to erf in [0.84375,1.25] */ pa0 = -2.36211856075265944077e-03, /* 0xBF6359B8, 0xBEF77538 */ pa1 = 4.14856118683748331666e-01, /* 0x3FDA8D00, 0xAD92B34D */ @@ -192,9 +192,9 @@ sb6 = 4.74528541206955367215e+02, /* 0x407DA874, 0xE79FE763 */ sb7 = -2.24409524465858183362e+01; /* 0xC03670E2, 0x42712D62 */ #ifdef __STDC__ - double erf(double x) + double erf(double x) #else - double erf(x) + double erf(x) double x; #endif { @@ -209,7 +209,7 @@ sb7 = -2.24409524465858183362e+01; /* 0xC03670E2, 0x42712D62 */ if(ix < 0x3feb0000) { /* |x|<0.84375 */ if(ix < 0x3e300000) { /* |x|<2**-28 */ - if (ix < 0x00800000) + if (ix < 0x00800000) return 0.125*(8.0*x+efx8*x); /*avoid underflow */ return x + efx*x; } @@ -241,16 +241,16 @@ sb7 = -2.24409524465858183362e+01; /* 0xC03670E2, 0x42712D62 */ S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*( sb5+s*(sb6+s*sb7)))))); } - z = x; + z = x; SET_LOW_WORD(z,0); r = __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S); if(hx>=0) return one-r/x; else return r/x-one; } #ifdef __STDC__ - double erfc(double x) + double erfc(double x) #else - double erfc(x) + double erfc(x) double x; #endif { @@ -283,7 +283,7 @@ sb7 = -2.24409524465858183362e+01; /* 0xC03670E2, 0x42712D62 */ P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6))))); Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6))))); if(hx>=0) { - z = one-erx; return z - P/Q; + z = one-erx; return z - P/Q; } else { z = erx+P/Q; return one+z; } diff --git a/lib/msun/src/s_erff.c b/lib/msun/src/s_erff.c index 5a931be7cd23..15e40b13e400 100644 --- a/lib/msun/src/s_erff.c +++ b/lib/msun/src/s_erff.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_erff.c,v 1.2 1994/08/18 23:06:38 jtc Exp $"; +static char rcsid[] = "$Id: s_erff.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; #endif #include "math.h" @@ -47,7 +47,7 @@ qq3 = 5.0813062117e-03, /* 0x3ba68116 */ qq4 = 1.3249473704e-04, /* 0x390aee49 */ qq5 = -3.9602282413e-06, /* 0xb684e21a */ /* - * Coefficients for approximation to erf in [0.84375,1.25] + * Coefficients for approximation to erf in [0.84375,1.25] */ pa0 = -2.3621185683e-03, /* 0xbb1acdc6 */ pa1 = 4.1485610604e-01, /* 0x3ed46805 */ @@ -100,9 +100,9 @@ sb6 = 4.7452853394e+02, /* 0x43ed43a7 */ sb7 = -2.2440952301e+01; /* 0xc1b38712 */ #ifdef __STDC__ - float erff(float x) + float erff(float x) #else - float erff(x) + float erff(x) float x; #endif { @@ -117,7 +117,7 @@ sb7 = -2.2440952301e+01; /* 0xc1b38712 */ if(ix < 0x3f580000) { /* |x|<0.84375 */ if(ix < 0x31800000) { /* |x|<2**-28 */ - if (ix < 0x04000000) + if (ix < 0x04000000) /*avoid underflow */ return (float)0.125*((float)8.0*x+efx8*x); return x + efx*x; @@ -157,9 +157,9 @@ sb7 = -2.2440952301e+01; /* 0xc1b38712 */ } #ifdef __STDC__ - float erfcf(float x) + float erfcf(float x) #else - float erfcf(x) + float erfcf(x) float x; #endif { @@ -192,7 +192,7 @@ sb7 = -2.2440952301e+01; /* 0xc1b38712 */ P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6))))); Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6))))); if(hx>=0) { - z = one-erx; return z - P/Q; + z = one-erx; return z - P/Q; } else { z = erx+P/Q; return one+z; } diff --git a/lib/msun/src/s_expm1.c b/lib/msun/src/s_expm1.c index 70a1e05b448f..9c933e24c885 100644 --- a/lib/msun/src/s_expm1.c +++ b/lib/msun/src/s_expm1.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_expm1.c,v 1.6 1994/08/18 23:06:39 jtc Exp $"; +static char rcsid[] = "$Id: s_expm1.c,v 1.1.1.1 1994/08/19 09:39:51 jkh Exp $"; #endif /* expm1(x) @@ -21,9 +21,9 @@ static char rcsid[] = "$Id: s_expm1.c,v 1.6 1994/08/18 23:06:39 jtc Exp $"; * 1. Argument reduction: * Given x, find r and integer k such that * - * x = k*ln2 + r, |r| <= 0.5*ln2 ~ 0.34658 + * x = k*ln2 + r, |r| <= 0.5*ln2 ~ 0.34658 * - * Here a correction term c will be computed to compensate + * Here a correction term c will be computed to compensate * the error in r when rounded to a floating-point number. * * 2. Approximating expm1(r) by a special rational function on @@ -36,9 +36,9 @@ static char rcsid[] = "$Id: s_expm1.c,v 1.6 1994/08/18 23:06:39 jtc Exp $"; * R1(r**2) = 6/r *((exp(r)+1)/(exp(r)-1) - 2/r) * = 6/r * ( 1 + 2.0*(1/(exp(r)-1) - 1/r)) * = 1 - r^2/60 + r^4/2520 - r^6/100800 + ... - * We use a special Reme algorithm on [0,0.347] to generate - * a polynomial of degree 5 in r*r to approximate R1. The - * maximum error of this polynomial approximation is bounded + * We use a special Reme algorithm on [0,0.347] to generate + * a polynomial of degree 5 in r*r to approximate R1. The + * maximum error of this polynomial approximation is bounded * by 2**-61. In other words, * R1(z) ~ 1.0 + Q1*z + Q2*z**2 + Q3*z**3 + Q4*z**4 + Q5*z**5 * where Q1 = -1.6666666666666567384E-2, @@ -49,28 +49,28 @@ static char rcsid[] = "$Id: s_expm1.c,v 1.6 1994/08/18 23:06:39 jtc Exp $"; * (where z=r*r, and the values of Q1 to Q5 are listed below) * with error bounded by * | 5 | -61 - * | 1.0+Q1*z+...+Q5*z - R1(z) | <= 2 + * | 1.0+Q1*z+...+Q5*z - R1(z) | <= 2 * | | - * - * expm1(r) = exp(r)-1 is then computed by the following - * specific way which minimize the accumulation rounding error: + * + * expm1(r) = exp(r)-1 is then computed by the following + * specific way which minimize the accumulation rounding error: * 2 3 * r r [ 3 - (R1 + R1*r/2) ] * expm1(r) = r + --- + --- * [--------------------] * 2 2 [ 6 - r*(3 - R1*r/2) ] - * + * * To compensate the error in the argument reduction, we use - * expm1(r+c) = expm1(r) + c + expm1(r)*c - * ~ expm1(r) + c + r*c + * expm1(r+c) = expm1(r) + c + expm1(r)*c + * ~ expm1(r) + c + r*c * Thus c+r*c will be added in as the correction terms for - * expm1(r+c). Now rearrange the term to avoid optimization + * expm1(r+c). Now rearrange the term to avoid optimization * screw up: * ( 2 2 ) * ({ ( r [ R1 - (3 - R1*r/2) ] ) } r ) * expm1(r+c)~r - ({r*(--- * [--------------------]-c)-c} - --- ) * ({ ( 2 [ 6 - r*(3 - R1*r/2) ] ) } 2 ) * ( ) - * + * * = r - E * 3. Scale back to obtain expm1(x): * From step 1, we have @@ -87,7 +87,7 @@ static char rcsid[] = "$Id: s_expm1.c,v 1.6 1994/08/18 23:06:39 jtc Exp $"; * else return 1.0+2.0*(r-E); * (v) if (k<-2||k>56) return 2^k(1-(E-r)) - 1 (or exp(x)-1) * (vi) if k <= 20, return 2^k((1-2^-k)-(E-r)), else - * (vii) return 2^k(1-((E+2^-k)-r)) + * (vii) return 2^k(1-((E+2^-k)-r)) * * Special cases: * expm1(INF) is INF, expm1(NaN) is NaN; @@ -99,12 +99,12 @@ static char rcsid[] = "$Id: s_expm1.c,v 1.6 1994/08/18 23:06:39 jtc Exp $"; * 1 ulp (unit in the last place). * * Misc. info. - * For IEEE double + * For IEEE double * if x > 7.09782712893383973096e+02 then expm1(x) overflow * * Constants: - * The hexadecimal values are the intended ones for the following - * constants. The decimal values may be used, provided that the + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the * compiler will convert from decimal to binary accurately enough * to produce the hexadecimal values shown. */ @@ -153,7 +153,7 @@ Q5 = -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */ if(hx>=0x7ff00000) { u_int32_t low; GET_LOW_WORD(low,x); - if(((hx&0xfffff)|low)!=0) + if(((hx&0xfffff)|low)!=0) return x+x; /* NaN */ else return (xsb==0)? x:-1.0;/* exp(+-inf)={inf,-1} */ } @@ -166,7 +166,7 @@ Q5 = -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */ } /* argument reduction */ - if(hx > 0x3fd62e42) { /* if |x| > 0.5 ln2 */ + if(hx > 0x3fd62e42) { /* if |x| > 0.5 ln2 */ if(hx < 0x3FF0A2B2) { /* and |x| < 1.5 ln2 */ if(xsb==0) {hi = x - ln2_hi; lo = ln2_lo; k = 1;} @@ -180,10 +180,10 @@ Q5 = -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */ } x = hi - lo; c = (hi-x)-lo; - } + } else if(hx < 0x3c900000) { /* when |x|<2**-54, return x */ t = huge+x; /* return x with inexact flags when x!=0 */ - return x - (t-(huge+x)); + return x - (t-(huge+x)); } else k = 0; @@ -198,7 +198,7 @@ Q5 = -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */ e = (x*(e-c)-c); e -= hxs; if(k== -1) return 0.5*(x-e)-0.5; - if(k==1) + if(k==1) if(x < -0.25) return -2.0*(e-(x+0.5)); else return one+2.0*(x-e); if (k <= -2 || k>56) { /* suffice to return exp(x)-1 */ diff --git a/lib/msun/src/s_expm1f.c b/lib/msun/src/s_expm1f.c index 35c440b62aed..e7d43514f0cc 100644 --- a/lib/msun/src/s_expm1f.c +++ b/lib/msun/src/s_expm1f.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_expm1f.c,v 1.2 1994/08/18 23:06:40 jtc Exp $"; +static char rcsid[] = "$Id: s_expm1f.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; #endif #include "math.h" @@ -71,7 +71,7 @@ Q5 = -2.0109921195e-07; /* 0xb457edbb */ } /* argument reduction */ - if(hx > 0x3eb17218) { /* if |x| > 0.5 ln2 */ + if(hx > 0x3eb17218) { /* if |x| > 0.5 ln2 */ if(hx < 0x3F851592) { /* and |x| < 1.5 ln2 */ if(xsb==0) {hi = x - ln2_hi; lo = ln2_lo; k = 1;} @@ -85,10 +85,10 @@ Q5 = -2.0109921195e-07; /* 0xb457edbb */ } x = hi - lo; c = (hi-x)-lo; - } + } else if(hx < 0x33000000) { /* when |x|<2**-25, return x */ t = huge+x; /* return x with inexact flags when x!=0 */ - return x - (t-(huge+x)); + return x - (t-(huge+x)); } else k = 0; @@ -103,7 +103,7 @@ Q5 = -2.0109921195e-07; /* 0xb457edbb */ e = (x*(e-c)-c); e -= hxs; if(k== -1) return (float)0.5*(x-e)-(float)0.5; - if(k==1) + if(k==1) if(x < (float)-0.25) return -(float)2.0*(e-(x+(float)0.5)); else return one+(float)2.0*(x-e); if (k <= -2 || k>56) { /* suffice to return exp(x)-1 */ diff --git a/lib/msun/src/s_fabs.c b/lib/msun/src/s_fabs.c index 26e19908522e..590d5594ea2e 100644 --- a/lib/msun/src/s_fabs.c +++ b/lib/msun/src/s_fabs.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_fabs.c,v 1.5 1994/08/18 23:06:42 jtc Exp $"; +static char rcsid[] = "$Id: s_fabs.c,v 1.1.1.1 1994/08/19 09:39:51 jkh Exp $"; #endif /* diff --git a/lib/msun/src/s_fabsf.c b/lib/msun/src/s_fabsf.c index 3050ecc82c20..e2462725b9a5 100644 --- a/lib/msun/src/s_fabsf.c +++ b/lib/msun/src/s_fabsf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_fabsf.c,v 1.2 1994/08/18 23:06:43 jtc Exp $"; +static char rcsid[] = "$Id: s_fabsf.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; #endif /* diff --git a/lib/msun/src/s_finite.c b/lib/msun/src/s_finite.c index 33fedbac1bb2..5de602467f44 100644 --- a/lib/msun/src/s_finite.c +++ b/lib/msun/src/s_finite.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_finite.c,v 1.6 1994/08/18 23:06:44 jtc Exp $"; +static char rcsid[] = "$Id: s_finite.c,v 1.1.1.1 1994/08/19 09:39:51 jkh Exp $"; #endif /* diff --git a/lib/msun/src/s_finitef.c b/lib/msun/src/s_finitef.c index a2add124b428..28b2f791b375 100644 --- a/lib/msun/src/s_finitef.c +++ b/lib/msun/src/s_finitef.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_finitef.c,v 1.2 1994/08/18 23:06:45 jtc Exp $"; +static char rcsid[] = "$Id: s_finitef.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; #endif /* diff --git a/lib/msun/src/s_floor.c b/lib/msun/src/s_floor.c index e76d00a38bc0..84b5c9db6504 100644 --- a/lib/msun/src/s_floor.c +++ b/lib/msun/src/s_floor.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_floor.c,v 1.6 1994/08/18 23:06:47 jtc Exp $"; +static char rcsid[] = "$Id: s_floor.c,v 1.1.1.1 1994/08/19 09:39:51 jkh Exp $"; #endif /* @@ -46,7 +46,7 @@ static double huge = 1.0e300; if(j0<20) { if(j0<0) { /* raise inexact if x != 0 */ if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */ - if(i0>=0) {i0=i1=0;} + if(i0>=0) {i0=i1=0;} else if(((i0&0x7fffffff)|i1)!=0) { i0=0xbff00000;i1=0;} } @@ -66,7 +66,7 @@ static double huge = 1.0e300; if((i1&i)==0) return x; /* x is integral */ if(huge+x>0.0) { /* raise inexact flag */ if(i0<0) { - if(j0==20) i0+=1; + if(j0==20) i0+=1; else { j = i1+(1<<(52-j0)); if(j<i1) i0 +=1 ; /* got a carry */ diff --git a/lib/msun/src/s_floorf.c b/lib/msun/src/s_floorf.c index 216a073a9c0f..885121380886 100644 --- a/lib/msun/src/s_floorf.c +++ b/lib/msun/src/s_floorf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_floorf.c,v 1.2 1994/08/18 23:06:48 jtc Exp $"; +static char rcsid[] = "$Id: s_floorf.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; #endif /* @@ -49,7 +49,7 @@ static float huge = 1.0e30; if(j0<23) { if(j0<0) { /* raise inexact if x != 0 */ if(huge+x>(float)0.0) {/* return 0*sign(x) if |x|<1 */ - if(i0>=0) {i0=0;} + if(i0>=0) {i0=0;} else if((i0&0x7fffffff)!=0) { i0=0xbf800000;} } diff --git a/lib/msun/src/s_frexp.c b/lib/msun/src/s_frexp.c index 00d344f72d37..6a1fadf97849 100644 --- a/lib/msun/src/s_frexp.c +++ b/lib/msun/src/s_frexp.c @@ -5,23 +5,23 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_frexp.c,v 1.1.1.1 1994/08/19 09:39:51 jkh Exp $"; +static char rcsid[] = "$Id: s_frexp.c,v 1.2 1995/04/07 23:23:26 bde Exp $"; #endif /* - * for non-zero x + * for non-zero x * x = frexp(arg,&exp); * return a double fp quantity x such that 0.5 <= |x| <1.0 * and the corresponding binary exponent "exp". That is * arg = x*2^exp. - * If arg is inf, 0.0, or NaN, then frexp(arg,&exp) returns arg - * with *exp=0. + * If arg is inf, 0.0, or NaN, then frexp(arg,&exp) returns arg + * with *exp=0. */ #include "math.h" diff --git a/lib/msun/src/s_frexpf.c b/lib/msun/src/s_frexpf.c index 6988cbe5d07e..ee97029b6f4d 100644 --- a/lib/msun/src/s_frexpf.c +++ b/lib/msun/src/s_frexpf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_frexpf.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; +static char rcsid[] = "$Id: s_frexpf.c,v 1.2 1995/04/07 23:23:27 bde Exp $"; #endif #include "math.h" diff --git a/lib/msun/src/s_ilogb.c b/lib/msun/src/s_ilogb.c index 1514cc41bd85..c6263d80b87a 100644 --- a/lib/msun/src/s_ilogb.c +++ b/lib/msun/src/s_ilogb.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_ilogb.c,v 1.6 1994/08/18 23:06:52 jtc Exp $"; +static char rcsid[] = "$Id: s_ilogb.c,v 1.1.1.1 1994/08/19 09:39:52 jkh Exp $"; #endif /* ilogb(double x) @@ -35,7 +35,7 @@ static char rcsid[] = "$Id: s_ilogb.c,v 1.6 1994/08/18 23:06:52 jtc Exp $"; EXTRACT_WORDS(hx,lx,x); hx &= 0x7fffffff; if(hx<0x00100000) { - if((hx|lx)==0) + if((hx|lx)==0) return 0x80000001; /* ilogb(0) = 0x80000001 */ else /* subnormal x */ if(hx==0) { diff --git a/lib/msun/src/s_ilogbf.c b/lib/msun/src/s_ilogbf.c index 86bdda636d47..8c0f162a908d 100644 --- a/lib/msun/src/s_ilogbf.c +++ b/lib/msun/src/s_ilogbf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_ilogbf.c,v 1.2 1994/08/18 23:06:53 jtc Exp $"; +static char rcsid[] = "$Id: s_ilogbf.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; #endif #include "math.h" @@ -32,7 +32,7 @@ static char rcsid[] = "$Id: s_ilogbf.c,v 1.2 1994/08/18 23:06:53 jtc Exp $"; GET_FLOAT_WORD(hx,x); hx &= 0x7fffffff; if(hx<0x00800000) { - if(hx==0) + if(hx==0) return 0x80000001; /* ilogb(0) = 0x80000001 */ else /* subnormal x */ for (ix = -126,hx<<=8; hx>0; hx<<=1) ix -=1; diff --git a/lib/msun/src/s_isnan.c b/lib/msun/src/s_isnan.c index 3f18f7dc2649..677913f5c114 100644 --- a/lib/msun/src/s_isnan.c +++ b/lib/msun/src/s_isnan.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_isnan.c,v 1.6 1994/08/18 23:06:54 jtc Exp $"; +static char rcsid[] = "$Id: s_isnan.c,v 1.1.1.1 1994/08/19 09:39:52 jkh Exp $"; #endif /* @@ -32,7 +32,7 @@ static char rcsid[] = "$Id: s_isnan.c,v 1.6 1994/08/18 23:06:54 jtc Exp $"; int32_t hx,lx; EXTRACT_WORDS(hx,lx,x); hx &= 0x7fffffff; - hx |= (u_int32_t)(lx|(-lx))>>31; + hx |= (u_int32_t)(lx|(-lx))>>31; hx = 0x7ff00000 - hx; return (int)((u_int32_t)(hx))>>31; } diff --git a/lib/msun/src/s_isnanf.c b/lib/msun/src/s_isnanf.c index 1c7458262af1..4c4e69ef01a0 100644 --- a/lib/msun/src/s_isnanf.c +++ b/lib/msun/src/s_isnanf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_isnanf.c,v 1.2 1994/08/18 23:06:56 jtc Exp $"; +static char rcsid[] = "$Id: s_isnanf.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; #endif /* diff --git a/lib/msun/src/s_ldexp.c b/lib/msun/src/s_ldexp.c index 824c2e7f180e..1d11ff2ba4b1 100644 --- a/lib/msun/src/s_ldexp.c +++ b/lib/msun/src/s_ldexp.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_ldexp.c,v 1.4 1994/08/10 20:32:37 jtc Exp $"; +static char rcsid[] = "$Id: s_ldexp.c,v 1.1.1.1 1994/08/19 09:39:52 jkh Exp $"; #endif #include "math.h" diff --git a/lib/msun/src/s_ldexpf.c b/lib/msun/src/s_ldexpf.c index cdb44764160b..7cd0ce06e2e2 100644 --- a/lib/msun/src/s_ldexpf.c +++ b/lib/msun/src/s_ldexpf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_ldexpf.c,v 1.1 1994/08/10 20:32:39 jtc Exp $"; +static char rcsid[] = "$Id: s_ldexpf.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; #endif #include "math.h" diff --git a/lib/msun/src/s_lib_version.c b/lib/msun/src/s_lib_version.c index d8c875050b57..7936f89dca0d 100644 --- a/lib/msun/src/s_lib_version.c +++ b/lib/msun/src/s_lib_version.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_lib_version.c,v 1.4 1994/08/10 20:32:40 jtc Exp $"; +static char rcsid[] = "$Id: s_lib_version.c,v 1.1.1.1 1994/08/19 09:39:52 jkh Exp $"; #endif /* diff --git a/lib/msun/src/s_log1p.c b/lib/msun/src/s_log1p.c index 475c7abb21a6..56218d4a720b 100644 --- a/lib/msun/src/s_log1p.c +++ b/lib/msun/src/s_log1p.c @@ -5,20 +5,20 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_log1p.c,v 1.6 1994/08/18 23:06:59 jtc Exp $"; +static char rcsid[] = "$Id: s_log1p.c,v 1.1.1.1 1994/08/19 09:39:52 jkh Exp $"; #endif /* double log1p(double x) * - * Method : - * 1. Argument Reduction: find k and f such that - * 1+x = 2^k * (1+f), + * Method : + * 1. Argument Reduction: find k and f such that + * 1+x = 2^k * (1+f), * where sqrt(2)/2 < 1+f < sqrt(2) . * * Note. If k=0, then f=x is exact. However, if k!=0, then f @@ -32,8 +32,8 @@ static char rcsid[] = "$Id: s_log1p.c,v 1.6 1994/08/18 23:06:59 jtc Exp $"; * Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s) * = 2s + 2/3 s**3 + 2/5 s**5 + ....., * = 2s + s*R - * We use a special Reme algorithm on [0,0.1716] to generate - * a polynomial of degree 14 to approximate R The maximum error + * We use a special Reme algorithm on [0,0.1716] to generate + * a polynomial of degree 14 to approximate R The maximum error * of this polynomial approximation is bounded by 2**-58.45. In * other words, * 2 4 6 8 10 12 14 @@ -41,21 +41,21 @@ static char rcsid[] = "$Id: s_log1p.c,v 1.6 1994/08/18 23:06:59 jtc Exp $"; * (the values of Lp1 to Lp7 are listed in the program) * and * | 2 14 | -58.45 - * | Lp1*s +...+Lp7*s - R(z) | <= 2 + * | Lp1*s +...+Lp7*s - R(z) | <= 2 * | | * Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2. * In order to guarantee error in log below 1ulp, we compute log * by * log1p(f) = f - (hfsq - s*(hfsq+R)). - * - * 3. Finally, log1p(x) = k*ln2 + log1p(f). + * + * 3. Finally, log1p(x) = k*ln2 + log1p(f). * = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo))) - * Here ln2 is split into two floating point number: + * Here ln2 is split into two floating point number: * ln2_hi + ln2_lo, * where n*ln2_hi is always exact for |n| < 2000. * * Special cases: - * log1p(x) is NaN with signal if x < -1 (including -INF) ; + * log1p(x) is NaN with signal if x < -1 (including -INF) ; * log1p(+INF) is +INF; log1p(-1) is -INF with signal; * log1p(NaN) is that NaN with no signal. * @@ -64,14 +64,14 @@ static char rcsid[] = "$Id: s_log1p.c,v 1.6 1994/08/18 23:06:59 jtc Exp $"; * 1 ulp (unit in the last place). * * Constants: - * The hexadecimal values are the intended ones for the following - * constants. The decimal values may be used, provided that the - * compiler will convert from decimal to binary accurately enough + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough * to produce the hexadecimal values shown. * * Note: Assuming log() return accurate answer, the following * algorithm can be used to compute log1p(x) to within a few ULP: - * + * * u = 1+x; * if(u==1.0) return x ; else * return log(u)*(x/(u-1.0)); @@ -132,11 +132,11 @@ static double zero = 0.0; } if(hx>0||hx<=((int32_t)0xbfd2bec3)) { k=0;f=x;hu=1;} /* -0.2929<x<0.41422 */ - } + } if (hx >= 0x7ff00000) return x+x; if(k!=0) { if(hx<0x43400000) { - u = 1.0+x; + u = 1.0+x; GET_HIGH_WORD(hu,u); k = (hu>>20)-1023; c = (k>0)? 1.0-(u-x):x-(u-1.0);/* correction term */ @@ -151,7 +151,7 @@ static double zero = 0.0; if(hu<0x6a09e) { SET_HIGH_WORD(u,hu|0x3ff00000); /* normalize u */ } else { - k += 1; + k += 1; SET_HIGH_WORD(u,hu|0x3fe00000); /* normalize u/2 */ hu = (0x00100000-hu)>>2; } @@ -159,13 +159,13 @@ static double zero = 0.0; } hfsq=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*(1.0-0.66666666666666666*f); if(k==0) return f-R; else return k*ln2_hi-((R-(k*ln2_lo+c))-f); } - s = f/(2.0+f); + s = f/(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 diff --git a/lib/msun/src/s_log1pf.c b/lib/msun/src/s_log1pf.c index 229bb82b7230..4c4f65244850 100644 --- a/lib/msun/src/s_log1pf.c +++ b/lib/msun/src/s_log1pf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_log1pf.c,v 1.2 1994/08/18 23:07:02 jtc Exp $"; +static char rcsid[] = "$Id: s_log1pf.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; #endif #include "math.h" @@ -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 diff --git a/lib/msun/src/s_logb.c b/lib/msun/src/s_logb.c index d842cbf65605..96e8fc46b61e 100644 --- a/lib/msun/src/s_logb.c +++ b/lib/msun/src/s_logb.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_logb.c,v 1.6 1994/08/18 23:07:04 jtc Exp $"; +static char rcsid[] = "$Id: s_logb.c,v 1.1.1.1 1994/08/19 09:39:52 jkh Exp $"; #endif /* @@ -36,7 +36,7 @@ static char rcsid[] = "$Id: s_logb.c,v 1.6 1994/08/18 23:07:04 jtc Exp $"; if((ix|lx)==0) return -1.0/fabs(x); if(ix>=0x7ff00000) return x*x; if((ix>>=20)==0) /* IEEE 754 logb */ - return -1022.0; + return -1022.0; else - return (double) (ix-1023); + return (double) (ix-1023); } diff --git a/lib/msun/src/s_logbf.c b/lib/msun/src/s_logbf.c index 0ee1bbe0b585..ddc0a04d8f86 100644 --- a/lib/msun/src/s_logbf.c +++ b/lib/msun/src/s_logbf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_logbf.c,v 1.2 1994/08/18 23:07:07 jtc Exp $"; +static char rcsid[] = "$Id: s_logbf.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; #endif #include "math.h" @@ -33,7 +33,7 @@ static char rcsid[] = "$Id: s_logbf.c,v 1.2 1994/08/18 23:07:07 jtc Exp $"; if(ix==0) return (float)-1.0/fabsf(x); if(ix>=0x7f800000) return x*x; if((ix>>=23)==0) /* IEEE 754 logb */ - return -126.0; + return -126.0; else - return (float) (ix-127); + return (float) (ix-127); } diff --git a/lib/msun/src/s_matherr.c b/lib/msun/src/s_matherr.c index 102cde385117..219a88c48b02 100644 --- a/lib/msun/src/s_matherr.c +++ b/lib/msun/src/s_matherr.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_matherr.c,v 1.4 1994/08/10 20:32:52 jtc Exp $"; +static char rcsid[] = "$Id: s_matherr.c,v 1.1.1.1 1994/08/19 09:39:52 jkh Exp $"; #endif #include "math.h" diff --git a/lib/msun/src/s_modf.c b/lib/msun/src/s_modf.c index 2a3d24387f60..b0ebbd0ff03b 100644 --- a/lib/msun/src/s_modf.c +++ b/lib/msun/src/s_modf.c @@ -5,17 +5,17 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_modf.c,v 1.6 1994/08/18 23:07:09 jtc Exp $"; +static char rcsid[] = "$Id: s_modf.c,v 1.1.1.1 1994/08/19 09:39:52 jkh Exp $"; #endif /* - * modf(double x, double *iptr) + * modf(double x, double *iptr) * return fraction part of x, and return x's integral part in *iptr. * Method: * Bit twiddling. diff --git a/lib/msun/src/s_modff.c b/lib/msun/src/s_modff.c index 63157e7edaed..d1f0e3257bc1 100644 --- a/lib/msun/src/s_modff.c +++ b/lib/msun/src/s_modff.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_modff.c,v 1.2 1994/08/18 23:07:12 jtc Exp $"; +static char rcsid[] = "$Id: s_modff.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; #endif #include "math.h" diff --git a/lib/msun/src/s_nextafter.c b/lib/msun/src/s_nextafter.c index be480bc4d46d..1936fad89e0f 100644 --- a/lib/msun/src/s_nextafter.c +++ b/lib/msun/src/s_nextafter.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_nextafter.c,v 1.6 1994/08/18 23:07:13 jtc Exp $"; +static char rcsid[] = "$Id: s_nextafter.c,v 1.1.1.1 1994/08/19 09:39:52 jkh Exp $"; #endif /* IEEE functions @@ -39,15 +39,15 @@ static char rcsid[] = "$Id: s_nextafter.c,v 1.6 1994/08/18 23:07:13 jtc Exp $"; ix = hx&0x7fffffff; /* |x| */ iy = hy&0x7fffffff; /* |y| */ - if(((ix>=0x7ff00000)&&((ix-0x7ff00000)|lx)!=0) || /* x is nan */ - ((iy>=0x7ff00000)&&((iy-0x7ff00000)|ly)!=0)) /* y is nan */ - return x+y; + if(((ix>=0x7ff00000)&&((ix-0x7ff00000)|lx)!=0) || /* x is nan */ + ((iy>=0x7ff00000)&&((iy-0x7ff00000)|ly)!=0)) /* y is nan */ + return x+y; if(x==y) return x; /* x=y, return x */ if((ix|lx)==0) { /* x == 0 */ INSERT_WORDS(x,hy&0x80000000,1); /* return +-minsubnormal */ y = x*x; if(y==x) return y; else return x; /* raise underflow flag */ - } + } if(hx>=0) { /* x > 0 */ if(hx>hy||((hx==hy)&&(lx>ly))) { /* x > y, x -= ulp */ if(lx==0) hx -= 1; diff --git a/lib/msun/src/s_nextafterf.c b/lib/msun/src/s_nextafterf.c index fa3a21139482..bd870705acc9 100644 --- a/lib/msun/src/s_nextafterf.c +++ b/lib/msun/src/s_nextafterf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_nextafterf.c,v 1.2 1994/08/18 23:07:15 jtc Exp $"; +static char rcsid[] = "$Id: s_nextafterf.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; #endif #include "math.h" @@ -34,15 +34,15 @@ static char rcsid[] = "$Id: s_nextafterf.c,v 1.2 1994/08/18 23:07:15 jtc Exp $"; ix = hx&0x7fffffff; /* |x| */ iy = hy&0x7fffffff; /* |y| */ - if((ix>0x7f800000) || /* x is nan */ - (iy>0x7f800000)) /* y is nan */ - return x+y; + if((ix>0x7f800000) || /* x is nan */ + (iy>0x7f800000)) /* y is nan */ + return x+y; if(x==y) return x; /* x=y, return x */ if(ix==0) { /* x == 0 */ SET_FLOAT_WORD(x,(hy&0x80000000)|1);/* return +-minsubnormal */ y = x*x; if(y==x) return y; else return x; /* raise underflow flag */ - } + } if(hx>=0) { /* x > 0 */ if(hx>hy) { /* x > y, x -= ulp */ hx -= 1; diff --git a/lib/msun/src/s_rint.c b/lib/msun/src/s_rint.c index b324ed54fc94..3476eeff4cad 100644 --- a/lib/msun/src/s_rint.c +++ b/lib/msun/src/s_rint.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_rint.c,v 1.6 1994/08/18 23:07:16 jtc Exp $"; +static char rcsid[] = "$Id: s_rint.c,v 1.1.1.1 1994/08/19 09:39:52 jkh Exp $"; #endif /* @@ -30,7 +30,7 @@ static char rcsid[] = "$Id: s_rint.c,v 1.6 1994/08/18 23:07:16 jtc Exp $"; #ifdef __STDC__ static const double #else -static double +static double #endif TWO52[2]={ 4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */ @@ -51,7 +51,7 @@ TWO52[2]={ sx = (i0>>31)&1; j0 = ((i0>>20)&0x7ff)-0x3ff; if(j0<20) { - if(j0<0) { + if(j0<0) { if(((i0&0x7fffffff)|i1)==0) return x; i1 |= (i0&0x0fffff); i0 &= 0xfffe0000; diff --git a/lib/msun/src/s_rintf.c b/lib/msun/src/s_rintf.c index 855442f2e543..4e77aab2391d 100644 --- a/lib/msun/src/s_rintf.c +++ b/lib/msun/src/s_rintf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_rintf.c,v 1.2 1994/08/18 23:07:17 jtc Exp $"; +static char rcsid[] = "$Id: s_rintf.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; #endif #include "math.h" @@ -23,7 +23,7 @@ static char rcsid[] = "$Id: s_rintf.c,v 1.2 1994/08/18 23:07:17 jtc Exp $"; #ifdef __STDC__ static const float #else -static float +static float #endif TWO23[2]={ 8.3886080000e+06, /* 0x4b000000 */ @@ -44,7 +44,7 @@ TWO23[2]={ sx = (i0>>31)&1; j0 = ((i0>>23)&0xff)-0x7f; if(j0<23) { - if(j0<0) { + if(j0<0) { if((i0&0x7fffffff)==0) return x; i1 = (i0&0x07fffff); i0 &= 0xfff00000; diff --git a/lib/msun/src/s_scalbn.c b/lib/msun/src/s_scalbn.c index 1effa62e54f8..6549931fb34d 100644 --- a/lib/msun/src/s_scalbn.c +++ b/lib/msun/src/s_scalbn.c @@ -5,19 +5,19 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_scalbn.c,v 1.6 1994/08/18 23:10:13 jtc Exp $"; +static char rcsid[] = "$Id: s_scalbn.c,v 1.1.1.1 1994/08/19 09:39:52 jkh Exp $"; #endif -/* +/* * scalbn (double x, int n) - * scalbn(x,n) returns x* 2**n computed by exponent - * manipulation rather than by actually performing an + * scalbn(x,n) returns x* 2**n computed by exponent + * manipulation rather than by actually performing an * exponentiation or a multiplication. */ @@ -46,13 +46,13 @@ tiny = 1.0e-300; k = (hx&0x7ff00000)>>20; /* extract exponent */ if (k==0) { /* 0 or subnormal x */ if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */ - x *= two54; + x *= two54; GET_HIGH_WORD(hx,x); - k = ((hx&0x7ff00000)>>20) - 54; + k = ((hx&0x7ff00000)>>20) - 54; if (n< -50000) return tiny*x; /*underflow*/ } if (k==0x7ff) return x+x; /* NaN or Inf */ - k = k+n; + k = k+n; if (k > 0x7fe) return huge*copysign(huge,x); /* overflow */ if (k > 0) /* normal result */ {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;} diff --git a/lib/msun/src/s_scalbnf.c b/lib/msun/src/s_scalbnf.c index bae30d965cc0..08b16406a95a 100644 --- a/lib/msun/src/s_scalbnf.c +++ b/lib/msun/src/s_scalbnf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_scalbnf.c,v 1.2 1994/08/18 23:10:15 jtc Exp $"; +static char rcsid[] = "$Id: s_scalbnf.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; #endif #include "math.h" @@ -44,11 +44,11 @@ tiny = 1.0e-30; if ((ix&0x7fffffff)==0) return x; /* +-0 */ x *= two25; GET_FLOAT_WORD(ix,x); - k = ((ix&0x7f800000)>>23) - 25; + k = ((ix&0x7f800000)>>23) - 25; if (n< -50000) return tiny*x; /*underflow*/ } if (k==0xff) return x+x; /* NaN or Inf */ - k = k+n; + k = k+n; if (k > 0xfe) return huge*copysignf(huge,x); /* overflow */ if (k > 0) /* normal result */ {SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); return x;} diff --git a/lib/msun/src/s_significand.c b/lib/msun/src/s_significand.c index 424dbe9658b4..b30e6f290d77 100644 --- a/lib/msun/src/s_significand.c +++ b/lib/msun/src/s_significand.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_significand.c,v 1.4 1994/08/10 20:33:06 jtc Exp $"; +static char rcsid[] = "$Id: s_significand.c,v 1.1.1.1 1994/08/19 09:39:52 jkh Exp $"; #endif /* diff --git a/lib/msun/src/s_significandf.c b/lib/msun/src/s_significandf.c index 883b3394c6c6..445f264151e4 100644 --- a/lib/msun/src/s_significandf.c +++ b/lib/msun/src/s_significandf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_significandf.c,v 1.1 1994/08/10 20:33:07 jtc Exp $"; +static char rcsid[] = "$Id: s_significandf.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; #endif #include "math.h" diff --git a/lib/msun/src/s_sin.c b/lib/msun/src/s_sin.c index eff762aafa4f..a06d8b084d28 100644 --- a/lib/msun/src/s_sin.c +++ b/lib/msun/src/s_sin.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_sin.c,v 1.5 1994/08/18 23:10:17 jtc Exp $"; +static char rcsid[] = "$Id: s_sin.c,v 1.1.1.1 1994/08/19 09:39:52 jkh Exp $"; #endif /* sin(x) @@ -23,8 +23,8 @@ static char rcsid[] = "$Id: s_sin.c,v 1.5 1994/08/18 23:10:17 jtc Exp $"; * __ieee754_rem_pio2 ... argument reduction routine * * Method. - * Let S,C and T denote the sin, cos and tan respectively on - * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 + * Let S,C and T denote the sin, cos and tan respectively on + * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 * in [-pi/4 , +pi/4], and let n = k mod 4. * We have * @@ -42,7 +42,7 @@ static char rcsid[] = "$Id: s_sin.c,v 1.5 1994/08/18 23:10:17 jtc Exp $"; * trig(NaN) is that NaN; * * Accuracy: - * TRIG(x) returns trig(x) nearly rounded + * TRIG(x) returns trig(x) nearly rounded */ #include "math.h" diff --git a/lib/msun/src/s_sinf.c b/lib/msun/src/s_sinf.c index b2fafe298823..69b4841191e4 100644 --- a/lib/msun/src/s_sinf.c +++ b/lib/msun/src/s_sinf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_sinf.c,v 1.2 1994/08/18 23:10:18 jtc Exp $"; +static char rcsid[] = "$Id: s_sinf.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; #endif #include "math.h" diff --git a/lib/msun/src/s_tan.c b/lib/msun/src/s_tan.c index 97f7849ce63c..24a406323d27 100644 --- a/lib/msun/src/s_tan.c +++ b/lib/msun/src/s_tan.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_tan.c,v 1.5 1994/08/18 23:10:19 jtc Exp $"; +static char rcsid[] = "$Id: s_tan.c,v 1.1.1.1 1994/08/19 09:39:53 jkh Exp $"; #endif /* tan(x) @@ -22,8 +22,8 @@ static char rcsid[] = "$Id: s_tan.c,v 1.5 1994/08/18 23:10:19 jtc Exp $"; * __ieee754_rem_pio2 ... argument reduction routine * * Method. - * Let S,C and T denote the sin, cos and tan respectively on - * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 + * Let S,C and T denote the sin, cos and tan respectively on + * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 * in [-pi/4 , +pi/4], and let n = k mod 4. * We have * @@ -41,7 +41,7 @@ static char rcsid[] = "$Id: s_tan.c,v 1.5 1994/08/18 23:10:19 jtc Exp $"; * trig(NaN) is that NaN; * * Accuracy: - * TRIG(x) returns trig(x) nearly rounded + * TRIG(x) returns trig(x) nearly rounded */ #include "math.h" diff --git a/lib/msun/src/s_tanf.c b/lib/msun/src/s_tanf.c index dd993a65b11f..0fb7e19c411c 100644 --- a/lib/msun/src/s_tanf.c +++ b/lib/msun/src/s_tanf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_tanf.c,v 1.2 1994/08/18 23:10:20 jtc Exp $"; +static char rcsid[] = "$Id: s_tanf.c,v 1.1.1.1 1994/08/19 09:39:58 jkh Exp $"; #endif #include "math.h" diff --git a/lib/msun/src/s_tanh.c b/lib/msun/src/s_tanh.c index c987a1a9b96e..dc1baaab9b9e 100644 --- a/lib/msun/src/s_tanh.c +++ b/lib/msun/src/s_tanh.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_tanh.c,v 1.5 1994/08/18 23:10:22 jtc Exp $"; +static char rcsid[] = "$Id: s_tanh.c,v 1.1.1.1 1994/08/19 09:39:53 jkh Exp $"; #endif /* Tanh(x) @@ -62,7 +62,7 @@ static double one=1.0, two=2.0, tiny = 1.0e-300; ix = jx&0x7fffffff; /* x is INF or NaN */ - if(ix>=0x7ff00000) { + if(ix>=0x7ff00000) { if (jx>=0) return one/x+one; /* tanh(+-inf)=+-1 */ else return one/x-one; /* tanh(NaN) = NaN */ } diff --git a/lib/msun/src/s_tanhf.c b/lib/msun/src/s_tanhf.c index aa1417627cf2..47908316047b 100644 --- a/lib/msun/src/s_tanhf.c +++ b/lib/msun/src/s_tanhf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: s_tanhf.c,v 1.2 1994/08/18 23:10:23 jtc Exp $"; +static char rcsid[] = "$Id: s_tanhf.c,v 1.1.1.1 1994/08/19 09:39:59 jkh Exp $"; #endif #include "math.h" @@ -40,7 +40,7 @@ static float one=1.0, two=2.0, tiny = 1.0e-30; ix = jx&0x7fffffff; /* x is INF or NaN */ - if(ix>=0x7f800000) { + if(ix>=0x7f800000) { if (jx>=0) return one/x+one; /* tanh(+-inf)=+-1 */ else return one/x-one; /* tanh(NaN) = NaN */ } diff --git a/lib/msun/src/w_acos.c b/lib/msun/src/w_acos.c index b5fefebd4907..af5f0227edf7 100644 --- a/lib/msun/src/w_acos.c +++ b/lib/msun/src/w_acos.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_acos.c,v 1.4 1994/08/10 20:33:18 jtc Exp $"; +static char rcsid[] = "$Id: w_acos.c,v 1.1.1.1 1994/08/19 09:39:53 jkh Exp $"; #endif /* diff --git a/lib/msun/src/w_acosf.c b/lib/msun/src/w_acosf.c index 6c8fc6f9c74e..1501235e3c40 100644 --- a/lib/msun/src/w_acosf.c +++ b/lib/msun/src/w_acosf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_acosf.c,v 1.1 1994/08/10 20:33:23 jtc Exp $"; +static char rcsid[] = "$Id: w_acosf.c,v 1.1.1.1 1994/08/19 09:39:59 jkh Exp $"; #endif /* diff --git a/lib/msun/src/w_acosh.c b/lib/msun/src/w_acosh.c index 306cd3160d1d..d32cd3d32d47 100644 --- a/lib/msun/src/w_acosh.c +++ b/lib/msun/src/w_acosh.c @@ -5,16 +5,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_acosh.c,v 1.4 1994/08/10 20:33:25 jtc Exp $"; +static char rcsid[] = "$Id: w_acosh.c,v 1.1.1.1 1994/08/19 09:39:53 jkh Exp $"; #endif -/* +/* * wrapper acosh(x) */ diff --git a/lib/msun/src/w_acoshf.c b/lib/msun/src/w_acoshf.c index 5ba01e468adb..232685309174 100644 --- a/lib/msun/src/w_acoshf.c +++ b/lib/msun/src/w_acoshf.c @@ -8,17 +8,17 @@ * * 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. * ==================================================== * */ #ifndef lint -static char rcsid[] = "$Id: w_acoshf.c,v 1.1 1994/08/10 20:33:28 jtc Exp $"; +static char rcsid[] = "$Id: w_acoshf.c,v 1.1.1.1 1994/08/19 09:39:59 jkh Exp $"; #endif -/* +/* * wrapper acoshf(x) */ diff --git a/lib/msun/src/w_asin.c b/lib/msun/src/w_asin.c index f28c0183978b..7174df657fa1 100644 --- a/lib/msun/src/w_asin.c +++ b/lib/msun/src/w_asin.c @@ -5,16 +5,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_asin.c,v 1.4 1994/08/10 20:33:30 jtc Exp $"; +static char rcsid[] = "$Id: w_asin.c,v 1.1.1.1 1994/08/19 09:39:53 jkh Exp $"; #endif -/* +/* * wrapper asin(x) */ diff --git a/lib/msun/src/w_asinf.c b/lib/msun/src/w_asinf.c index bdad94304459..fdc08d4b7ff5 100644 --- a/lib/msun/src/w_asinf.c +++ b/lib/msun/src/w_asinf.c @@ -8,16 +8,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_asinf.c,v 1.1 1994/08/10 20:33:34 jtc Exp $"; +static char rcsid[] = "$Id: w_asinf.c,v 1.1.1.1 1994/08/19 09:39:59 jkh Exp $"; #endif -/* +/* * wrapper asinf(x) */ diff --git a/lib/msun/src/w_atan2.c b/lib/msun/src/w_atan2.c index 1d4055d896be..b408ad6e561a 100644 --- a/lib/msun/src/w_atan2.c +++ b/lib/msun/src/w_atan2.c @@ -5,16 +5,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_atan2.c,v 1.4 1994/08/10 20:33:38 jtc Exp $"; +static char rcsid[] = "$Id: w_atan2.c,v 1.1.1.1 1994/08/19 09:39:53 jkh Exp $"; #endif -/* +/* * wrapper atan2(y,x) */ diff --git a/lib/msun/src/w_atan2f.c b/lib/msun/src/w_atan2f.c index 376e3c03b4c6..403cc52f22d2 100644 --- a/lib/msun/src/w_atan2f.c +++ b/lib/msun/src/w_atan2f.c @@ -8,16 +8,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_atan2f.c,v 1.1 1994/08/10 20:33:41 jtc Exp $"; +static char rcsid[] = "$Id: w_atan2f.c,v 1.1.1.1 1994/08/19 09:39:59 jkh Exp $"; #endif -/* +/* * wrapper atan2f(y,x) */ diff --git a/lib/msun/src/w_atanh.c b/lib/msun/src/w_atanh.c index 5c4d32768d08..c0774220be44 100644 --- a/lib/msun/src/w_atanh.c +++ b/lib/msun/src/w_atanh.c @@ -5,16 +5,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_atanh.c,v 1.4 1994/08/10 20:33:45 jtc Exp $"; +static char rcsid[] = "$Id: w_atanh.c,v 1.1.1.1 1994/08/19 09:39:53 jkh Exp $"; #endif -/* +/* * wrapper atanh(x) */ @@ -39,7 +39,7 @@ static char rcsid[] = "$Id: w_atanh.c,v 1.4 1994/08/10 20:33:45 jtc Exp $"; if(y>=1.0) { if(y>1.0) return __kernel_standard(x,x,30); /* atanh(|x|>1) */ - else + else return __kernel_standard(x,x,31); /* atanh(|x|==1) */ } else return z; diff --git a/lib/msun/src/w_atanhf.c b/lib/msun/src/w_atanhf.c index cbf844162dec..8e6fe1a185e1 100644 --- a/lib/msun/src/w_atanhf.c +++ b/lib/msun/src/w_atanhf.c @@ -8,16 +8,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_atanhf.c,v 1.1 1994/08/10 20:33:48 jtc Exp $"; +static char rcsid[] = "$Id: w_atanhf.c,v 1.1.1.1 1994/08/19 09:39:59 jkh Exp $"; #endif -/* +/* * wrapper atanhf(x) */ @@ -43,7 +43,7 @@ static char rcsid[] = "$Id: w_atanhf.c,v 1.1 1994/08/10 20:33:48 jtc Exp $"; if(y>(float)1.0) /* atanhf(|x|>1) */ return (float)__kernel_standard((double)x,(double)x,130); - else + else /* atanhf(|x|==1) */ return (float)__kernel_standard((double)x,(double)x,131); } else diff --git a/lib/msun/src/w_cabs.c b/lib/msun/src/w_cabs.c index a62592b2feea..b140515973f9 100644 --- a/lib/msun/src/w_cabs.c +++ b/lib/msun/src/w_cabs.c @@ -1,6 +1,6 @@ /* * cabs() wrapper for hypot(). - * + * * Written by J.T. Conklin, <jtc@wimsey.com> * Placed into the Public Domain, 1994. */ diff --git a/lib/msun/src/w_cabsf.c b/lib/msun/src/w_cabsf.c index d957a06908a6..6336d6d54564 100644 --- a/lib/msun/src/w_cabsf.c +++ b/lib/msun/src/w_cabsf.c @@ -1,6 +1,6 @@ /* * cabsf() wrapper for hypotf(). - * + * * Written by J.T. Conklin, <jtc@wimsey.com> * Placed into the Public Domain, 1994. */ diff --git a/lib/msun/src/w_cosh.c b/lib/msun/src/w_cosh.c index 02d3a3cadac7..5386838ffc72 100644 --- a/lib/msun/src/w_cosh.c +++ b/lib/msun/src/w_cosh.c @@ -5,16 +5,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_cosh.c,v 1.4 1994/08/10 20:33:54 jtc Exp $"; +static char rcsid[] = "$Id: w_cosh.c,v 1.1.1.1 1994/08/19 09:39:53 jkh Exp $"; #endif -/* +/* * wrapper cosh(x) */ @@ -34,7 +34,7 @@ static char rcsid[] = "$Id: w_cosh.c,v 1.4 1994/08/10 20:33:54 jtc Exp $"; double z; z = __ieee754_cosh(x); if(_LIB_VERSION == _IEEE_ || isnan(x)) return z; - if(fabs(x)>7.10475860073943863426e+02) { + if(fabs(x)>7.10475860073943863426e+02) { return __kernel_standard(x,x,5); /* cosh overflow */ } else return z; diff --git a/lib/msun/src/w_coshf.c b/lib/msun/src/w_coshf.c index eddc5f58dd2d..64fd579640f6 100644 --- a/lib/msun/src/w_coshf.c +++ b/lib/msun/src/w_coshf.c @@ -8,16 +8,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_coshf.c,v 1.1 1994/08/10 20:33:56 jtc Exp $"; +static char rcsid[] = "$Id: w_coshf.c,v 1.1.1.1 1994/08/19 09:39:59 jkh Exp $"; #endif -/* +/* * wrapper coshf(x) */ @@ -37,7 +37,7 @@ static char rcsid[] = "$Id: w_coshf.c,v 1.1 1994/08/10 20:33:56 jtc Exp $"; float z; z = __ieee754_coshf(x); if(_LIB_VERSION == _IEEE_ || isnanf(x)) return z; - if(fabsf(x)>(float)8.9415985107e+01) { + if(fabsf(x)>(float)8.9415985107e+01) { /* cosh overflow */ return (float)__kernel_standard((double)x,(double)x,105); } else diff --git a/lib/msun/src/w_drem.c b/lib/msun/src/w_drem.c index 7f5049340381..0f6840934fef 100644 --- a/lib/msun/src/w_drem.c +++ b/lib/msun/src/w_drem.c @@ -1,6 +1,6 @@ /* * drem() wrapper for remainder(). - * + * * Written by J.T. Conklin, <jtc@wimsey.com> * Placed into the Public Domain, 1994. */ diff --git a/lib/msun/src/w_dremf.c b/lib/msun/src/w_dremf.c index 9f1de53567e2..92079a9a7bf3 100644 --- a/lib/msun/src/w_dremf.c +++ b/lib/msun/src/w_dremf.c @@ -1,6 +1,6 @@ /* * dremf() wrapper for remainderf(). - * + * * Written by J.T. Conklin, <jtc@wimsey.com> * Placed into the Public Domain, 1994. */ diff --git a/lib/msun/src/w_exp.c b/lib/msun/src/w_exp.c index 80f213b25f39..0d592ee5004e 100644 --- a/lib/msun/src/w_exp.c +++ b/lib/msun/src/w_exp.c @@ -5,16 +5,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_exp.c,v 1.4 1994/08/10 20:34:00 jtc Exp $"; +static char rcsid[] = "$Id: w_exp.c,v 1.1.1.1 1994/08/19 09:39:53 jkh Exp $"; #endif -/* +/* * wrapper exp(x) */ @@ -47,7 +47,7 @@ u_threshold= -7.45133219101941108420e+02; /* 0xc0874910, 0xD52D3051 */ return __kernel_standard(x,x,6); /* exp overflow */ else if(x<u_threshold) return __kernel_standard(x,x,7); /* exp underflow */ - } + } return z; #endif } diff --git a/lib/msun/src/w_expf.c b/lib/msun/src/w_expf.c index 62a77736f067..e22a951e92c9 100644 --- a/lib/msun/src/w_expf.c +++ b/lib/msun/src/w_expf.c @@ -8,16 +8,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_expf.c,v 1.1 1994/08/10 20:34:03 jtc Exp $"; +static char rcsid[] = "$Id: w_expf.c,v 1.1.1.1 1994/08/19 09:39:59 jkh Exp $"; #endif -/* +/* * wrapper expf(x) */ @@ -52,7 +52,7 @@ u_threshold= -1.0397208405e+02; /* 0xc2cff1b5 */ else if(x<u_threshold) /* exp underflow */ return (float)__kernel_standard((double)x,(double)x,107); - } + } return z; #endif } diff --git a/lib/msun/src/w_fmod.c b/lib/msun/src/w_fmod.c index 234a3429ec64..4065409d170e 100644 --- a/lib/msun/src/w_fmod.c +++ b/lib/msun/src/w_fmod.c @@ -5,16 +5,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_fmod.c,v 1.4 1994/08/10 20:34:05 jtc Exp $"; +static char rcsid[] = "$Id: w_fmod.c,v 1.1.1.1 1994/08/19 09:39:53 jkh Exp $"; #endif -/* +/* * wrapper fmod(x,y) */ diff --git a/lib/msun/src/w_fmodf.c b/lib/msun/src/w_fmodf.c index 8081ed40b201..5c0c43209af2 100644 --- a/lib/msun/src/w_fmodf.c +++ b/lib/msun/src/w_fmodf.c @@ -8,16 +8,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_fmodf.c,v 1.1 1994/08/10 20:34:07 jtc Exp $"; +static char rcsid[] = "$Id: w_fmodf.c,v 1.1.1.1 1994/08/19 09:39:59 jkh Exp $"; #endif -/* +/* * wrapper fmodf(x,y) */ diff --git a/lib/msun/src/w_gamma.c b/lib/msun/src/w_gamma.c index f32f2863311e..bf53f1874931 100644 --- a/lib/msun/src/w_gamma.c +++ b/lib/msun/src/w_gamma.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_gamma.c,v 1.4 1994/08/10 20:34:09 jtc Exp $"; +static char rcsid[] = "$Id: w_gamma.c,v 1.1.1.1 1994/08/19 09:39:53 jkh Exp $"; #endif /* double gamma(double x) @@ -46,4 +46,4 @@ extern int signgam; } else return y; #endif -} +} diff --git a/lib/msun/src/w_gamma_r.c b/lib/msun/src/w_gamma_r.c index b31486e98588..7aad6133c320 100644 --- a/lib/msun/src/w_gamma_r.c +++ b/lib/msun/src/w_gamma_r.c @@ -5,16 +5,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_gamma_r.c,v 1.4 1994/08/10 20:34:13 jtc Exp $"; +static char rcsid[] = "$Id: w_gamma_r.c,v 1.1.1.1 1994/08/19 09:39:53 jkh Exp $"; #endif -/* +/* * wrapper double gamma_r(double x, int *signgamp) */ @@ -43,4 +43,4 @@ static char rcsid[] = "$Id: w_gamma_r.c,v 1.4 1994/08/10 20:34:13 jtc Exp $"; } else return y; #endif -} +} diff --git a/lib/msun/src/w_gammaf.c b/lib/msun/src/w_gammaf.c index 1183c79191d9..89e8f7fa26a1 100644 --- a/lib/msun/src/w_gammaf.c +++ b/lib/msun/src/w_gammaf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_gammaf.c,v 1.1 1994/08/10 20:34:16 jtc Exp $"; +static char rcsid[] = "$Id: w_gammaf.c,v 1.1.1.1 1994/08/19 09:39:59 jkh Exp $"; #endif #include "math.h" @@ -45,4 +45,4 @@ extern int signgam; } else return y; #endif -} +} diff --git a/lib/msun/src/w_gammaf_r.c b/lib/msun/src/w_gammaf_r.c index 0fd1f6c8aeac..a2585cbb300a 100644 --- a/lib/msun/src/w_gammaf_r.c +++ b/lib/msun/src/w_gammaf_r.c @@ -8,16 +8,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_gammaf_r.c,v 1.1 1994/08/10 20:34:20 jtc Exp $"; +static char rcsid[] = "$Id: w_gammaf_r.c,v 1.1.1.1 1994/08/19 09:39:59 jkh Exp $"; #endif -/* +/* * wrapper float gammaf_r(float x, int *signgamp) */ @@ -48,4 +48,4 @@ static char rcsid[] = "$Id: w_gammaf_r.c,v 1.1 1994/08/10 20:34:20 jtc Exp $"; } else return y; #endif -} +} diff --git a/lib/msun/src/w_hypot.c b/lib/msun/src/w_hypot.c index 8c61649646a2..9b6f46fcf652 100644 --- a/lib/msun/src/w_hypot.c +++ b/lib/msun/src/w_hypot.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_hypot.c,v 1.4 1994/08/10 20:34:24 jtc Exp $"; +static char rcsid[] = "$Id: w_hypot.c,v 1.1.1.1 1994/08/19 09:39:53 jkh Exp $"; #endif /* diff --git a/lib/msun/src/w_hypotf.c b/lib/msun/src/w_hypotf.c index c8ddb9747441..0b126d702cd7 100644 --- a/lib/msun/src/w_hypotf.c +++ b/lib/msun/src/w_hypotf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_hypotf.c,v 1.1 1994/08/10 20:34:27 jtc Exp $"; +static char rcsid[] = "$Id: w_hypotf.c,v 1.1.1.1 1994/08/19 09:39:59 jkh Exp $"; #endif /* diff --git a/lib/msun/src/w_j0.c b/lib/msun/src/w_j0.c index 199f85167c24..c5b9fe053584 100644 --- a/lib/msun/src/w_j0.c +++ b/lib/msun/src/w_j0.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_j0.c,v 1.4 1994/08/10 20:34:29 jtc Exp $"; +static char rcsid[] = "$Id: w_j0.c,v 1.1.1.1 1994/08/19 09:39:53 jkh Exp $"; #endif /* diff --git a/lib/msun/src/w_j0f.c b/lib/msun/src/w_j0f.c index 33e201c6b0a3..e836edc55f5c 100644 --- a/lib/msun/src/w_j0f.c +++ b/lib/msun/src/w_j0f.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_j0f.c,v 1.1 1994/08/10 20:34:32 jtc Exp $"; +static char rcsid[] = "$Id: w_j0f.c,v 1.1.1.1 1994/08/19 09:39:57 jkh Exp $"; #endif /* diff --git a/lib/msun/src/w_j1.c b/lib/msun/src/w_j1.c index 38792b6a3ffa..c0204bd94c84 100644 --- a/lib/msun/src/w_j1.c +++ b/lib/msun/src/w_j1.c @@ -5,17 +5,17 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_j1.c,v 1.4 1994/08/10 20:34:35 jtc Exp $"; +static char rcsid[] = "$Id: w_j1.c,v 1.1.1.1 1994/08/19 09:39:53 jkh Exp $"; #endif -/* - * wrapper of j1,y1 +/* + * wrapper of j1,y1 */ #include "math.h" diff --git a/lib/msun/src/w_j1f.c b/lib/msun/src/w_j1f.c index 506b8235ff74..60b9e21abcd2 100644 --- a/lib/msun/src/w_j1f.c +++ b/lib/msun/src/w_j1f.c @@ -8,17 +8,17 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_j1f.c,v 1.1 1994/08/10 20:34:39 jtc Exp $"; +static char rcsid[] = "$Id: w_j1f.c,v 1.1.1.1 1994/08/19 09:39:59 jkh Exp $"; #endif -/* - * wrapper of j1f,y1f +/* + * wrapper of j1f,y1f */ #include "math.h" diff --git a/lib/msun/src/w_jn.c b/lib/msun/src/w_jn.c index 986265043188..2fb8365ecd99 100644 --- a/lib/msun/src/w_jn.c +++ b/lib/msun/src/w_jn.c @@ -5,20 +5,20 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_jn.c,v 1.4 1994/08/10 20:34:42 jtc Exp $"; +static char rcsid[] = "$Id: w_jn.c,v 1.1.1.1 1994/08/19 09:39:53 jkh Exp $"; #endif /* * wrapper jn(int n, double x), yn(int n, double x) * floating point Bessel's function of the 1st and 2nd kind * of order n - * + * * Special cases: * y0(0)=y1(0)=yn(n,0) = -inf with division by zero signal; * y0(-ve)=y1(-ve)=yn(n,-ve) are NaN with invalid signal. @@ -37,7 +37,7 @@ static char rcsid[] = "$Id: w_jn.c,v 1.4 1994/08/10 20:34:42 jtc Exp $"; * yn(n,x) is similar in all respects, except * that forward recursion is used for all * values of n>1. - * + * */ #include "math.h" diff --git a/lib/msun/src/w_jnf.c b/lib/msun/src/w_jnf.c index 0b338009322d..00b2ddfa3de0 100644 --- a/lib/msun/src/w_jnf.c +++ b/lib/msun/src/w_jnf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_jnf.c,v 1.1 1994/08/10 20:34:47 jtc Exp $"; +static char rcsid[] = "$Id: w_jnf.c,v 1.1.1.1 1994/08/19 09:39:59 jkh Exp $"; #endif #include "math.h" diff --git a/lib/msun/src/w_lgamma.c b/lib/msun/src/w_lgamma.c index 59892e3fe9c6..f15cb9d14899 100644 --- a/lib/msun/src/w_lgamma.c +++ b/lib/msun/src/w_lgamma.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_lgamma.c,v 1.4 1994/08/10 20:34:53 jtc Exp $"; +static char rcsid[] = "$Id: w_lgamma.c,v 1.1.1.1 1994/08/19 09:39:53 jkh Exp $"; #endif /* double lgamma(double x) @@ -46,4 +46,4 @@ extern int signgam; } else return y; #endif -} +} diff --git a/lib/msun/src/w_lgamma_r.c b/lib/msun/src/w_lgamma_r.c index 52117c07ad51..2cac60c13ba5 100644 --- a/lib/msun/src/w_lgamma_r.c +++ b/lib/msun/src/w_lgamma_r.c @@ -5,16 +5,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_lgamma_r.c,v 1.4 1994/08/10 20:34:57 jtc Exp $"; +static char rcsid[] = "$Id: w_lgamma_r.c,v 1.1.1.1 1994/08/19 09:39:54 jkh Exp $"; #endif -/* +/* * wrapper double lgamma_r(double x, int *signgamp) */ @@ -43,4 +43,4 @@ static char rcsid[] = "$Id: w_lgamma_r.c,v 1.4 1994/08/10 20:34:57 jtc Exp $"; } else return y; #endif -} +} diff --git a/lib/msun/src/w_lgammaf.c b/lib/msun/src/w_lgammaf.c index 74588f301d8c..e4b2aa20ee79 100644 --- a/lib/msun/src/w_lgammaf.c +++ b/lib/msun/src/w_lgammaf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_lgammaf.c,v 1.1 1994/08/10 20:35:00 jtc Exp $"; +static char rcsid[] = "$Id: w_lgammaf.c,v 1.1.1.1 1994/08/19 09:39:59 jkh Exp $"; #endif #include "math.h" @@ -45,4 +45,4 @@ extern int signgam; } else return y; #endif -} +} diff --git a/lib/msun/src/w_lgammaf_r.c b/lib/msun/src/w_lgammaf_r.c index 7e477e9943e7..3fd4f227c533 100644 --- a/lib/msun/src/w_lgammaf_r.c +++ b/lib/msun/src/w_lgammaf_r.c @@ -8,16 +8,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_lgammaf_r.c,v 1.1 1994/08/10 20:35:05 jtc Exp $"; +static char rcsid[] = "$Id: w_lgammaf_r.c,v 1.1.1.1 1994/08/19 09:39:59 jkh Exp $"; #endif -/* +/* * wrapper float lgammaf_r(float x, int *signgamp) */ @@ -48,4 +48,4 @@ static char rcsid[] = "$Id: w_lgammaf_r.c,v 1.1 1994/08/10 20:35:05 jtc Exp $"; } else return y; #endif -} +} diff --git a/lib/msun/src/w_log.c b/lib/msun/src/w_log.c index 26f0ae6b6eb2..e5b8afde387f 100644 --- a/lib/msun/src/w_log.c +++ b/lib/msun/src/w_log.c @@ -5,13 +5,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_log.c,v 1.4 1994/08/10 20:35:09 jtc Exp $"; +static char rcsid[] = "$Id: w_log.c,v 1.1.1.1 1994/08/19 09:39:54 jkh Exp $"; #endif /* @@ -37,7 +37,7 @@ static char rcsid[] = "$Id: w_log.c,v 1.4 1994/08/10 20:35:09 jtc Exp $"; if(_LIB_VERSION == _IEEE_ || isnan(x) || x > 0.0) return z; if(x==0.0) return __kernel_standard(x,x,16); /* log(0) */ - else + else return __kernel_standard(x,x,17); /* log(x<0) */ #endif } diff --git a/lib/msun/src/w_log10.c b/lib/msun/src/w_log10.c index d3c1f5a462d9..c09deeb78e3f 100644 --- a/lib/msun/src/w_log10.c +++ b/lib/msun/src/w_log10.c @@ -5,16 +5,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_log10.c,v 1.4 1994/08/10 20:35:15 jtc Exp $"; +static char rcsid[] = "$Id: w_log10.c,v 1.1.1.1 1994/08/19 09:39:54 jkh Exp $"; #endif -/* +/* * wrapper log10(X) */ @@ -38,7 +38,7 @@ static char rcsid[] = "$Id: w_log10.c,v 1.4 1994/08/10 20:35:15 jtc Exp $"; if(x<=0.0) { if(x==0.0) return __kernel_standard(x,x,18); /* log10(0) */ - else + else return __kernel_standard(x,x,19); /* log10(x<0) */ } else return z; diff --git a/lib/msun/src/w_log10f.c b/lib/msun/src/w_log10f.c index 1c732241547f..31a94107239f 100644 --- a/lib/msun/src/w_log10f.c +++ b/lib/msun/src/w_log10f.c @@ -8,16 +8,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_log10f.c,v 1.1 1994/08/10 20:35:20 jtc Exp $"; +static char rcsid[] = "$Id: w_log10f.c,v 1.1.1.1 1994/08/19 09:40:00 jkh Exp $"; #endif -/* +/* * wrapper log10f(X) */ @@ -42,7 +42,7 @@ static char rcsid[] = "$Id: w_log10f.c,v 1.1 1994/08/10 20:35:20 jtc Exp $"; if(x==(float)0.0) /* log10(0) */ return (float)__kernel_standard((double)x,(double)x,118); - else + else /* log10(x<0) */ return (float)__kernel_standard((double)x,(double)x,119); } else diff --git a/lib/msun/src/w_logf.c b/lib/msun/src/w_logf.c index 77dcf1e338bf..3f3f8d47aab0 100644 --- a/lib/msun/src/w_logf.c +++ b/lib/msun/src/w_logf.c @@ -8,13 +8,13 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_logf.c,v 1.1 1994/08/10 20:35:23 jtc Exp $"; +static char rcsid[] = "$Id: w_logf.c,v 1.1.1.1 1994/08/19 09:40:00 jkh Exp $"; #endif /* @@ -41,7 +41,7 @@ static char rcsid[] = "$Id: w_logf.c,v 1.1 1994/08/10 20:35:23 jtc Exp $"; if(x==(float)0.0) /* logf(0) */ return (float)__kernel_standard((double)x,(double)x,116); - else + else /* logf(x<0) */ return (float)__kernel_standard((double)x,(double)x,117); #endif diff --git a/lib/msun/src/w_pow.c b/lib/msun/src/w_pow.c index 6d87ee558f56..571897cca041 100644 --- a/lib/msun/src/w_pow.c +++ b/lib/msun/src/w_pow.c @@ -7,12 +7,12 @@ * * 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. * ==================================================== */ -/* +/* * wrapper pow(x,y) return x**y */ @@ -34,12 +34,12 @@ z=__ieee754_pow(x,y); if(_LIB_VERSION == _IEEE_|| isnan(y)) return z; if(isnan(x)) { - if(y==0.0) + if(y==0.0) return __kernel_standard(x,y,42); /* pow(NaN,0.0) */ - else + else return z; } - if(x==0.0){ + if(x==0.0){ if(y==0.0) return __kernel_standard(x,y,20); /* pow(0.0,0.0) */ if(finite(y)&&y<0.0) @@ -50,10 +50,10 @@ if(finite(x)&&finite(y)) { if(isnan(z)) return __kernel_standard(x,y,24); /* pow neg**non-int */ - else + else return __kernel_standard(x,y,21); /* pow overflow */ } - } + } if(z==0.0&&finite(x)&&finite(y)) return __kernel_standard(x,y,22); /* pow underflow */ return z; diff --git a/lib/msun/src/w_powf.c b/lib/msun/src/w_powf.c index c8ab5eb7b203..40fb91fc858e 100644 --- a/lib/msun/src/w_powf.c +++ b/lib/msun/src/w_powf.c @@ -8,16 +8,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_powf.c,v 1.1 1994/08/10 20:35:29 jtc Exp $"; +static char rcsid[] = "$Id: w_powf.c,v 1.1.1.1 1994/08/19 09:40:00 jkh Exp $"; #endif -/* +/* * wrapper powf(x,y) return x**y */ @@ -39,13 +39,13 @@ static char rcsid[] = "$Id: w_powf.c,v 1.1 1994/08/10 20:35:29 jtc Exp $"; z=__ieee754_powf(x,y); if(_LIB_VERSION == _IEEE_|| isnanf(y)) return z; if(isnanf(x)) { - if(y==(float)0.0) + if(y==(float)0.0) /* powf(NaN,0.0) */ return (float)__kernel_standard((double)x,(double)y,142); - else + else return z; } - if(x==(float)0.0){ + if(x==(float)0.0){ if(y==(float)0.0) /* powf(0.0,0.0) */ return (float)__kernel_standard((double)x,(double)y,120); @@ -59,11 +59,11 @@ static char rcsid[] = "$Id: w_powf.c,v 1.1 1994/08/10 20:35:29 jtc Exp $"; if(isnanf(z)) /* powf neg**non-int */ return (float)__kernel_standard((double)x,(double)y,124); - else + else /* powf overflow */ return (float)__kernel_standard((double)x,(double)y,121); } - } + } if(z==(float)0.0&&finitef(x)&&finitef(y)) /* powf underflow */ return (float)__kernel_standard((double)x,(double)y,122); diff --git a/lib/msun/src/w_remainder.c b/lib/msun/src/w_remainder.c index 98e4df2a472f..dd0f11215714 100644 --- a/lib/msun/src/w_remainder.c +++ b/lib/msun/src/w_remainder.c @@ -5,16 +5,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_remainder.c,v 1.4 1994/08/10 20:35:32 jtc Exp $"; +static char rcsid[] = "$Id: w_remainder.c,v 1.1.1.1 1994/08/19 09:39:54 jkh Exp $"; #endif -/* +/* * wrapper remainder(x,p) */ @@ -34,7 +34,7 @@ static char rcsid[] = "$Id: w_remainder.c,v 1.4 1994/08/10 20:35:32 jtc Exp $"; double z; z = __ieee754_remainder(x,y); if(_LIB_VERSION == _IEEE_ || isnan(y)) return z; - if(y==0.0) + if(y==0.0) return __kernel_standard(x,y,28); /* remainder(x,0) */ else return z; diff --git a/lib/msun/src/w_remainderf.c b/lib/msun/src/w_remainderf.c index ddc081890ced..a7f3e469e6cc 100644 --- a/lib/msun/src/w_remainderf.c +++ b/lib/msun/src/w_remainderf.c @@ -8,16 +8,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_remainderf.c,v 1.1 1994/08/10 20:35:35 jtc Exp $"; +static char rcsid[] = "$Id: w_remainderf.c,v 1.1.1.1 1994/08/19 09:40:00 jkh Exp $"; #endif -/* +/* * wrapper remainderf(x,p) */ @@ -37,7 +37,7 @@ static char rcsid[] = "$Id: w_remainderf.c,v 1.1 1994/08/10 20:35:35 jtc Exp $"; float z; z = __ieee754_remainderf(x,y); if(_LIB_VERSION == _IEEE_ || isnanf(y)) return z; - if(y==(float)0.0) + if(y==(float)0.0) /* remainder(x,0) */ return (float)__kernel_standard((double)x,(double)y,128); else diff --git a/lib/msun/src/w_scalb.c b/lib/msun/src/w_scalb.c index b7a7ec68e6ef..9e3ce15042c7 100644 --- a/lib/msun/src/w_scalb.c +++ b/lib/msun/src/w_scalb.c @@ -5,18 +5,18 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_scalb.c,v 1.4 1994/08/10 20:35:37 jtc Exp $"; +static char rcsid[] = "$Id: w_scalb.c,v 1.1.1.1 1994/08/19 09:39:54 jkh Exp $"; #endif /* * wrapper scalb(double x, double fn) is provide for - * passing various standard test suite. One + * passing various standard test suite. One * should use scalbn() instead. */ @@ -51,10 +51,10 @@ static char rcsid[] = "$Id: w_scalb.c,v 1.4 1994/08/10 20:35:37 jtc Exp $"; } if(z==0.0&&z!=x) { return __kernel_standard(x,(double)fn,33); /* scalb underflow */ - } + } #ifndef _SCALB_INT if(!finite(fn)) errno = ERANGE; #endif return z; -#endif +#endif } diff --git a/lib/msun/src/w_scalbf.c b/lib/msun/src/w_scalbf.c index 9e47c7035faa..469525cfc17f 100644 --- a/lib/msun/src/w_scalbf.c +++ b/lib/msun/src/w_scalbf.c @@ -8,18 +8,18 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_scalbf.c,v 1.1 1994/08/10 20:35:40 jtc Exp $"; +static char rcsid[] = "$Id: w_scalbf.c,v 1.1.1.1 1994/08/19 09:40:00 jkh Exp $"; #endif /* * wrapper scalbf(float x, float fn) is provide for - * passing various standard test suite. One + * passing various standard test suite. One * should use scalbn() instead. */ @@ -56,10 +56,10 @@ static char rcsid[] = "$Id: w_scalbf.c,v 1.1 1994/08/10 20:35:40 jtc Exp $"; if(z==(float)0.0&&z!=x) { /* scalbf underflow */ return (float)__kernel_standard((double)x,(double)fn,133); - } + } #ifndef _SCALB_INT if(!finitef(fn)) errno = ERANGE; #endif return z; -#endif +#endif } diff --git a/lib/msun/src/w_sinh.c b/lib/msun/src/w_sinh.c index 241e335e2948..8498dbe87e33 100644 --- a/lib/msun/src/w_sinh.c +++ b/lib/msun/src/w_sinh.c @@ -5,16 +5,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_sinh.c,v 1.4 1994/08/10 20:35:42 jtc Exp $"; +static char rcsid[] = "$Id: w_sinh.c,v 1.1.1.1 1994/08/19 09:39:54 jkh Exp $"; #endif -/* +/* * wrapper sinh(x) */ @@ -31,7 +31,7 @@ static char rcsid[] = "$Id: w_sinh.c,v 1.4 1994/08/10 20:35:42 jtc Exp $"; #ifdef _IEEE_LIBM return __ieee754_sinh(x); #else - double z; + double z; z = __ieee754_sinh(x); if(_LIB_VERSION == _IEEE_) return z; if(!finite(z)&&finite(x)) { diff --git a/lib/msun/src/w_sinhf.c b/lib/msun/src/w_sinhf.c index dca5bfa6d254..5f1467dc1d22 100644 --- a/lib/msun/src/w_sinhf.c +++ b/lib/msun/src/w_sinhf.c @@ -8,16 +8,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_sinhf.c,v 1.1 1994/08/10 20:35:45 jtc Exp $"; +static char rcsid[] = "$Id: w_sinhf.c,v 1.1.1.1 1994/08/19 09:40:00 jkh Exp $"; #endif -/* +/* * wrapper sinhf(x) */ @@ -34,7 +34,7 @@ static char rcsid[] = "$Id: w_sinhf.c,v 1.1 1994/08/10 20:35:45 jtc Exp $"; #ifdef _IEEE_LIBM return __ieee754_sinhf(x); #else - float z; + float z; z = __ieee754_sinhf(x); if(_LIB_VERSION == _IEEE_) return z; if(!finitef(z)&&finitef(x)) { diff --git a/lib/msun/src/w_sqrt.c b/lib/msun/src/w_sqrt.c index 696f45a9fa0e..bdf97d21e086 100644 --- a/lib/msun/src/w_sqrt.c +++ b/lib/msun/src/w_sqrt.c @@ -5,16 +5,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_sqrt.c,v 1.4 1994/08/10 20:35:48 jtc Exp $"; +static char rcsid[] = "$Id: w_sqrt.c,v 1.1.1.1 1994/08/19 09:39:54 jkh Exp $"; #endif -/* +/* * wrapper sqrt(x) */ diff --git a/lib/msun/src/w_sqrtf.c b/lib/msun/src/w_sqrtf.c index c248f0c95017..55631bff8012 100644 --- a/lib/msun/src/w_sqrtf.c +++ b/lib/msun/src/w_sqrtf.c @@ -8,16 +8,16 @@ * * 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. * ==================================================== */ #ifndef lint -static char rcsid[] = "$Id: w_sqrtf.c,v 1.1 1994/08/10 20:35:53 jtc Exp $"; +static char rcsid[] = "$Id: w_sqrtf.c,v 1.1.1.1 1994/08/19 09:40:00 jkh Exp $"; #endif -/* +/* * wrapper sqrtf(x) */ |
