public static double fDistributionInverseCDF(int nu1, int nu2, double prob) {
		if (prob < 0.0 || prob > 1.0) throw new IllegalArgumentException("Entered cdf value, " + prob + ", must lie between 0 and 1 inclusive");

		double icdf = 0.0D;

		if (prob == 0.0) {
			icdf = 0.0;
		} else {
			if (prob == 1.0) {
				icdf = Double.POSITIVE_INFINITY;
			} else {

				// Create instance of the class holding the F-distribution cfd function
				FdistribtionFunct fdistn = new FdistribtionFunct();

				// set function variables
				fdistn.nu1 = nu1;
				fdistn.nu2 = nu2;

				// required tolerance
				double tolerance = 1e-12;

				// lower bound
				double lowerBound = 0.0;

				// upper bound
				double upperBound = 2.0;

				// Create instance of RealRoot
				RealRoot realR = new RealRoot();

				// Set extension limits
				realR.noLowerBoundExtension();

				// Set tolerance
				realR.setTolerance(tolerance);

				// Supress error messages and arrange for NaN to be returned as root if root not found
				realR.resetNaNexceptionToTrue();
				realR.supressLimitReachedMessage();
				realR.supressNaNmessage();

				//  set function cfd  variable
				fdistn.cfd = prob;

				// call root searching method
				icdf = realR.bisect(fdistn, lowerBound, upperBound);
			}
		}
		return icdf;
	}