SCCS-vsn: lib/libm/common_source/cosh.c 5.7
SCCS-vsn: lib/libm/common_source/erf.c 5.8
SCCS-vsn: lib/libm/common_source/exp__E.c 5.7
SCCS-vsn: lib/libm/common_source/expm1.c 5.7
SCCS-vsn: lib/libm/common_source/gamma.c 5.4
SCCS-vsn: lib/libm/common_source/lgamma.c 5.12
SCCS-vsn: lib/libm/common_source/log.c 5.11
SCCS-vsn: lib/libm/common_source/log1p.c 5.7
SCCS-vsn: lib/libm/common_source/log__L.c 5.7
SCCS-vsn: lib/libm/common_source/mathimpl.h 5.6
SCCS-vsn: lib/libm/common_source/pow.c 5.10
-static char sccsid[] = "@(#)cosh.c 5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)cosh.c 5.7 (Berkeley) %G%";
#endif /* not lint */
/* COSH(X)
#endif /* not lint */
/* COSH(X)
if((x=copysign(x,one)) <= 22)
if(x<0.3465)
if(x<small) return(one+x);
if((x=copysign(x,one)) <= 22)
if(x<0.3465)
if(x<small) return(one+x);
- else {t=x+exp__E(x,0.0);x=t+t; return(one+t*t/(2.0+x)); }
+ else {t=x+__exp__E(x,0.0);x=t+t; return(one+t*t/(2.0+x)); }
else /* for x lies in [0.3465,22] */
{ t=exp(x); return((t+one/t)*half); }
else /* for x lies in [0.3465,22] */
{ t=exp(x); return((t+one/t)*half); }
-static char sccsid[] = "@(#)erf.c 5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)erf.c 5.8 (Berkeley) %G%";
#endif /* not lint */
/* Modified Nov 30, 1992 P. McILROY:
#endif /* not lint */
/* Modified Nov 30, 1992 P. McILROY:
double erfc(x)
double x;
{
double erfc(x)
double x;
{
- double R,S,P,Q,s,ax,y,z,r,fabs(),exp__D();
+ double R,S,P,Q,s,ax,y,z,r,fabs(),__exp__D();
if (!finite(x)) {
if (isnan(x)) /* erfc(NaN) = NaN */
return(x);
if (!finite(x)) {
if (isnan(x)) /* erfc(NaN) = NaN */
return(x);
/* return exp(-x^2 - lsqrtPI_hi + R + y)/x; */
s = ((R + y) - lsqrtPI_hi) + z;
y = (((z-s) - lsqrtPI_hi) + R) + y;
/* return exp(-x^2 - lsqrtPI_hi + R + y)/x; */
s = ((R + y) - lsqrtPI_hi) + z;
y = (((z-s) - lsqrtPI_hi) + R) + y;
-static char sccsid[] = "@(#)exp__E.c 5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)exp__E.c 5.7 (Berkeley) %G%";
#endif /* not lint */
/* exp__E(x,c)
#endif /* not lint */
/* exp__E(x,c)
#define q3 vccast(q3)
#endif
#define q3 vccast(q3)
#endif
double x,c;
{
const static double zero=0.0, one=1.0, half=1.0/2.0, small=1.0E-19;
double x,c;
{
const static double zero=0.0, one=1.0, half=1.0/2.0, small=1.0E-19;
-static char sccsid[] = "@(#)expm1.c 5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)expm1.c 5.7 (Berkeley) %G%";
#endif /* not lint */
/* EXPM1(X)
#endif /* not lint */
/* EXPM1(X)
z=hi-(lo=k*ln2lo);
c=(hi-z)-lo;
z=hi-(lo=k*ln2lo);
c=(hi-z)-lo;
- if(k==0) return(z+exp__E(z,c));
+ if(k==0) return(z+__exp__E(z,c));
- {x=z+half;x +=exp__E(z,c); return(x+x);}
+ {x=z+half;x +=__exp__E(z,c); return(x+x);}
- {z+=exp__E(z,c); x=half+z; return(x+x);}
+ {z+=__exp__E(z,c); x=half+z; return(x+x);}
/* end of k=1 */
else {
if(k<=prec)
/* end of k=1 */
else {
if(k<=prec)
- { x=one-scalb(one,-k); z += exp__E(z,c);}
+ { x=one-scalb(one,-k); z += __exp__E(z,c);}
- { x = exp__E(z,c)-scalb(one,-k); x+=z; z=one;}
+ { x = __exp__E(z,c)-scalb(one,-k); x+=z; z=one;}
- { x = exp__E(z,c)+z; z=one;}
+ { x = __exp__E(z,c)+z; z=one;}
-static char sccsid[] = "@(#)gamma.c 5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)gamma.c 5.4 (Berkeley) %G%";
if(x > 171.63)
return(one/zero);
u = large_gam(x);
if(x > 171.63)
return(one/zero);
u = large_gam(x);
- return(exp__D(u.a, u.b));
+ return(__exp__D(u.a, u.b));
} else if (x >= 1.0 + LEFT + x0)
return (small_gam(x));
else if (x > 1.e-17)
} else if (x >= 1.0 + LEFT + x0)
return (small_gam(x));
else if (x > 1.e-17)
p = Pa0+z*(Pa1+z*(Pa2+z*(Pa3+z*(Pa4+z*(Pa5+z*(Pa6+z*Pa7))))));
p = p/x;
p = Pa0+z*(Pa1+z*(Pa2+z*(Pa3+z*(Pa4+z*(Pa5+z*(Pa6+z*Pa7))))));
p = p/x;
u.a -= one;
v.a = (x -= .5);
TRUNC(v.a);
u.a -= one;
v.a = (x -= .5);
TRUNC(v.a);
return ((double)sgn*tiny*tiny);
y = one - x; /* exact: 128 < |x| < 255 */
lg = large_gam(y);
return ((double)sgn*tiny*tiny);
y = one - x; /* exact: 128 < |x| < 255 */
lg = large_gam(y);
- lsine = log__D(M_PI/z); /* = TRUNC(log(u)) + small */
- lg.a -= lsine.a; /* exact (opposite signs) */
+ lsine = __log__D(M_PI/z); /* = TRUNC(log(u)) + small */
+ lg.a -= lsine.a; /* exact (opposite signs) */
lg.b -= lsine.b;
y = -(lg.a + lg.b);
z = (y + lg.a) + lg.b;
lg.b -= lsine.b;
y = -(lg.a + lg.b);
z = (y + lg.a) + lg.b;
if (sgn < 0) y = -y;
return (y);
}
if (sgn < 0) y = -y;
return (y);
}
-static char sccsid[] = "@(#)lgamma.c 5.11 (Berkeley) %G%";
+static char sccsid[] = "@(#)lgamma.c 5.12 (Berkeley) %G%";
double z, p, x1;
int i;
struct Double t, u, v;
double z, p, x1;
int i;
struct Double t, u, v;
u.a -= 1.0;
if (x > 1e15) {
v.a = x - 0.5;
u.a -= 1.0;
if (x > 1e15) {
v.a = x - 0.5;
case 5: z *= (y + 4);
case 4: z *= (y + 3);
case 3: z *= (y + 2);
case 5: z *= (y + 4);
case 4: z *= (y + 3);
case 3: z *= (y + 2);
rr.b += a0_lo; rr.a += a0_hi;
return(((r+rr.b)+t+rr.a));
case 2: return(((r+a0_lo)+t)+a0_hi);
case 0: r -= log1p(x);
rr.b += a0_lo; rr.a += a0_hi;
return(((r+rr.b)+t+rr.a));
case 2: return(((r+a0_lo)+t)+a0_hi);
case 0: r -= log1p(x);
- default: rr = log__D(x);
+ default: rr = __log__D(x);
rr.a -= a0_hi; rr.b -= a0_lo;
return(((r - rr.b) + t) - rr.a);
}
rr.a -= a0_hi; rr.b -= a0_lo;
return(((r - rr.b) + t) - rr.a);
}
case 5: z *= (y + 4);
case 4: z *= (y + 3);
case 3: z *= (y + 2);
case 5: z *= (y + 4);
case 4: z *= (y + 3);
case 3: z *= (y + 2);
r += rr.b; r += q;
return(rr.a + r);
case 2: return (q+ r);
r += rr.b; r += q;
return(rr.a + r);
case 2: return (q+ r);
- case 0: rr = log__D(x);
+ case 0: rr = __log__D(x);
r -= rr.b; r -= log1p(x);
r += q; r-= rr.a;
return(r);
r -= rr.b; r -= log1p(x);
r += q; r-= rr.a;
return(r);
- default: rr = log__D(x);
+ default: rr = __log__D(x);
r -= rr.b;
q -= rr.a;
return (r+q);
r -= rr.b;
q -= rr.a;
return (r+q);
-static char sccsid[] = "@(#)log.c 5.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)log.c 5.11 (Berkeley) %G%";
#endif /* not lint */
#include <math.h>
#endif /* not lint */
#include <math.h>
*/
struct Double
#ifdef _ANSI_SOURCE
*/
struct Double
#ifdef _ANSI_SOURCE
-static char sccsid[] = "@(#)log1p.c 5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)log1p.c 5.7 (Berkeley) %G%";
#endif /* not lint */
/* LOG1P(x)
#endif /* not lint */
/* LOG1P(x)
/* compute log(1+x) */
s = x/(2+x); t = x*x*half;
c += (k*ln2lo-c*x);
/* compute log(1+x) */
s = x/(2+x); t = x*x*half;
c += (k*ln2lo-c*x);
- z = c+s*(t+log__L(s*s));
+ z = c+s*(t+__log__L(s*s));
x += (z - t) ;
return(k*ln2hi+x);
x += (z - t) ;
return(k*ln2hi+x);
-static char sccsid[] = "@(#)log__L.c 5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)log__L.c 5.7 (Berkeley) %G%";
#endif /* not lint */
/* log__L(Z)
#endif /* not lint */
/* log__L(Z)
#define L8 vccast(L8)
#endif
#define L8 vccast(L8)
#endif
double z;
{
#if defined(vax)||defined(tahoe)
double z;
{
#if defined(vax)||defined(tahoe)
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)mathimpl.h 5.5 (Berkeley) %G%
+ * @(#)mathimpl.h 5.6 (Berkeley) %G%
*/
#include <sys/cdefs.h>
*/
#include <sys/cdefs.h>
/*
* Functions internal to the math package, yet not static.
*/
/*
* Functions internal to the math package, yet not static.
*/
-extern double exp__E();
-extern double log__L();
+extern double __exp__E();
+extern double __log__L();
struct Double {double a, b;};
struct Double {double a, b;};
-double exp__D __P((double, double));
-struct Double log__D __P((double));
+double __exp__D __P((double, double));
+struct Double __log__D __P((double));
-static char sccsid[] = "@(#)pow.c 5.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)pow.c 5.10 (Berkeley) %G%";
#endif /* not lint */
/* POW(X,Y)
#endif /* not lint */
/* POW(X,Y)
pow_P(x, y) double x, y;
#endif
{
pow_P(x, y) double x, y;
#endif
{
- struct Double s, t, log__D();
- double exp__D(), huge = 1e300, tiny = 1e-300;
+ struct Double s, t, __log__D();
+ double __exp__D(), huge = 1e300, tiny = 1e-300;
if (x == 1)
return (one);
if (x == 1)
return (one);
/* Return exp(y*log(x)), using simulated extended */
/* precision for the log and the multiply. */
/* Return exp(y*log(x)), using simulated extended */
/* precision for the log and the multiply. */
t.a = y;
TRUNC(t.a);
t.b = y - t.a;
t.a = y;
TRUNC(t.a);
t.b = y - t.a;
t.a *= s.a;
s.a = t.a + t.b;
s.b = (t.a - s.a) + t.b;
t.a *= s.a;
s.a = t.a + t.b;
s.b = (t.a - s.a) + t.b;
- return (exp__D(s.a, s.b));
+ return (__exp__D(s.a, s.b));