exp__D, exp__E, log__D, and log__L are private; prepend leading "__"
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 11 Jan 1993 04:47:58 +0000 (20:47 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 11 Jan 1993 04:47:58 +0000 (20:47 -0800)
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

usr/src/lib/libm/common_source/cosh.c
usr/src/lib/libm/common_source/erf.c
usr/src/lib/libm/common_source/exp__E.c
usr/src/lib/libm/common_source/expm1.c
usr/src/lib/libm/common_source/gamma.c
usr/src/lib/libm/common_source/lgamma.c
usr/src/lib/libm/common_source/log.c
usr/src/lib/libm/common_source/log1p.c
usr/src/lib/libm/common_source/log__L.c
usr/src/lib/libm/common_source/mathimpl.h
usr/src/lib/libm/common_source/pow.c

index 3e54a9c..e4f0008 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-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)
@@ -91,7 +91,7 @@ double 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); }
index dec28ae..263bf1a 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-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:
@@ -296,7 +296,7 @@ double erf(x)
 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);
@@ -362,7 +362,7 @@ double erfc(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;
-       r = exp__D(s, y)/x;
+       r = __exp__D(s, y)/x;
        if (x>0)
                return r;
        else
        if (x>0)
                return r;
        else
index 0891933..0aa0ed7 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-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)
@@ -81,7 +81,7 @@ ic(q2, 9.9176615021572857300E-4, -10, 1.03FC4CB8C98E8)
 #define       q3    vccast(q3)
 #endif
 
 #define       q3    vccast(q3)
 #endif
 
-double exp__E(x,c)
+double __exp__E(x,c)
 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;
index d2b003a..a7f850e 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-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)
@@ -104,21 +104,21 @@ double 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));
                        if(k==1)
                            if(z< -0.25) 
                        if(k==1)
                            if(z< -0.25) 
-                               {x=z+half;x +=exp__E(z,c); return(x+x);}
+                               {x=z+half;x +=__exp__E(z,c); return(x+x);}
                            else
                            else
-                               {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);}
                            else if(k<100)
                            else if(k<100)
-                             { x = exp__E(z,c)-scalb(one,-k); x+=z; z=one;}
+                             { x = __exp__E(z,c)-scalb(one,-k); x+=z; z=one;}
                            else 
                            else 
-                             { x = exp__E(z,c)+z; z=one;}
+                             { x = __exp__E(z,c)+z; z=one;}
 
                            return (scalb(x+z,k));  
                        }
 
                            return (scalb(x+z,k));  
                        }
index cc52aa8..3df1e7f 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)gamma.c    5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)gamma.c    5.4 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -120,7 +120,7 @@ gamma(x)
                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)
@@ -154,7 +154,7 @@ large_gam(x)
        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 = log__D(x);
+       u = __log__D(x);
        u.a -= one;
        v.a = (x -= .5);
        TRUNC(v.a);
        u.a -= one;
        v.a = (x -= .5);
        TRUNC(v.a);
@@ -291,12 +291,12 @@ neg_gam(x)
                        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;
-               y = exp__D(y, z);
+               y = __exp__D(y, z);
                if (sgn < 0) y = -y;
                return (y);
        }
                if (sgn < 0) y = -y;
                return (y);
        }
index ceb6a4c..d89066c 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lgamma.c   5.11 (Berkeley) %G%";
+static char sccsid[] = "@(#)lgamma.c   5.12 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -145,7 +145,7 @@ large_lgam(double x)
        double z, p, x1;
        int i;
        struct Double t, u, v;
        double z, p, x1;
        int i;
        struct Double t, u, v;
-       u = log__D(x);
+       u = __log__D(x);
        u.a -= 1.0;
        if (x > 1e15) {
                v.a = x - 0.5;
        u.a -= 1.0;
        if (x > 1e15) {
                v.a = x - 0.5;
@@ -199,12 +199,12 @@ CONTINUE:
                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 = log__D(z);
+                       rr = __log__D(z);
                        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);
                }
@@ -224,15 +224,15 @@ CONTINUE:
                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 = log__D(z);
+                       rr = __log__D(z);
                        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);
index fb05464..1a6f600 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-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>
@@ -417,9 +417,9 @@ log(x) double x;
  */
 struct Double
 #ifdef _ANSI_SOURCE
  */
 struct Double
 #ifdef _ANSI_SOURCE
-log__D(double x)
+__log__D(double x)
 #else
 #else
-log__D(x) double x;
+__log__D(x) double x;
 #endif
 {
        int m, j;
 #endif
 {
        int m, j;
index 53f058a..d7814a8 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-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) 
@@ -111,7 +111,7 @@ double 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);
index 2f8b3a4..4ea96b4 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-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)
@@ -73,7 +73,7 @@ ic(L7, 1.4795612545334174692E-1, -3, 1.2F039F0085122)
 #define        L8      vccast(L8)
 #endif
 
 #define        L8      vccast(L8)
 #endif
 
-double log__L(z)
+double __log__L(z)
 double z;
 {
 #if defined(vax)||defined(tahoe)
 double z;
 {
 #if defined(vax)||defined(tahoe)
index 80b14f2..088d184 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %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>
@@ -64,9 +64,9 @@
 /*
  * 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));
index 6760d9d..b964436 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-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)  
@@ -147,8 +147,8 @@ pow_P(double x, double 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);
@@ -163,7 +163,7 @@ pow_P(x, y) double x, y;
        /* 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.        */
 
-       s = log__D(x);
+       s = __log__D(x);
        t.a = y;
        TRUNC(t.a);
        t.b = y - t.a;
        t.a = y;
        TRUNC(t.a);
        t.b = y - t.a;
@@ -171,5 +171,5 @@ pow_P(x, y) double x, y;
        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));
 }
 }