FLINT3.7.0-dev

fmpz_xgcd_partial

Synopsis#include <flint/fmpz.h>
void fmpz_xgcd_partial(fmpz_t co2, fmpz_t co1, fmpz_t r2, fmpz_t r1, const fmpz_t L)source

Runs the extended Euclidean algorithm on r2>r1>0r_2 > r_1 > 0 until the remainder drops to at most LL, with Lehmer's acceleration. On return r2r_2 and r1r_1 are the last two remainders and co2, co1 the corresponding cofactors, with co2⋅r1−\cdot r_1 - co1⋅r2=±r2,orig\cdot r_2 = \pm r_{2,\mathrm{orig}}. No aliasing is allowed.

Cite this page

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