FLINT_MPN_UDIV_QR_2BY1, FLINT_MPN_UDIV_QR_3BY2, FLINT_MPN_UDIV_QR_3BY2_HW
#include <flint/mpn_extras.h>FLINT_MPN_UDIV_QR_2BY1(q, r, nh, nl, d, di)sourceFLINT_MPN_UDIV_QR_3BY2(q, r1, r0, n2, n1, n0, d1, d0, dinv)sourceFLINT_MPN_UDIV_QR_3BY2_HW(q, r1, r0, n2, n1, n0, d1, d0)sourceMöller–Granlund 2/1 division of (n_h, n_l) by the normalised limb d with inverse di = \lfloor (B^2 - 1)/d \rfloor - B (requires n_h < d), and 3/2 division of (n_2, n_1, n_0) by the normalised (d_1, d_0) with dinv = flint_mpn_preinv1(d1, d0) (requires (n_2, n_1) < (d_1, d_0)) [GraMol2010]. The HW version does the 3/2 division without an inverse, by one hardware 2/1 division and at most two corrections (a step of Knuth's algorithm D); it is only sensible where hardware division is fast (FLINT_PREINVERT_LIMB_USE_NATIVE).
References#
- [GraMol2010] N. Möller and T. Granlund, "Improved division by invariant integers", IEEE Transactions on Computers 60 (2011), 165–175, https://gmplib.org/~tege/division-paper.pdf
The FLINT team, “FLINT_MPN_UDIV_QR_2BY1, FLINT_MPN_UDIV_QR_3BY2, FLINT_MPN_UDIV_QR_3BY2_HW (mpn_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mpn_extras/FLINT_MPN_UDIV_QR_2BY1.html (generated 2026-10-20).
@misc{flint-doc-mpn-extras-FLINT-MPN-UDIV-QR-2BY1,
author = {{The FLINT team}},
title = {{FLINT\_MPN\_UDIV\_QR\_2BY1, FLINT\_MPN\_UDIV\_QR\_3BY2, FLINT\_MPN\_UDIV\_QR\_3BY2\_HW (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_UDIV_QR_2BY1.html},
note = {Generated 2026-10-20}
}