18#if defined(_WIN32) && !defined(__MINGW32__)
21# define isnan(x) _isnan(x)
26# include <private/mathP.h>
27# define isnan(x) isNan(x)
44 if (tails != 1 && tails != 2)
47 fprintf(stderr,
"erfc function is not implemented on vxWorks\n");
50 return erfc(z0 / SQRT2) / (tails == 1 ? 2 : 1);
68 return gammaQ(nu / 2.0, ChiSquared0 / 2);
84 if (tails != 1 && tails != 2)
86 return betaInc(nu / 2.0, 0.5, nu / (nu + t0 * t0)) / (tails == 1 ? 2 : 1);
101double FSigLevel(
double var1,
double var2,
long nu1,
long nu2)
104 SWAP_DOUBLE(var1, var2);
107 return betaInc(nu2 / 2.0, nu1 / 2.0, nu2 / (nu2 + nu1 * var1 / var2));
143 double sum, term, result = 0;
147 if (n < 0 || n0 <= 0) {
148 return n0 < n ? 0 : 1;
157 return n0 < n ? 0 : 1;
165 result = 1 - sum * exp(-n0);
167 return n0 < n ? 0 : 1;
double betaInc(double a, double b, double x)
Compute the incomplete beta function.
double gammaQ(double a, double x)
Compute the regularized upper incomplete gamma function Q(a,x).
double ChiSqrSigLevel(double ChiSquared0, long nu)
Computes the probability that a chi-squared variable exceeds a given value.
double tTailSigLevel(double t0, long nu, long tails)
Computes the probability that the absolute value of a t-distributed variable exceeds a given value.
double normSigLevel(double z0, long tails)
Computes the probability that a standard normal variable exceeds a given value.
double rSigLevel(double r0, long nu)
Computes the probability that the linear correlation coefficient exceeds a given value.
double poissonSigLevel(long n, double n0)
Computes the probability that a Poisson-distributed random variable exceeds or equals a given value.
double FSigLevel(double var1, double var2, long nu1, long nu2)
Computes the probability that an F-distributed variable exceeds a given value.