public static double studentTProb(double tValue, int df) {
		if (tValue != tValue) throw new IllegalArgumentException("argument tValue is not a number (NaN)");
		if (tValue == Double.POSITIVE_INFINITY) {
			return 1.0;
		} else {
			if (tValue == Double.NEGATIVE_INFINITY) {
				return 0.0;
			} else {
				double ddf = df;
				double x = ddf / (ddf + tValue * tValue);
				return 0.5D * (1.0D + (Stat.regularisedBetaFunction(ddf / 2.0D, 0.5D, 1) - Stat.regularisedBetaFunction(ddf / 2.0D, 0.5D, x)) * Fmath.sign(tValue));
			}
		}
	}