FLINT3.7.0-dev

mp_real_sqrt, mp_real_rsqrt

Synopsis#include <flint/mp_real.h>
void mp_real_sqrt(mp_real_t res, const mp_real_t x, slong n)source
void mp_real_rsqrt(mp_real_t res, const mp_real_t x, slong n)source

Set res to \sqrt{x} resp. 1/\sqrt{x} for a positive ball x of relative radius below 2^{-30}. A wider ball, or a ball with a negative or zero midpoint, throws, except that mp_real_sqrt of an exact zero gives zero. res may alias x.

The exponent is aligned to an even number of limbs, the root computed by _mp_real_sqrt_newton resp. _mp_real_rsqrt_newton (the square root by flint_mpn_sqrtrem below a cutoff of a few hundred limbs), and the radius of x propagated through the derivative.

Guides#

Cite this page

The FLINT team, “mp_real_sqrt, mp_real_rsqrt (mp_real.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mp_real/mp_real_sqrt.html (generated 2026-10-20).