AngouriMath

Navigation

RationalPolynomial


← Back to list of classes

Description

Summary

A polynomial in one variable over the rationals, stored densely.

Remarks

A third polynomial representation, next to IntegerPolynomial and
MultivariatePolynomial, because division is the operation this one exists
for. Factoring works over Z, where content, primitive parts and Mignotte's bound
all mean something; a partial fraction decomposition works over Q, where every
polynomial can be divided by any other and the extended Euclidean algorithm terminates
with a genuine unit. Doing that over Z means carrying a scaling factor beside
every intermediate, which is where the sign and content errors live.
Trailing zero coefficients are never stored, so Degree is
coefficients.Length - 1 and the zero polynomial is the empty array with degree
-1. Coefficients are lowest power first, the order the rest of
Functions/Algebra/Polynomials uses.
Every coefficient is reduced to lowest terms as it is written. ERational does not do that on its own, and a remainder sequence that leaves it undone multiplies
numerator and denominator up at every step: the ratios stay correct and become
arbitrarily expensive to compare, which is the failure that looks like a hang.

Members

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online