diff --git a/lib/msun/bsdsrc/b_exp.c b/lib/msun/bsdsrc/b_exp.c index dff6282d6f03..98d2247ae091 100644 --- a/lib/msun/bsdsrc/b_exp.c +++ b/lib/msun/bsdsrc/b_exp.c @@ -137,12 +137,11 @@ double x; double __exp__D(x, c) double x, c; { - double z,hi,lo, t; + double z,hi,lo; int k; -#if !defined(vax)&&!defined(tahoe) - if (x!=x) return(x); /* x is NaN */ -#endif /* !defined(vax)&&!defined(tahoe) */ + if (x != x) /* x is NaN */ + return(x); if ( x <= lnhuge ) { if ( x >= lntiny ) { diff --git a/lib/msun/bsdsrc/b_log.c b/lib/msun/bsdsrc/b_log.c index 75cd81ea0a65..95d366de6de5 100644 --- a/lib/msun/bsdsrc/b_log.c +++ b/lib/msun/bsdsrc/b_log.c @@ -77,15 +77,8 @@ __FBSDID("$FreeBSD$"); * +Inf return +Inf */ -#if defined(vax) || defined(tahoe) -#define _IEEE 0 -#define TRUNC(x) x = (double) (float) (x) -#else -#define _IEEE 1 #define endian (((*(int *) &one)) ? 1 : 0) #define TRUNC(x) *(((int *) &x) + endian) &= 0xf8000000 -#define infnan(x) 0.0 -#endif #define N 128 @@ -381,26 +374,19 @@ log(x) double x; /* Catch special cases */ if (x <= 0) - if (_IEEE && x == zero) /* log(0) = -Inf */ + if (x == zero) /* log(0) = -Inf */ return (-one/zero); - else if (_IEEE) /* log(neg) = NaN */ + else /* log(neg) = NaN */ return (zero/zero); - else if (x == zero) /* NOT REACHED IF _IEEE */ - return (infnan(-ERANGE)); - else - return (infnan(EDOM)); else if (!finite(x)) - if (_IEEE) /* x = NaN, Inf */ - return (x+x); - else - return (infnan(ERANGE)); + return (x+x); /* x = NaN, Inf */ /* Argument reduction: 1 <= g < 2; x/2^m = g; */ /* y = F*(1 + f/F) for |f| <= 2^-8 */ m = logb(x); g = ldexp(x, -m); - if (_IEEE && m == -1022) { + if (m == -1022) { j = logb(g), m += j; g = ldexp(g, -j); } @@ -461,7 +447,7 @@ __log__D(x) double x; m = logb(x); g = ldexp(x, -m); - if (_IEEE && m == -1022) { + if (m == -1022) { j = logb(g), m += j; g = ldexp(g, -j); } diff --git a/lib/msun/bsdsrc/b_tgamma.c b/lib/msun/bsdsrc/b_tgamma.c index 6c405dff3571..babf3261de89 100644 --- a/lib/msun/bsdsrc/b_tgamma.c +++ b/lib/msun/bsdsrc/b_tgamma.c @@ -124,18 +124,12 @@ static struct Double ratfun_gam(double, double); static const double zero = 0., one = 1.0, tiny = 1e-300; static int endian; + /* * TRUNC sets trailing bits in a floating-point number to zero. * is a temporary variable. */ -#if defined(vax) || defined(tahoe) -#define _IEEE 0 -#define TRUNC(x) x = (double) (float) (x) -#else -#define _IEEE 1 #define TRUNC(x) *(((int *) &x) + endian) &= 0xf8000000 -#define infnan(x) 0.0 -#endif double tgamma(x) @@ -155,16 +149,12 @@ tgamma(x) return (smaller_gam(x)); else if (x > -1.e-17) { if (x == 0.0) - if (!_IEEE) return (infnan(ERANGE)); - else return (one/x); + return (one/x); one+1e-20; /* Raise inexact flag. */ return (one/x); - } else if (!finite(x)) { - if (_IEEE) /* x = NaN, -Inf */ - return (x*x); - else - return (infnan(EDOM)); - } else + } else if (!finite(x)) + return (x*x); /* x = NaN, -Inf */ + else return (neg_gam(x)); } /* @@ -175,7 +165,6 @@ large_gam(x) double x; { double z, p; - int i; struct Double t, u, v; z = one/(x*x); @@ -204,7 +193,7 @@ static double small_gam(x) double x; { - double y, ym1, t, x1; + double y, ym1, t; struct Double yy, r; y = x - one; ym1 = y - one; @@ -267,7 +256,6 @@ static struct Double ratfun_gam(z, c) double z, c; { - int i; double p, q; struct Double r, t; @@ -301,10 +289,7 @@ neg_gam(x) y = floor(x + .5); if (y == x) /* Negative integer. */ - if(!_IEEE) - return (infnan(ERANGE)); - else - return (one/zero); + return (one/zero); z = fabs(x - y); y = .5*ceil(x); if (y == ceil(y))