@Description("Inverse of ChiSquared cdf given df parameter and probability")
    @ScalarFunction
    @SqlType(StandardTypes.DOUBLE)
    public static double inverseChiSquaredCdf(
            @SqlType(StandardTypes.DOUBLE) double df,
            @SqlType(StandardTypes.DOUBLE) double p)
    {
        checkCondition(p >= 0 && p <= 1, INVALID_FUNCTION_ARGUMENT, "inverseChiSquaredCdf Function: p must be in the interval [0, 1]");
        checkCondition(df > 0, INVALID_FUNCTION_ARGUMENT, "inverseChiSquaredCdf Function: df must be greater than 0");
        ChiSquaredDistribution distribution = new ChiSquaredDistribution(null, df, ChiSquaredDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
        return distribution.inverseCumulativeProbability(p);
    }
@Test
    public void testInverseChiSquaredCdf()
    {
        assertFunction("inverse_chi_squared_cdf(3, 0.0)", DOUBLE, 0.0);
        assertFunction("round(inverse_chi_squared_cdf(3, 0.99), 4)", DOUBLE, 11.3449);
        assertFunction("round(inverse_chi_squared_cdf(3, 0.3),2)", DOUBLE, 1.42);
        assertFunction("round(inverse_chi_squared_cdf(3, 0.95),2)", DOUBLE, 7.81);

        assertInvalidFunction("inverse_chi_squared_cdf(-3, 0.3)", "inverseChiSquaredCdf Function: df must be greater than 0");
        assertInvalidFunction("inverse_chi_squared_cdf(3, -0.1)", "inverseChiSquaredCdf Function: p must be in the interval [0, 1]");
        assertInvalidFunction("inverse_chi_squared_cdf(3, 1.1)", "inverseChiSquaredCdf Function: p must be in the interval [0, 1]");
    }