FLINT3.7.0-dev

flint_mpn_mulmod_preinv1

Synopsis#include <flint/mpn_extras.h>
void flint_mpn_mulmod_preinv1(mp_ptr r, mp_srcptr a, mp_srcptr b, mp_size_t n, mp_srcptr d, mp_limb_t dinv, ulong norm)source

Sets (r, n) to ab \bmod d, where d is the normalised modulus (d, n) with dinv = flint_mpn_preinv1(d[n - 1], d[n - 2]) (for n = 1, flint_mpn_preinv1(d[0], 0), which equals n_preinvert_limb(d[0])). If a, b and d have all been shifted left by norm bits so that d is normalised, the result carries the same shift. The product is reduced by _flint_mpn_divrem_preinv1.

Cite this page

The FLINT team, “flint_mpn_mulmod_preinv1 (mpn_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mpn_extras/flint_mpn_mulmod_preinv1.html (generated 2026-10-20).