[poincare] use deepReduce instead of reduce

This commit is contained in:
Léa Saviot
2018-11-08 10:48:08 +01:00
committed by Émilie Feral
parent 0511f383d0
commit f65b133b37
2 changed files with 2 additions and 2 deletions

View File

@@ -334,7 +334,7 @@ Expression Addition::factorizeOnCommonDenominator(Context & context, Preferences
numerator.shallowReduce(context, angleUnit);
// Step 5: Simplify the denominator (in case it's a rational number)
inverseDenominator.reduce(context, angleUnit);
inverseDenominator.deepReduce(context, angleUnit);
/* Step 6: We simplify the resulting multiplication forbidding any
* distribution of multiplication on additions (to avoid an infinite loop). */

View File

@@ -574,7 +574,7 @@ void Multiplication::addMissingFactors(Expression factor, Context & context, Pre
* base if any. Otherwise, we add it as an new child. */
for (int i = 0; i < numberOfChildren(); i++) {
if (TermsHaveIdenticalBase(childAtIndex(i), factor)) {
Expression sub = Subtraction(CreateExponent(childAtIndex(i)), CreateExponent(factor)).reduce(context, angleUnit);
Expression sub = Subtraction(CreateExponent(childAtIndex(i)), CreateExponent(factor)).deepReduce(context, angleUnit);
if (sub.sign() == ExpressionNode::Sign::Negative) { // index[0] < index[1]
sub = Opposite(sub);
if (factor.type() == ExpressionNode::Type::Power) {