FLINT3.7.0-dev

_gr_poly_div_newton_n_preinv, gr_poly_div_newton_n_preinv, _gr_poly_divrem_newton_n_preinv, gr_poly_divrem_newton_n_preinv

Synopsis#include <flint/gr_poly.h>
int _gr_poly_div_newton_n_preinv(gr_ptr Q, gr_srcptr A, slong lenA, gr_srcptr B, slong lenB, gr_srcptr Binv, slong lenBinv, gr_ctx_t ctx)source
int gr_poly_div_newton_n_preinv(gr_poly_t Q, const gr_poly_t A, const gr_poly_t B, const gr_poly_t Binv, gr_ctx_t ctx)source
int _gr_poly_divrem_newton_n_preinv(gr_ptr Q, gr_ptr R, gr_srcptr A, slong lenA, gr_srcptr B, slong lenB, gr_srcptr Binv, slong lenBinv, gr_ctx_t ctx)source
int gr_poly_divrem_newton_n_preinv(gr_poly_t Q, gr_poly_t R, const gr_poly_t A, const gr_poly_t B, const gr_poly_t Binv, gr_ctx_t ctx)source

Division with remainder (or quotient only) given Binv, the inverse of the reversal of B modulo x^{\mathit{lenB}}, which can be computed once with gr_poly_inv_series and reused for many divisions by B. The quotient is the reversal of a single truncated product, and the remainder costs one more product. The non-underscore versions return GR_UNABLE if \mathit{lenA} > 2 \mathit{lenB} - 2.

The underscore versions require \mathit{lenA} - \mathit{lenB} + 1 \le \mathit{lenBinv} for a correct quotient; all versions return GR_UNABLE when \mathit{lenBinv} = 0 (no inverse available), as when the caller failed to invert B. B is not read by the quotient-only version. For dividends of any length and for repeated reductions, gr_poly_preinv_divrem with a gr_poly_preinv_t is more convenient.

Cite this page

The FLINT team, “_gr_poly_div_newton_n_preinv, gr_poly_div_newton_n_preinv, _gr_poly_divrem_newton_n_preinv, gr_poly_divrem_newton_n_preinv (gr_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/gr_poly/_gr_poly_div_newton_n_preinv.html (generated 2026-10-20).