FLINT3.7.0-dev

_padic_radix_poly_mulmid_KS, _padic_radix_poly_mulmid_mod

Synopsis#include <flint/padic_radix.h>
int _padic_radix_poly_mulmid_KS(padic_radix_struct * res, const padic_radix_struct * poly1, slong len1, const padic_radix_struct * poly2, slong len2, slong nlo, slong nhi, gr_ctx_t ctx)source
int _padic_radix_poly_mulmid_mod(padic_radix_struct * res, const padic_radix_struct * poly1, slong len1, const padic_radix_struct * poly2, slong len2, slong nlo, slong nhi, gr_ctx_t ctx)source

Middle product by Kronecker substitution in radix BB: the coefficients, scaled to the base frames of the two polynomials and truncated to the largest output window of SS limbs, are placed in slots of 2S+O(1)2S + O(1) limbs of a single radix integer, and one radix_mulmid (which uses the small-prime FFT directly in radix BB for large operands, without conversions to binary) gives every output in its own slot. The mod version instead multiplies the residues modulo BSB^S, avoiding the padding of the slots: with _nmod_poly_mulmid when S=1S = 1 and with _mpn_mod_poly_mulmid (classical, Karatsuba or the small-prime FFT, as tuned for mpn_mod) when BSB^S has at most MPN_MOD_MAX_LIMBS binary limbs, converting to binary and back; otherwise it returns GR_UNABLE. The output precisions come from min-plus convolutions of the exponent sequences (below), and coefficients whose terms are all exact are summed exactly (in windows covering the extents of the terms) when padic_radix_dot_strided_delayed would keep them exact. The results are those of _padic_radix_poly_mulmid_packed, except with the context flag PADIC_RADIX_FAST_BOUNDS, which allows smaller (but never larger) precisions. Both return GR_UNABLE in the same cases as the packed version. Outputs whose window in the base frames exceeds four times (plus 8 limbs) the largest window of an output in its own frame (all of whose terms have valuations far above the base frames, e.g. next to a few coefficients of huge valuation) are computed separately by padic_radix_dot_strided_delayed when there are few of them (costing at most about the transform and a sixteenth of the classical algorithm); otherwise, that is when the valuations vary beyond the precision along the outputs (alternating, trending or random valuations spread over more digits than the precision), both return GR_UNABLE. High-valuation coefficients that are beyond the precision of every output they contribute to cost nothing.

Cite this page

The FLINT team, “_padic_radix_poly_mulmid_KS, _padic_radix_poly_mulmid_mod (padic_radix.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/padic_radix/_padic_radix_poly_mulmid_KS.html (generated 2026-11-02).