_nmod_mul_bounded, _nmod_addmul_bounded, _nmod_fmma_bounded
#include <flint/nmod.h>Return , and modulo , for reduced operands, with one reduction by NMOD_RED2_BOUNDED (Low-level macros), which is cheaper than the reductions of nmod_mul, nmod_addmul and nmod_fmma. The first two require NMOD_CAN_USE_MUL_BOUNDED(mod), that is where is the number of bits of ; the third requires NMOD_CAN_USE_FMMA_BOUNDED(mod), that is . For other the result is wrong. As for _nmod_mul_halflimb, test the modulus once and write two loops rather than testing it at each product: a test inside nmod_mul was measured to make some compilers evaluate both reductions, or branch, at each product. For , and fit in one word, and _nmod_mul_halflimb, or NMOD_RED of , is cheaper still; so is NMOD_RED of for . The loops of FLINT test for these moduli first.
Guides#
The FLINT team, “_nmod_mul_bounded, _nmod_addmul_bounded, _nmod_fmma_bounded (nmod.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nmod/_nmod_mul_bounded.html (generated 2026-11-20).
@misc{flint-doc-nmod-nmod-mul-bounded,
author = {{The FLINT team}},
title = {{\_nmod\_mul\_bounded, \_nmod\_addmul\_bounded, \_nmod\_fmma\_bounded (nmod.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/nmod/_nmod_mul_bounded.html},
note = {Generated 2026-11-20}
}