/**
* Test of solver for the quintic function using solveAll().
*/
public void testQuinticFunction2() throws MathException {
double initial = 0.0, tolerance;
Complex expected, result[];
// p(x) = x^5 + 4x^3 + x^2 + 4 = (x+1)(x^2-x+1)(x^2+4)
double coefficients[] = { 4.0, 0.0, 1.0, 4.0, 0.0, 1.0 };
LaguerreSolver solver = new LaguerreSolver();
result = solver.solveAll(coefficients, initial);
expected = new Complex(0.0, -2.0);
tolerance = FastMath.max(solver.getAbsoluteAccuracy(),
FastMath.abs(expected.abs() * solver.getRelativeAccuracy()));
TestUtils.assertContains(result, expected, tolerance);
expected = new Complex(0.0, 2.0);
tolerance = FastMath.max(solver.getAbsoluteAccuracy(),
FastMath.abs(expected.abs() * solver.getRelativeAccuracy()));
TestUtils.assertContains(result, expected, tolerance);
expected = new Complex(0.5, 0.5 * FastMath.sqrt(3.0));
tolerance = FastMath.max(solver.getAbsoluteAccuracy(),
FastMath.abs(expected.abs() * solver.getRelativeAccuracy()));
TestUtils.assertContains(result, expected, tolerance);
expected = new Complex(-1.0, 0.0);
tolerance = FastMath.max(solver.getAbsoluteAccuracy(),
FastMath.abs(expected.abs() * solver.getRelativeAccuracy()));
TestUtils.assertContains(result, expected, tolerance);
expected = new Complex(0.5, -0.5 * FastMath.sqrt(3.0));
tolerance = FastMath.max(solver.getAbsoluteAccuracy(),
FastMath.abs(expected.abs() * solver.getRelativeAccuracy()));
TestUtils.assertContains(result, expected, tolerance);
}