StudentTTwoTailedCriticalValueCalculator extends Function1D<Double, Double> { @Override public Double evaluate(final Double x) { Validate.notNull(x, "x"); ArgumentChecker.notNegative(x, "x"); return _calc.evaluate(0.5 + 0.5 * x); } StudentTTwoTailedCriticalValueCalculator(final double nu);  StudentTTwoTailedCriticalValueCalculator(final double nu, final RandomEngine engine); @Override Double evaluate(final Double x);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNull() { F.evaluate((Double) null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNegative() { F.evaluate(-4.); }
@Test public void test() { double x, y; final double eps = 1e-5; for (int i = 0; i < 100; i++) { x = RANDOM.nextDouble(); y = 0.5 * (1 + x); assertEquals(y, T.getCDF(F.evaluate(x)), eps); } }