mp_real_root_ui, mp_real_rroot_ui, _mp_real_root_ui_order
#include <flint/mp_real.h>void _mp_real_root_ui_order(mp_real_t res, const mp_real_t x, ulong k, slong n, int r, int recip)sourceSet res to resp. for and MP_REAL_ROOT_K_MAX. They throw for , for not positive (the third function for as well). The third function takes the order of the iteration (, or 0 for the default) and recip = 1 for the reciprocal root.
For the result is resp. , and for these call mp_real_sqrt and mp_real_rsqrt. Otherwise one step of order of a binomial-series iteration is taken from an approximation of accurate to about of the precision, obtained recursively (the recursion starts from a double):
with the series truncated after and its tail, below for , added to the radius. The series is summed over a common denominator of the , so that it costs one division by an integer; the coefficient tables are cached per thread. The default order is 3 for and 4 otherwise. Only the size of the final is computed rigorously, so the radius of the recursive approximation is discarded.
The FLINT team, “mp_real_root_ui, mp_real_rroot_ui, _mp_real_root_ui_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_root_ui.html (generated 2026-11-02).
@misc{flint-doc-mp-real-mp-real-root-ui,
author = {{The FLINT team}},
title = {{mp\_real\_root\_ui, mp\_real\_rroot\_ui, \_mp\_real\_root\_ui\_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_root_ui.html},
note = {Generated 2026-11-02}
}