ARF_RND_FAST, ARF_RND_ACCURATE
#include <flint/arf.h>ARF_RND_FASTARF_RND_ACCURATERelaxed modes, accepted only by division, square root and reciprocal square root (arf_div, arf_sqrt, arf_rsqrt and the functions built on them). The result differs from the exact value by at most one unit in the last place in either direction (ARF_RND_FAST), respectively by at most 0.51 units (ARF_RND_ACCURATE). The return value is the inexact flag, as with the strict modes: it is 0 if and only if the result equals the exact value.
A unit in the last place here is 2^{e - \mathit{prec}} where 2^{e-1} \le |f| < 2^e for the exact result f. Below a cutoff the functions use the standard algorithm with ARF_RND_DOWN, respectively ARF_RND_NEAR (see arf_rnd_relaxed_to_strict). Above it, they use the Newton iterations of mp_real: inversion from 5000 bits (with a divisor of more than \mathit{prec}/2 bits), division from 12000 bits, reciprocal square root from 4000 bits and square root from 100000 bits. The Newton result carries 8 (fast) or 11 (accurate) guard bits and is rounded to nearest, which gives errors of at most 0.5625 and 0.508 units; its exponent is that of f, or it is exactly 2^e, so adding one unit in the last place of the result is a valid error bound. The inexact flag is not that of the final rounding of the Newton approximation, which says nothing about f, but is determined separately: 1/x and 1/\sqrt{x} are dyadic only for powers of two (resp. powers of four), which are handled without Newton iteration, and an exact quotient or square root that fits in prec bits is found exactly by the iteration, so it is verified by one exact multiplication, made only when the bit lengths and the low bits of the mantissas allow an exact result.
Guides#
The FLINT team, “ARF_RND_FAST, ARF_RND_ACCURATE (arf.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/arf/ARF_RND_FAST.html (generated 2026-10-20).
@misc{flint-doc-arf-ARF-RND-FAST,
author = {{The FLINT team}},
title = {{ARF\_RND\_FAST, ARF\_RND\_ACCURATE (arf.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/arf/ARF_RND_FAST.html},
note = {Generated 2026-10-20}
}