projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
progress on ROWLABELS=LAYER
[pspp]
/
lib
/
tukey
/
qtukey.c
diff --git
a/lib/tukey/qtukey.c
b/lib/tukey/qtukey.c
index 08253df7546b4bb051cedc0e957b3215512e1d14..54c174be2074be0378ffaed41c6903106d47e92f 100644
(file)
--- a/
lib/tukey/qtukey.c
+++ b/
lib/tukey/qtukey.c
@@
-81,10
+81,8
@@
static double fmax2(double x, double y)
{
static double fmax2(double x, double y)
{
-#ifdef IEEE_754
- if (ISNAN(x) || ISNAN(y))
+ if (isnan(x) || isnan(y))
return x + y;
return x + y;
-#endif
return (x < y) ? y : x;
}
return (x < y) ? y : x;
}
@@
-145,8
+143,8
@@
static double qinv(double p, double c, double v)
ps = 0.5 - 0.5 * p;
yi = sqrt (log (1.0 / (ps * ps)));
ps = 0.5 - 0.5 * p;
yi = sqrt (log (1.0 / (ps * ps)));
- t = yi + ((((
yi * p4 + p3) * yi + p2) * yi + p1) * yi + p0)
- / ((((
yi * q4 + q3) * yi + q2) * yi + q1) * yi + q0);
+ t = yi + ((((yi * p4 + p3) * yi + p2) * yi + p1) * yi + p0)
+ / ((((yi * q4 + q3) * yi + q2) * yi + q1) * yi + q0);
if (v < vmax) t += (t * t * t + t) / v / 4.0;
q = c1 - c2 * t;
if (v < vmax) q += -c3 / v + c4 * t / v;
if (v < vmax) t += (t * t * t + t) / v / 4.0;
q = c1 - c2 * t;
if (v < vmax) q += -c3 / v + c4 * t / v;
@@
-188,15
+186,20
@@
double qtukey(double p, double rr, double cc, double df,
double ans = 0.0, valx0, valx1, x0, x1, xabs;
int iter;
double ans = 0.0, valx0, valx1, x0, x1, xabs;
int iter;
-#ifdef IEEE_754
- if (ISNAN(p) || ISNAN(rr) || ISNAN(cc) || ISNAN(df)) {
- ML_ERROR(ME_DOMAIN, "qtukey");
+ if (isnan(p) || isnan(rr) || isnan(cc) || isnan(df)) {
+ /* ML_ERROR(ME_DOMAIN, "qtukey"); */
return p + rr + cc + df;
}
return p + rr + cc + df;
}
-#endif
/* df must be > 1 ; there must be at least two values */
/* df must be > 1 ; there must be at least two values */
- assert (! (df < 2 || rr < 1 || cc < 2) );
+ /* ^^
+ JMD: The comment says 1 but the code says 2.
+ Which is correct?
+ */
+ assert (df >= 2);
+ assert (rr >= 1);
+ assert (cc >= 2);
+
R_Q_P01_boundaries (p, 0, ML_POSINF);
R_Q_P01_boundaries (p, 0, ML_POSINF);