ANumber d = (ANumber) dd;
if (d.isNegative()) {
return new EmptySet();
} else if (d.isZero()) {
return new FiniteSet(new Division(new Negation(b),
new Multiplication(two, a)).evaluate());
}
}
Expression sd = new Sqrt(dd);
Expression x1 = new Division(
new Addition(new Negation(b), sd),
new Multiplication(two, a));
Expression x2 = new Division(
new Subtraction(new Negation(b), sd),
new Multiplication(two, a));
ExpressionContext.getInstance().addExpression(new Equality(Numbers.variable("x", 1), x1));
ExpressionContext.getInstance().addExpression(new Equality(Numbers.variable("x", 2), x2));