@Test
public void testQuinticMax() {
// The quintic function has zeros at 0, +-0.5 and +-1.
// The function has a local maximum at 0.27195613.
UnivariateFunction f = new QuinticFunction();
UnivariateOptimizer optimizer = new BrentOptimizer(1e-12, 1e-14);
Assert.assertEquals(0.27195613, optimizer.optimize(new MaxEval(100),
new UnivariateObjectiveFunction(f),
GoalType.MAXIMIZE,
new SearchInterval(0.2, 0.3)).getPoint(), 1e-8);