[poincare} Power::complexPolarPart: avoid an extra shallowReduce by

inserting *(-1) instead of an OppositeNode
This commit is contained in:
Émilie Feral
2018-12-10 11:29:56 +01:00
committed by Léa Saviot
parent be741415b0
commit cc83fec322

View File

@@ -98,12 +98,9 @@ Expression PowerNode::complexPolarPart(Context & context, Preferences::AngleUnit
Power(r, c).shallowReduce(context, angleUnit, ReductionTarget::BottomUpComputation),
Power(
Constant(Ion::Charset::Exponential),
Opposite(
Multiplication(th, d).shallowReduce(context, angleUnit, ReductionTarget::BottomUpComputation)
).shallowReduce(context, angleUnit, ReductionTarget::BottomUpComputation)
Multiplication(Rational(-1), th, d).shallowReduce(context, angleUnit, ReductionTarget::BottomUpComputation)
).shallowReduce(context, angleUnit, ReductionTarget::BottomUpComputation)
).shallowReduce(context, angleUnit, ReductionTarget::BottomUpComputation);
//return Power(Constant(Ion::Charset::Exponential), Subtraction(Multiplication(c, NaperianLogarithm::Builder(r)), Multiplication(d, th)));
} else {
// TH = d*ln(r)+c*th
return Addition(