FLINT3.7.0-dev

_fft_small_mpn_mul_complex, _fft_small_mpn_sqr_complex

Synopsis#include <flint/fft_small.h>
int _fft_small_mpn_mul_complex(nn_ptr zr, slong * zr_len, nn_ptr zi, slong * zi_len, slong lo, slong hi, nn_srcptr ar, slong arn, int ar_sgn, nn_srcptr ai, slong ain, int ai_sgn, nn_srcptr br, slong brn, int br_sgn, nn_srcptr bi, slong bin, int bi_sgn)source
int _fft_small_mpn_sqr_complex(nn_ptr zr, slong * zr_len, nn_ptr zi, slong * zi_len, slong lo, slong hi, nn_srcptr ar, slong arn, int ar_sgn, nn_srcptr ai, slong ain, int ai_sgn)source

Write the magnitudes of the limbs [\mathit{lo}, \mathit{hi}) of the real and imaginary parts of the product, respectively the square, to zr and zi (\mathit{hi} - \mathit{lo} limbs each, enough to hold the parts shifted right by \mathit{lo} limbs), and their lengths, negated for negative parts, to *zr_len and *zi_len. Exact for \mathit{lo} = 0 and otherwise within (-1.5, 0.5) units of the lowest limb. Return 0 if no plan exists.

Only the nonzero parts are transformed, so a real or imaginary operand costs one transform for both output parts. Each output part is a sum of at most two products, formed with its signs in transform space and exported signed; an output part that is a single product with \mathit{lo} = 0 is exported unsigned with its known sign, and if all are, the plan is unsigned and packs more bits per chunk. Storage for five transforms is needed for a product and three for a square. A full product (\mathit{lo} = 0, not a square) of an operand with a single nonzero part by a complex one consists of two products with a common factor and is passed to _fft_small_mpn_mul_shared when the outputs do not overlap the operands in a way that function forbids.

Cite this page

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