FLINT3.7.0-dev

flint_mpn_mul_toom22

Synopsis#include <flint/mpn_extras.h>
void flint_mpn_mul_toom22(mp_ptr pp, mp_srcptr ap, mp_size_t an, mp_srcptr bp, mp_size_t bn, mp_ptr scratch)source

Karatsuba (Toom-22) multiplication, a port of GMP's mpn_toom22_mul that recurses into flint_mpn_mul, so that FLINT's assembly basecases are used at the leaves. Sets (\mathit{pp}, \mathit{an} + \mathit{bn}) to the product, for \mathit{an} \ge \mathit{bn} with 4 \mathit{an} < 5 \mathit{bn} (as required by GMP). scratch must have room for 2 \mathit{an} + 2 \mathtt{FLINT\_BITS} limbs, or be NULL for internal allocation.

Cite this page

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