FLINT3.7.0-dev

radix_div_approx_invmul, radix_div_approx

Synopsis#include <flint/radix.h>
void radix_div_approx_invmul(nn_ptr Q, nn_srcptr B, slong Bn, nn_srcptr A, slong An, slong n, const radix_t radix)source
void radix_div_approx(nn_ptr Q, nn_srcptr B, slong Bn, nn_srcptr A, slong An, slong n, const radix_t radix)source

Given the divisor (A, \mathit{An}) with nonzero top limb, read as a fixed-point number in [1/B, 1) with \mathit{An} \ge 1 fraction limbs, and the dividend (B, \mathit{Bn}), read as a fixed-point number in [0, 1) with \mathit{Bn} \ge 1 fraction limbs, set (Q, n + 2) to an approximation of the quotient with n fraction limbs and two integral limbs; the absolute error is less than 4 B^{-n} divided by the divisor. Note the order of the arguments: the dividend comes first. The invmul version multiplies by an approximate reciprocal; the general version uses Karp–Markstein iteration [KM1997].

References#

  • [KM1997] A. H. Karp and P. Markstein, "High-precision division and square root", ACM Transactions on Mathematical Software 23:4 (1997), 561–589
Cite this page

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