FLINT_MPN_UDIV_QR_3BY2, FLINT_MPN_UDIV_QR_3BY2_HW
Synopsis
#include <flint/mpn_extras.h>FLINT_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 3/2 division of by the normalised with dinv = flint_mpn_preinv1(d1, d0) (requires ) [GraMol2010]; the 2/1 division is udiv_qrnnd_preinv of longlong.h. 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
Cite this page
The FLINT team, “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_3BY2.html (generated 2026-11-20).
@misc{flint-doc-mpn-extras-FLINT-MPN-UDIV-QR-3BY2,
author = {{The FLINT team}},
title = {{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_3BY2.html},
note = {Generated 2026-11-20}
}