@Test
public void testRegIncompleteBetaHartleyFitchExamples() {
final RegularisedIncompleteBeta beta = new RegularisedIncompleteBeta();
// FIXME Is 1.0e-6 accuracy ok?
final double[][] values = { {30, 5, 0.7, 0.0116578},
{30, 5, 0.94, 0.94936},
{30, 5, 0.96, 0.989182},
{10, 16, 0.2, 0.0173319},
{16, 10, 0.8, 0.982668},
{ 4, 2, 0.89, 0.903488},
{ 4, 2, 0.42, 0.103308}};
for (final double[] value : values) {
final double a = value[0];
final double b = value[1];
final double x = value[2];
final double expected = value[3];
final double realised = beta.evaluate(x, a, b);
if (Math.abs(expected-realised)>1.0e-6)
fail("x: " + x + " expected: " + expected + " realised: " + realised);
}
}