_nmod_red3_fold_can_skip_sub, _nmod_red3_precomp_init, _nmod_red3_precomp
#include <flint/nmod.h>void _nmod_red3_precomp_init(nmod_red3_precomp_struct * P, ulong ymax, nmod_t mod)sourceulong _nmod_red3_precomp(ulong a_hi, ulong a_me, ulong a_lo, const nmod_red3_precomp_struct * P, nmod_t mod)source_nmod_red3_fold_can_skip_sub returns whether with = ymax, the exact condition for NMOD_RED3_FOLD_FULLWORD_NOSUB on inputs with . _nmod_red3_precomp_init sets P for and inputs with ymax (pass UWORD_MAX if no bound is known), and _nmod_red3_precomp returns for such inputs: by n_lll_mod_barrett for , and by one of the two folds above otherwise. In a loop, testing P->nosub before the loop and calling NMOD_RED3_FOLD_FULLWORD_NOSUB directly when it is set is faster with clang, which leaves the tests of _nmod_red3_precomp in the loop and then compiles the reductions with branches.
The FLINT team, “_nmod_red3_fold_can_skip_sub, _nmod_red3_precomp_init, _nmod_red3_precomp (nmod.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nmod/_nmod_red3_fold_can_skip_sub.html (generated 2026-11-20).
@misc{flint-doc-nmod-nmod-red3-fold-can-skip-sub,
author = {{The FLINT team}},
title = {{\_nmod\_red3\_fold\_can\_skip\_sub, \_nmod\_red3\_precomp\_init, \_nmod\_red3\_precomp (nmod.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/nmod/_nmod_red3_fold_can_skip_sub.html},
note = {Generated 2026-11-20}
}