FLINT3.7.0-dev

_nmod_poly_div_newton_n_preinv, nmod_poly_div_newton_n_preinv

Synopsis#include <flint/nmod_poly.h>
void _nmod_poly_div_newton_n_preinv(nn_ptr Q, nn_srcptr A, slong lenA, nn_srcptr B, slong lenB, nn_srcptr Binv, slong lenBinv, nmod_t mod)source
void nmod_poly_div_newton_n_preinv(nmod_poly_t Q, const nmod_poly_t A, const nmod_poly_t B, const nmod_poly_t Binv)source

Set QQ to the quotient of AA by BB, given the power series inverse Binv of the reversal of BB (see Computing modulo a fixed polynomial). The quotient is the reversal of rev⁡(A)⋅Binv mod xlenQ\operatorname{rev}(A) \cdot \mathit{Binv} \bmod x^{\mathit{lenQ}}, so Binv must be correct modulo xlenQx^{\mathit{lenQ}}, lenQ=lenA−lenB+1\mathit{lenQ} = \mathit{lenA} - \mathit{lenB} + 1. The underscore version requires lenA≥lenB≥1\mathit{lenA} \ge \mathit{lenB} \ge 1, does not read BB, and does not allow QQ to overlap Binv.

Binv is usually computed with nmod_poly_inv_series(Binv, rev(B), lenB), which is enough for lenA≤2lenB−1\mathit{lenA} \le 2 \mathit{lenB} - 1. A shorter Binv is allowed if its missing coefficients are zero, as after normalisation.

Guides#

Cite this page

The FLINT team, “_nmod_poly_div_newton_n_preinv, nmod_poly_div_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_div_newton_n_preinv.html (generated 2026-11-02).