Skip to content

Commit

Permalink
computer algebra fix
Browse files Browse the repository at this point in the history
  • Loading branch information
istefanis committed Jun 27, 2024
1 parent 038c6c1 commit 29adaa9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions math/computerAlgebra/dataTypes/polynomials.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,14 @@ export const loadPolynomialsOperations = function () {
coeff(firstTerm(gcd1)),
1 + maxOrder - order(firstTerm(gcd1))
);
const numerator = divideTerms(multiplyRealByTermsArray(x, ta1), gcd1);
const denominator = divideTerms(multiplyRealByTermsArray(x, ta2), gcd1);
const numerator = divideTerms(
!isZeroWithinTolerance(x) ? multiplyRealByTermsArray(x, ta1) : ta1,
gcd1
);
const denominator = divideTerms(
!isZeroWithinTolerance(x) ? multiplyRealByTermsArray(x, ta2) : ta2,
gcd1
);
// console.log("numerator: ", numerator, "denominator: ", denominator);

// division with gcd1 returns no remainder, so:
Expand Down

0 comments on commit 29adaa9

Please sign in to comment.