flint_mpn_mulmid_complex, flint_mpn_sqrmid_complex
#include <flint/mpn_extras.h>void flint_mpn_mulmid_complex(nn_ptr zr, nn_ptr zi, mp_size_t lo, mp_size_t hi, nn_srcptr ar, mp_size_t arn, int ar_sgn, nn_srcptr ai, mp_size_t ain, int ai_sgn, nn_srcptr br, mp_size_t brn, int br_sgn, nn_srcptr bi, mp_size_t bin, int bi_sgn)sourcevoid flint_mpn_sqrmid_complex(nn_ptr zr, nn_ptr zi, mp_size_t lo, mp_size_t hi, nn_srcptr ar, mp_size_t arn, int ar_sgn, nn_srcptr ai, mp_size_t ain, int ai_sgn)sourceWindowed products: zr and zi receive limbs each, , the limbs of the real and imaginary parts in two's complement: for each exact part the window is with a small error . For these are the low products (); on the transformed path ; otherwise with . Inputs are as for the low products (only their low limbs are read).
The two's complement window of a signed part is linear, so the real windows of the schoolbook and Karatsuba schemes combine modulo , and it is what a Kronecker unpacking of signed fields reads. To extract the polynomial coefficients of -bit fields, take and a few guard limbs below bit ; the unpacked fields are exact provided that is below the distance from the low part to , which a bound makes at least (see _fmpzi_poly_mulmid_KS, which uses three guard limbs).
The schoolbook and Karatsuba variants combine real windows from flint_mpn_mulmid. The transformed variant splits the integers into chunks and multiplies them as chunk sequences on fft_small transforms (four forward and two inverse transforms; two and two for the square), reconstructing only the coefficients that can reach limbs . When a power of two admits it (operands and the coefficients below the top of the window fitting in , and the coefficients beyond aliasing below the first one reaching the window) the transforms are cyclic of length . For the shape of the Newton middle product ( by limbs, window ) this gives a transform of about chunks instead of when chunks lie a little below a power of two.
The FLINT team, “flint_mpn_mulmid_complex, flint_mpn_sqrmid_complex (mpn_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mpn_extras/flint_mpn_mulmid_complex.html (generated 2026-11-02).
@misc{flint-doc-mpn-extras-flint-mpn-mulmid-complex,
author = {{The FLINT team}},
title = {{flint\_mpn\_mulmid\_complex, flint\_mpn\_sqrmid\_complex (mpn\_extras.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/mpn_extras/flint_mpn_mulmid_complex.html},
note = {Generated 2026-11-02}
}