_nmod_poly_divrem_newton_n_preinv, nmod_poly_divrem_newton_n_preinv
#include <flint/nmod_poly.h>void _nmod_poly_divrem_newton_n_preinv(nn_ptr Q, nn_ptr R, nn_srcptr A, slong lenA, nn_srcptr B, slong lenB, nn_srcptr Binv, slong lenBinv, nmod_t mod)sourcevoid nmod_poly_divrem_newton_n_preinv(nmod_poly_t Q, nmod_poly_t R, const nmod_poly_t A, const nmod_poly_t B, const nmod_poly_t Binv)sourceSet Q and R to the quotient and remainder of A by B, given Binv as for nmod_poly_div_newton_n_preinv; the remainder is A - BQ computed by a short product. The underscore version requires \mathit{lenA} \ge \mathit{lenB} \ge 1 and does not allow the outputs to overlap the inputs.
For quotients of length 2 the schoolbook routine is used with Binv[0] = \operatorname{lc}(B)^{-1}. For \mathit{lenB} > 20 and divisors with at most five nonzero coefficients below the leading one, the division is done directly in O(\mathit{lenA}) operations, which makes arithmetic modulo sparse polynomials, such as the trinomials and pentanomials used to define finite fields, efficient.
Guides#
The FLINT team, “_nmod_poly_divrem_newton_n_preinv, nmod_poly_divrem_newton_n_preinv (nmod_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nmod_poly/_nmod_poly_divrem_newton_n_preinv.html (generated 2026-10-20).
@misc{flint-doc-nmod-poly-nmod-poly-divrem-newton-n-preinv,
author = {{The FLINT team}},
title = {{\_nmod\_poly\_divrem\_newton\_n\_preinv, nmod\_poly\_divrem\_newton\_n\_preinv (nmod\_poly.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/nmod_poly/_nmod_poly_divrem_newton_n_preinv.html},
note = {Generated 2026-10-20}
}