mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[poincare] use deepReduce instead of reduce
This commit is contained in:
@@ -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). */
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user