flint_mpn_divhigh, flint_mpn_invhigh, flint_mpn_divhigh_exact
#include <flint/mpn_extras.h>The operands are truncated to limbs (an error below on the quotient, i.e. units). With the top two limbs of each operand go through two divisions on 64-bit machines (the truncation to two limbs costs 8 units); a divisor of one limb is a chain of divisions, a short one (FLINT_MPN_DIV_SMALL_SHAPE) the register-based division, both exact; longer divisors use the schoolbook approximate division with the inverse up to 80 result limbs and flint_mpn_divapprox beyond, which give the floor or one more. Beyond 80 limbs, a numerator of at most limbs (in particular flint_mpn_invhigh) multiplies the approximate reciprocal of the divisor (flint_mpn_invapprox, with the lower Newton cutoffs of the inversion) instead, within two units. The exact variant forms the numerator exactly (extending the divisor instead when ) and divides with remainder.
The FLINT team, “flint_mpn_divhigh, flint_mpn_invhigh, flint_mpn_divhigh_exact (mpn_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mpn_extras/flint_mpn_divhigh.html (generated 2026-11-20).
@misc{flint-doc-mpn-extras-flint-mpn-divhigh,
author = {{The FLINT team}},
title = {{flint\_mpn\_divhigh, flint\_mpn\_invhigh, flint\_mpn\_divhigh\_exact (mpn\_extras.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/mpn_extras/flint_mpn_divhigh.html},
note = {Generated 2026-11-20}
}