mp_real_agm, _mp_real_agm_order
#include <flint/mp_real.h>Set res to the arithmetic-geometric mean of to about limbs; throws for a negative midpoint. The second function takes the order of the final series (at most 16, 10 on 32-bit machines; 0 for the default).
The iteration , runs in ball arithmetic until satisfies for bits, and is finished by
The are positive dyadic rationals summing to 1 (the reciprocal vanishes at ; positivity follows from the log-convexity of the coefficients of by Kaluza's theorem), so the tail after is below . The default is 8 below 1024 limbs and 12 above. When no longer determines its own size, or or is too wide for the division and the square root, the result is the enclosure , valid because . The working set is four numbers of limbs.
The FLINT team, “mp_real_agm, _mp_real_agm_order (mp_real.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mp_real/mp_real_agm.html (generated 2026-11-02).
@misc{flint-doc-mp-real-mp-real-agm,
author = {{The FLINT team}},
title = {{mp\_real\_agm, \_mp\_real\_agm\_order (mp\_real.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/mp_real/mp_real_agm.html},
note = {Generated 2026-11-02}
}