@@ -436,19 +436,17 @@ Expression Addition::factorizeOnCommonDenominator(ExpressionNode::ReductionConte
436436 * parent here), which would be replaced with undef.
437437 * Example: int((ℯ^(-x))-x^(0.5), x, 0, 3), when creating the common
438438 * denominator for the integrand. */
439- ExpressionNode::ReductionContext contextWithSymbolicComputation = ExpressionNode::ReductionContext (
440- reductionContext.context (),
441- reductionContext.complexFormat (),
442- reductionContext.angleUnit (),
443- reductionContext.unitFormat (),
444- reductionContext.target (),
445- ExpressionNode::SymbolicComputation::DoNotReplaceAnySymbol);
439+ ExpressionNode::SymbolicComputation previousSymbolicComputation = reductionContext.symbolicComputation ();
440+ reductionContext.setSymbolicComputation (ExpressionNode::SymbolicComputation::DoNotReplaceAnySymbol);
446441
447442 // Step 4: Simplify the numerator
448- numerator.shallowReduce (contextWithSymbolicComputation );
443+ numerator.shallowReduce (reductionContext );
449444
450445 // Step 5: Simplify the denominator (in case it's a rational number)
451- inverseDenominator.deepReduce (contextWithSymbolicComputation);
446+ inverseDenominator.deepReduce (reductionContext);
447+
448+ // Restore symbolicComputation status
449+ reductionContext.setSymbolicComputation (previousSymbolicComputation);
452450
453451 /* Step 6: We simplify the resulting multiplication forbidding any
454452 * distribution of multiplication on additions (to avoid an infinite loop).
0 commit comments