FLINT3.7.0-dev

_fmpz_poly_mulmid_mpn, _fmpz_poly_mul_mpn, fmpz_poly_mulmid_mpn, fmpz_poly_mul_mpn

Synopsis#include <flint/fmpz_poly.h>
void _fmpz_poly_mulmid_mpn(fmpz * res, const fmpz * poly1, slong len1, const fmpz * poly2, slong len2, slong nlo, slong nhi)source
void _fmpz_poly_mul_mpn(fmpz * res, const fmpz * poly1, slong len1, const fmpz * poly2, slong len2)source
void fmpz_poly_mulmid_mpn(fmpz_poly_t res, const fmpz_poly_t poly1, const fmpz_poly_t poly2, slong nlo, slong nhi)source
void fmpz_poly_mul_mpn(fmpz_poly_t res, const fmpz_poly_t poly1, const fmpz_poly_t poly2)source

Middle and full products computed on packed fixed-size limb arrays instead of fmpz values, with classical, Karatsuba and Karatsuba middle-product algorithms (_flint_mpn_poly_mulmid). Intended for lengths up to a few dozen and coefficients up to about a thousand bits.

Coefficients that cannot contribute to the requested window are trimmed first. _flint_mpn_poly_mulmid_params then chooses from the bit bounds and the lengths how the inputs are packed (as unsigned, two's complement, sign-magnitude or biased n-limb integers; when all coefficients are small fmpz values, the fmpz arrays are used directly as one-limb two's complement integers), and the number of limbs s of the output; each output coefficient is computed exactly modulo 2^{\mathtt{FLINT\_BITS} s} and converted back, with a correction for the bias when needed. Squaring is detected when poly1 and poly2 are the same array with the same length.

Cite this page

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