FLINT3.7.0-dev

_fmpz_poly_mulmid_toom_scalar, _fmpz_poly_mulmid_toom_scalar_nmax, fmpz_poly_mulmid_toom_scalar

Synopsis#include <flint/fmpz_poly.h>
int _fmpz_poly_mulmid_toom_scalar(fmpz * res, const fmpz * poly1, slong len1, const fmpz * poly2, slong len2, slong nlo, slong nhi)source
int _fmpz_poly_mulmid_toom_scalar_nmax(fmpz * res, const fmpz * poly1, slong len1, const fmpz * poly2, slong len2, slong nlo, slong nhi, slong nmax)source
int fmpz_poly_mulmid_toom_scalar(fmpz_poly_t res, const fmpz_poly_t poly1, const fmpz_poly_t poly2, slong nlo, slong nhi)source

Compute the middle product window [\mathit{nlo}, \mathit{nhi}) as _fmpz_poly_mulmid, by Toom–Cook interpolation. With m, n the lengths of the operands after removing coefficients that cannot contribute and w the length of the window, the number of coefficient multiplications is the sum of the two smallest of m, n, w, minus one: either a full product of the trimmed operands, or, transposed, a middle product of the window against the shorter operand. Return 0, leaving res unchanged, when both routes exceed the length bound of _fmpz_poly_mul_toom_scalar_nmax.

The count is symmetric in the three lengths, as the transposition principle requires, and is optimal when the window touches an end of the product. A narrow window can be supported when the full product is not: four coefficients of a 16 \times 16 product need 19 multiplications, the full product 31.

The underscore versions take the lengths in either order and require 0 \le \mathit{nlo} < \mathit{nhi} \le \mathit{len1} + \mathit{len2} - 1 and no overlap of res with the inputs.

Cite this page

The FLINT team, “_fmpz_poly_mulmid_toom_scalar, _fmpz_poly_mulmid_toom_scalar_nmax, fmpz_poly_mulmid_toom_scalar (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_toom_scalar.html (generated 2026-10-20).