@Description("Inverse of Beta cdf given a, b parameters and probability")
    @ScalarFunction
    @SqlType(StandardTypes.DOUBLE)
    public static double inverseBetaCdf(
            @SqlType(StandardTypes.DOUBLE) double a,
            @SqlType(StandardTypes.DOUBLE) double b,
            @SqlType(StandardTypes.DOUBLE) double p)
    {
        checkCondition(p >= 0 && p <= 1, INVALID_FUNCTION_ARGUMENT, "inverseBetaCdf Function: p must be in the interval [0, 1]");
        checkCondition(a > 0, INVALID_FUNCTION_ARGUMENT, "inverseBetaCdf Function: a must be > 0");
        checkCondition(b > 0, INVALID_FUNCTION_ARGUMENT, "inverseBetaCdf Function: b must be > 0");
        BetaDistribution distribution = new BetaDistribution(null, a, b, BetaDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
        return distribution.inverseCumulativeProbability(p);
    }
@Test
    public void testInverseBetaCdf()
    {
        assertFunction("inverse_beta_cdf(3, 3.6, 0.0)", DOUBLE, 0.0);
        assertFunction("inverse_beta_cdf(3, 3.6, 1.0)", DOUBLE, 1.0);
        assertFunction("inverse_beta_cdf(3, 3.6, 0.3)", DOUBLE, 0.3469675485440618);
        assertFunction("inverse_beta_cdf(3, 3.6, 0.95)", DOUBLE, 0.7600272463100223);

        assertInvalidFunction("inverse_beta_cdf(0, 3, 0.5)", "inverseBetaCdf Function: a must be > 0");
        assertInvalidFunction("inverse_beta_cdf(3, 0, 0.5)", "inverseBetaCdf Function: b must be > 0");
        assertInvalidFunction("inverse_beta_cdf(3, 5, -0.1)", "inverseBetaCdf Function: p must be in the interval [0, 1]");
        assertInvalidFunction("inverse_beta_cdf(3, 5, 1.1)", "inverseBetaCdf Function: p must be in the interval [0, 1]");
    }