FLINT3.7.0-dev

_nmod_poly_mulmid_fft_small_repack

Synopsis#include <flint/nmod_poly.h>
int _nmod_poly_mulmid_fft_small_repack(nn_ptr z, nn_srcptr a, slong an, nn_srcptr b, slong bn, slong znlo, slong zn, nmod_t mod)source

Internal helper of _nmod_poly_mulmid_fft_small for n≤23n \le 23: if the coefficients are small enough, writes the coefficients znlo,…,zn−1\mathit{znlo}, \ldots, \mathit{zn} - 1 of the product to z and returns 1; otherwise returns 0 without writing anything. The conditions on the arguments are those of _nmod_poly_mulmid_fft_small.

With A2(x)=∑k(a2k+a2k+1M)xkA_2(x) = \sum_k (a_{2k} + a_{2k+1} M) x^k and B2B_2 likewise, for M=216M = 2^{16} or 2172^{17}, the product A2B2A_2 B_2 computed modulo the prime p=1108307720798209p = 1108307720798209 has coefficients c0+c1M+c2M2c_0 + c_1 M + c_2 M^2 from which the coefficients of ABAB are read off, provided that c0,c1<Mc_0, c_1 < M and c2M2<pc_2 M^2 < p. These conditions are checked with the bound min⁡(an,bn)(n−1)2\min(\mathit{an}, \mathit{bn}) (n-1)^2 or, if that fails, with the Cauchy–Schwarz inequality applied to the even and odd parts.

Cite this page

The FLINT team, “_nmod_poly_mulmid_fft_small_repack (nmod_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nmod_poly/_nmod_poly_mulmid_fft_small_repack.html (generated 2026-11-02).