Incorporated from BSD 4.4-Lite.
authorroland <roland>
Sun, 31 Jul 1994 19:19:49 +0000 (19:19 +0000)
committerroland <roland>
Sun, 31 Jul 1994 19:19:49 +0000 (19:19 +0000)
sysdeps/generic/expm1.c

index de12415..760d2be 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1985 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1985, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -32,7 +32,7 @@
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)expm1.c    5.6 (Berkeley) 10/9/90";
+static char sccsid[] = "@(#)expm1.c    8.1 (Berkeley) 6/4/93";
 #endif /* not lint */
 
 /* EXPM1(X)
@@ -108,7 +108,7 @@ ic(invln2, 1.4426950408889633870E0,     0, 1.71547652B82FE)
 double expm1(x)
 double x;
 {
-       static const double one=1.0, half=1.0/2.0; 
+       const static double one=1.0, half=1.0/2.0; 
        double  z,hi,lo,c;
        int k;
 #if defined(vax)||defined(tahoe)
@@ -130,21 +130,21 @@ double x;
                        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) 
-                               {x=z+half;x +=exp__E(z,c); return(x+x);}
+                               {x=z+half;x +=__exp__E(z,c); return(x+x);}
                            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)
-                             { x=one-scalb(one,-k); z += exp__E(z,c);}
+                             { x=one-scalb(one,-k); z += __exp__E(z,c);}
                            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 
-                             { x = exp__E(z,c)+z; z=one;}
+                             { x = __exp__E(z,c)+z; z=one;}
 
                            return (scalb(x+z,k));  
                        }