FLINT3.7.0-dev

_nmod_poly_gcd_hgcd, nmod_poly_gcd_hgcd

Synopsis#include <flint/nmod_poly.h>
slong _nmod_poly_gcd_hgcd(nn_ptr G, nn_srcptr A, slong lenA, nn_srcptr B, slong lenB, nmod_t mod)source
void nmod_poly_gcd_hgcd(nmod_poly_t G, const nmod_poly_t A, const nmod_poly_t B)source

The GCD by the half-GCD algorithm, with the conventions of _nmod_poly_gcd and nmod_poly_gcd. Its complexity is O(M(n) \log n), where M(n) is the cost of a multiplication of length n.

The outer loop calls _nmod_poly_hgcd to reduce the operands to about half their length, and finishes with the Euclidean algorithm once they are shorter than nmod_poly_hgcd_outer_cutoff(mod).

Cite this page

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