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 c modulo modn by Horner's rule with Shoup multiplication, given c_precomp = n_mulmod_precomp_shoup(c, modn). Require c < \mathit{modn} < 2^{\mathtt{FLINT\_BITS} - 1}.

The lazy version does not reduce the additions: if all coefficients are less than m and m \le 2^{\mathtt{FLINT\_BITS}} - 2\,\mathit{modn} + 1, it returns a value in [0, m + 2\,\mathit{modn} - 1) congruent to the result. The coefficients need not be reduced. With reduced coefficients (m = \mathit{modn}) this requires 3\,\mathit{modn} - 1 \le 2^{\mathtt{FLINT\_BITS}}, and the result is reduced by subtracting \mathit{modn} or 2\,\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-10-20).