mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-28 01:59:59 +01:00
[poincare] Remove useless factorization
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user