Raw Univariate Polynomial Division #
Division algorithms for raw computable univariate polynomials.
@[inline, specialize #[]]
def
CompPoly.CPolynomial.Raw.modByMonicRemainderOnly
{R : Type u_1}
[BEq R]
[Field R]
(p q : Raw R)
:
Raw R
Remainder-only long division by a monic polynomial.
Unlike modByMonic, this does not compute the quotient and avoids the general
polynomial multiplications used by each cancellation step. It is intended as an
executable implementation for the canonical modByMonic specification.
Instances For
@[inline, specialize #[]]
def
CompPoly.CPolynomial.Raw.inverseModX
{R : Type u_1}
[BEq R]
[Field R]
[LawfulBEq R]
(M : MulLowContext R)
(k : ℕ)
(p : Raw R)
:
Raw R
Inverse modulo X^k, using Newton iteration and the supplied low-product backend.
Instances For
@[inline, specialize #[]]
def
CompPoly.CPolynomial.Raw.modByMonicByReversal
{R : Type u_1}
[BEq R]
[Field R]
[LawfulBEq R]
(M : MulLowContext R)
(p q : Raw R)
:
Raw R
Remainder by a monic polynomial through reversal and truncated products.
For canonical monic inputs this computes the quotient from the reversed divisor
inverse modulo X^k, then subtracts only the low coefficients needed for the
remainder. Inputs outside the fast-path guard use the simple monic-remainder
implementation.