assertEquals(expected, roots);
}
@Test(dependsOnMethods = { "fraction" })
public void irrational() throws EquationSolveException {
ExpressionParser parser = new ExpressionParser();
// Equation quad = (Equation) parser.parse("sqrt(3) x^2 + sqrt(5) x = 12");
Equation quad = (Equation) parser.parse("sqrt(3)*x^2 + sqrt(5) x = 12");
Variable x = quad.variable();
System.out.printf("%s : %s = ?%n", quad, x);
Set roots = quad.solve();
System.out.printf(" %s = %s%n", x, roots);
Expression x1 = parser.parse("(sqrt(15 + 144sqrt(3)) - sqrt(15)) / 6");
Expression x2 = parser.parse("(-sqrt(15) - sqrt(15 + 144sqrt(3))) / 6");
Expression expected = new FiniteSet(x1, x2);
assertEquals(expected, roots);
}