_gr_poly_powmod_ui_binexp, gr_poly_powmod_ui_binexp, _gr_poly_powmod_ui_binexp_preinv, gr_poly_powmod_ui_binexp_preinv, _gr_poly_powmod_fmpz_binexp, gr_poly_powmod_fmpz_binexp, _gr_poly_powmod_fmpz_binexp_preinv, gr_poly_powmod_fmpz_binexp_preinv, _gr_poly_powmod_fmpz_sliding_preinv, gr_poly_powmod_fmpz_sliding_preinv, _gr_poly_powmod_x_fmpz_preinv, gr_poly_powmod_x_fmpz_preinv
#include <flint/gr_poly.h>int _gr_poly_powmod_ui_binexp(gr_ptr res, gr_srcptr poly, slong len, ulong e, gr_srcptr f, slong lenf, gr_ctx_t ctx)sourceint gr_poly_powmod_ui_binexp(gr_poly_t res, const gr_poly_t poly, ulong e, const gr_poly_t f, gr_ctx_t ctx)sourceint _gr_poly_powmod_ui_binexp_preinv(gr_ptr res, gr_srcptr poly, slong len, ulong e, gr_srcptr f, slong lenf, gr_srcptr finv, slong lenfinv, gr_ctx_t ctx)sourceint gr_poly_powmod_ui_binexp_preinv(gr_poly_t res, const gr_poly_t poly, ulong e, const gr_poly_t f, const gr_poly_t finv, gr_ctx_t ctx)sourceint _gr_poly_powmod_fmpz_binexp(gr_ptr res, gr_srcptr poly, slong len, const fmpz_t e, gr_srcptr f, slong lenf, gr_ctx_t ctx)sourceint gr_poly_powmod_fmpz_binexp(gr_poly_t res, const gr_poly_t poly, const fmpz_t e, const gr_poly_t f, gr_ctx_t ctx)sourceint _gr_poly_powmod_fmpz_binexp_preinv(gr_ptr res, gr_srcptr poly, slong len, const fmpz_t e, gr_srcptr f, slong lenf, gr_srcptr finv, slong lenfinv, gr_ctx_t ctx)sourceint gr_poly_powmod_fmpz_binexp_preinv(gr_poly_t res, const gr_poly_t poly, const fmpz_t e, const gr_poly_t f, const gr_poly_t finv, gr_ctx_t ctx)sourceint _gr_poly_powmod_fmpz_sliding_preinv(gr_ptr res, gr_srcptr poly, slong len, const fmpz_t e, ulong k, gr_srcptr f, slong lenf, gr_srcptr finv, slong lenfinv, gr_ctx_t ctx)sourceint gr_poly_powmod_fmpz_sliding_preinv(gr_poly_t res, const gr_poly_t poly, const fmpz_t e, ulong k, const gr_poly_t f, const gr_poly_t finv, gr_ctx_t ctx)sourceint _gr_poly_powmod_x_fmpz_preinv(gr_ptr res, const fmpz_t e, gr_srcptr f, slong lenf, gr_srcptr finv, slong lenfinv, gr_ctx_t ctx)sourceint gr_poly_powmod_x_fmpz_preinv(gr_poly_t res, const fmpz_t e, const gr_poly_t f, const gr_poly_t finv, gr_ctx_t ctx)sourceSet res to poly raised to the power e modulo f, by binary exponentiation, by sliding window exponentiation with window size k (k = 0 chooses it from the size of e), or, for the x versions, x^e \bmod f with shifts instead of multiplications by the base.
The underscore versions with a base require a reduced base (\mathit{len} < \mathit{lenf}), \mathit{lenf} \ge 2 and e \ge 0, write \mathit{lenf} - 1 coefficients (zero-padded, not normalised), and allow res to be poly; the x version requires \mathit{lenf} \ge 3. The preinv versions accept \mathit{lenfinv} = 0, in which case ordinary division is used. The intermediate powers are kept at their actual length, so that powers of a polynomial of small degree, such as x, cost nothing until the degree reaches \deg f; the iterated Frobenius x^{p^i} is thus free while p^i < \deg f.
The FLINT team, “_gr_poly_powmod_ui_binexp, gr_poly_powmod_ui_binexp, _gr_poly_powmod_ui_binexp_preinv, gr_poly_powmod_ui_binexp_preinv, _gr_poly_powmod_fmpz_binexp, gr_poly_powmod_fmpz_binexp, _gr_poly_powmod_fmpz_binexp_preinv, gr_poly_powmod_fmpz_binexp_preinv, _gr_poly_powmod_fmpz_sliding_preinv, gr_poly_powmod_fmpz_sliding_preinv, _gr_poly_powmod_x_fmpz_preinv, gr_poly_powmod_x_fmpz_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_powmod_ui_binexp.html (generated 2026-10-20).
@misc{flint-doc-gr-poly-gr-poly-powmod-ui-binexp,
author = {{The FLINT team}},
title = {{\_gr\_poly\_powmod\_ui\_binexp, gr\_poly\_powmod\_ui\_binexp, \_gr\_poly\_powmod\_ui\_binexp\_preinv, gr\_poly\_powmod\_ui\_binexp\_preinv, \_gr\_poly\_powmod\_fmpz\_binexp, gr\_poly\_powmod\_fmpz\_binexp, \_gr\_poly\_powmod\_fmpz\_binexp\_preinv, gr\_poly\_powmod\_fmpz\_binexp\_preinv, \_gr\_poly\_powmod\_fmpz\_sliding\_preinv, gr\_poly\_powmod\_fmpz\_sliding\_preinv, \_gr\_poly\_powmod\_x\_fmpz\_preinv, gr\_poly\_powmod\_x\_fmpz\_preinv (gr\_poly.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/gr_poly/_gr_poly_powmod_ui_binexp.html},
note = {Generated 2026-10-20}
}