[poincare] Remove useless factorization

This commit is contained in:
Émilie Feral
2019-08-20 16:39:59 +02:00
parent 246b545683
commit a70707ea2f
2 changed files with 4 additions and 14 deletions

View File

@@ -24,7 +24,6 @@ public:
template <typename T> static std::complex<T> ConvertRadianToAngleUnit(const std::complex<T> c, Preferences::AngleUnit angleUnit);
template <typename T> static std::complex<T> RoundToMeaningfulDigits(const std::complex<T> result, const std::complex<T> input);
private:
static Expression mapIfPossible(Expression & e, ExpressionNode::ReductionContext reductionContext);
template <typename T> static T RoundToMeaningfulDigits(T result, T input);
};

View File

@@ -124,9 +124,8 @@ Expression Trigonometry::shallowReduceDirectFunction(Expression & e, ExpressionN
// Step 0. Map on matrix child if possible
{
Expression mapped = mapIfPossible(e, reductionContext);
if (!mapped.isUninitialized()) {
return mapped;
if (e.childAtIndex(0).type() == ExpressionNode::Type::Matrix) {
return e.mapOnMatrixFirstChild(reductionContext);
}
}
@@ -295,9 +294,8 @@ Expression Trigonometry::shallowReduceInverseFunction(Expression & e, Expressio
assert(isInverseTrigonometryFunction(e));
// Step 0. Map on matrix child if possible
{
Expression mapped = mapIfPossible(e, reductionContext);
if (!mapped.isUninitialized()) {
return mapped;
if (e.childAtIndex(0).type() == ExpressionNode::Type::Matrix) {
return e.mapOnMatrixFirstChild(reductionContext);
}
}
@@ -415,13 +413,6 @@ std::complex<T> Trigonometry::ConvertRadianToAngleUnit(const std::complex<T> c,
return c;
}
Expression Trigonometry::mapIfPossible(Expression & e, ExpressionNode::ReductionContext reductionContext) {
if (e.childAtIndex(0).type() == ExpressionNode::Type::Matrix) {
return e.mapOnMatrixFirstChild(reductionContext);
}
return Expression();
}
template<typename T>
T Trigonometry::RoundToMeaningfulDigits(T result, T input) {
/* Cheat: openbsd trigonometric functions are numerical implementation and