FLINT3.7.0-dev

_nmod_poly_evaluate_nmod_precomp, _nmod_poly_evaluate_nmod_precomp_lazy

Synopsis#include <flint/nmod_poly.h>
ulong _nmod_poly_evaluate_nmod_precomp(nn_srcptr poly, slong len, ulong c, ulong c_precomp, ulong modn)source
ulong _nmod_poly_evaluate_nmod_precomp_lazy(nn_srcptr poly, slong len, ulong c, ulong c_precomp, ulong modn)source

Evaluate poly at cc modulo modn by Horner's rule with Shoup multiplication, given c_precomp = n_mulmod_precomp_shoup(c, modn). Require c<modn<2FLINT_BITS−1c < \mathit{modn} < 2^{\mathtt{FLINT\_BITS} - 1}.

The lazy version does not reduce the additions: if all coefficients are less than mm and m≤2FLINT_BITS−2 modn+1m \le 2^{\mathtt{FLINT\_BITS}} - 2\,\mathit{modn} + 1, it returns a value in [0,m+2 modn−1)[0, m + 2\,\mathit{modn} - 1) congruent to the result. The coefficients need not be reduced. With reduced coefficients (m=modnm = \mathit{modn}) this requires 3 modn−1≤2FLINT_BITS3\,\mathit{modn} - 1 \le 2^{\mathtt{FLINT\_BITS}}, and the result is reduced by subtracting modn\mathit{modn} or 2 modn2\,\mathit{modn}.

Cite this page

The FLINT team, “_nmod_poly_evaluate_nmod_precomp, _nmod_poly_evaluate_nmod_precomp_lazy (nmod_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nmod_poly/_nmod_poly_evaluate_nmod_precomp.html (generated 2026-11-02).