From cc83fec322f248535e7660e384481c0aaa1ea5cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Mon, 10 Dec 2018 11:29:56 +0100 Subject: [PATCH] [poincare} Power::complexPolarPart: avoid an extra shallowReduce by inserting *(-1) instead of an OppositeNode --- poincare/src/power.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/poincare/src/power.cpp b/poincare/src/power.cpp index 83797321a..5b6bf0420 100644 --- a/poincare/src/power.cpp +++ b/poincare/src/power.cpp @@ -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(