@Override
    public double cdf(double x) {
        if (x < 0.0) {
            throw new IllegalArgumentException("Invalid x: " + x);
        }

        return Beta.regularizedIncompleteBetaFunction(0.5 * nu1, 0.5 * nu2, nu1 * x / (nu2 + nu1 * x));
    }
@Test
    public void testCdf() {
        System.out.println("cdf");
        FDistribution instance = new FDistribution(10, 20);
        instance.rand();
        assertEquals(5.878315e-09, instance.cdf(0.01), 1E-15);
        assertEquals(0.0003410974, instance.cdf(0.1), 1E-10);
        assertEquals(0.006161513, instance.cdf(0.2), 1E-9);
        assertEquals(0.1298396, instance.cdf(0.5), 1E-6);
        assertEquals(0.5244995, instance.cdf(1), 1E-7);
        assertEquals(0.9999914, instance.cdf(10), 1E-7);
    }