flint_mpn_brsqrt, flint_mpn_bsqrt
#include <flint/mpn_extras.h>int flint_mpn_brsqrt(mp_ptr res, mp_srcptr x, mp_size_t xn, mp_size_t n)sourceint flint_mpn_bsqrt(mp_ptr res, mp_srcptr x, mp_size_t xn, mp_size_t n)sourceIf , set to the 2-adic reciprocal square root (with ), respectively the square root (with ), that is congruent to 1 modulo 4, and return 1. Otherwise return 0 without writing anything (an odd is a square modulo if and only if ).
The reciprocal square root is computed by a Newton iteration in bit precision (each step maps correct bits to ), using high products with known low part above the basecase range and full low products below FLINT_MPN_BRSQRT_MULLOW_CUTOFF limbs. The square root adds one Karp–Markstein refinement to a reciprocal square root of limbs.
The FLINT team, “flint_mpn_brsqrt, flint_mpn_bsqrt (mpn_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mpn_extras/flint_mpn_brsqrt.html (generated 2026-11-02).
@misc{flint-doc-mpn-extras-flint-mpn-brsqrt,
author = {{The FLINT team}},
title = {{flint\_mpn\_brsqrt, flint\_mpn\_bsqrt (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_brsqrt.html},
note = {Generated 2026-11-02}
}