_fq_nmod_reduce, _fq_nmod_sparse_reduce, _fq_nmod_dense_reduce
#include <flint/fq_nmod.h>void _fq_nmod_reduce(ulong * R, slong lenR, const fq_nmod_ctx_t ctx)sourcevoid _fq_nmod_sparse_reduce(ulong * R, slong lenR, const fq_nmod_ctx_t ctx)sourcevoid _fq_nmod_dense_reduce(ulong * R, slong lenR, const fq_nmod_ctx_t ctx)sourceReduce (R, lenR), with coefficients in [0, p) and \mathit{lenR} \le 2d (any length for the sparse version), modulo the defining polynomial in place, leaving the result in the first d coefficients. _fq_nmod_sparse_reduce eliminates the high coefficients with the nonzero terms of f, with special code for p = 2 (exclusive or), for moduli whose nonzero coefficients are all 1 (subtractions only), and for p < 2^{\mathtt{FLINT\_BITS}/2} (Barrett reduction of a single-word product); _fq_nmod_dense_reduce uses Newton division with the precomputed inverse. _fq_nmod_reduce chooses the sparse version if f has at most five nonzero terms. See Reduction modulo the defining polynomial.
The FLINT team, “_fq_nmod_reduce, _fq_nmod_sparse_reduce, _fq_nmod_dense_reduce (fq_nmod.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fq_nmod/_fq_nmod_reduce.html (generated 2026-10-20).
@misc{flint-doc-fq-nmod-fq-nmod-reduce,
author = {{The FLINT team}},
title = {{\_fq\_nmod\_reduce, \_fq\_nmod\_sparse\_reduce, \_fq\_nmod\_dense\_reduce (fq\_nmod.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fq_nmod/_fq_nmod_reduce.html},
note = {Generated 2026-10-20}
}