X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Ftukey%2Fptukey.c;h=07923d98bd7b5a363d7969847a333950243d5a6e;hb=2569c1e25ddb52f847e688c6b15f1d6c3bb66f28;hp=c86ef23613c0766e90681dfdabc25c026257c58f;hpb=631e2243322503338b497cd13529fbb2c5833e3d;p=pspp diff --git a/lib/tukey/ptukey.c b/lib/tukey/ptukey.c index c86ef23613..07923d98bd 100644 --- a/lib/tukey/ptukey.c +++ b/lib/tukey/ptukey.c @@ -59,7 +59,7 @@ * Vol.30, pp.1-15, 1988. */ - + #include @@ -71,7 +71,7 @@ #include #include -#define R_D__0 (log_p ? ML_NEGINF : 0.) /* 0 */ +#define R_D__0 (log_p ? -INFINITY : 0.) /* 0 */ #define R_D__1 (log_p ? 0. : 1.) /* 1 */ #define R_DT_0 (lower_tail ? R_D__0 : R_D__1) /* 0 */ #define R_DT_1 (lower_tail ? R_D__1 : R_D__0) /* 1 */ @@ -84,13 +84,13 @@ #define ME_PRECISION 8 -static inline double +static inline double pnorm(double x, double mu, double sigma, int lower_tail, int log_p) { assert (lower_tail == 1); assert (log_p == 0); assert (sigma == 1.0); - + return gsl_cdf_gaussian_P (x - mu, sigma); } @@ -272,7 +272,6 @@ wprob (double w, double rr, double cc) double ptukey (double q, double rr, double cc, double df, int lower_tail, int log_p) { - const double ML_NEGINF = -1.0 / 0.0; /* function ptukey() [was qprob() ]: q = value of studentized range @@ -327,7 +326,7 @@ ptukey (double q, double rr, double cc, double df, int lower_tail, int log_p) f(x) = .5 + erf(x / sqrt(2)) / 2 for x > 0 - f(x) = erfc( -x / sqrt(2)) / 2 for x < 0 + f(x) = erfc(-x / sqrt(2)) / 2 for x < 0 where f(x) is standard normal c. d. f. @@ -371,9 +370,7 @@ ptukey (double q, double rr, double cc, double df, int lower_tail, int log_p) double ans, f2, f21, f2lf, ff4, otsum, qsqz, rotsum, t1, twa1, ulen, wprb; int i, j, jj; -#ifdef IEEE_754 - abort (! (ISNAN (q) || ISNAN (rr) || ISNAN (cc) || ISNAN (df))); -#endif + assert (! (isnan (q) || isnan (rr) || isnan (cc) || isnan (df))); if (q <= 0) return R_DT_0;