@Description("Beta cdf given the a, b parameters and value")
    @ScalarFunction
    @SqlType(StandardTypes.DOUBLE)
    public static double betaCdf(
            @SqlType(StandardTypes.DOUBLE) double a,
            @SqlType(StandardTypes.DOUBLE) double b,
            @SqlType(StandardTypes.DOUBLE) double value)
    {
        checkCondition(value >= 0 && value <= 1, INVALID_FUNCTION_ARGUMENT, "betaCdf Function: value must be in the interval [0, 1]");
        checkCondition(a > 0, INVALID_FUNCTION_ARGUMENT, "betaCdf Function: a must be > 0");
        checkCondition(b > 0, INVALID_FUNCTION_ARGUMENT, "betaCdf Function: b must be > 0");
        BetaDistribution distribution = new BetaDistribution(null, a, b, BetaDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
        return distribution.cumulativeProbability(value);
    }
@Test
    public void testBetaCdf()
    {
        assertFunction("beta_cdf(3, 3.6, 0.0)", DOUBLE, 0.0);
        assertFunction("beta_cdf(3, 3.6, 1.0)", DOUBLE, 1.0);
        assertFunction("beta_cdf(3, 3.6, 0.3)", DOUBLE, 0.21764809997679938);
        assertFunction("beta_cdf(3, 3.6, 0.9)", DOUBLE, 0.9972502881611551);

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