Skip to main content

Module polynomial_algebra

Module polynomial_algebra 

Source
Expand description

Dense univariate polynomial algebra over f64 coefficients.

A Polynomial stores its dense coefficient vector little-endian: index i holds the coefficient of x^i. The vector is kept trimmed so the leading (highest-index) coefficient is non-zero, except for the zero polynomial which is represented by an empty vector (degree reported as None).

Provided: add, sub, mul, long division (quotient + remainder), Euclidean gcd, derivative, Horner eval, and the resultant of two polynomials via the Euclidean (subresultant-style) remainder sequence.

Fallible operations (dividing by the zero polynomial) fail closed with Option and never fabricate a result.

Structsยง

Polynomial
Dense univariate polynomial with f64 coefficients, little-endian.