FLINT3.7.0-dev

arf_mul, arf_mul_ui, arf_mul_si, arf_mul_mpz, arf_mul_fmpz

Synopsis#include <flint/arf.h>
int arf_mul(arf_ptr z, arf_srcptr x, arf_srcptr y, slong prec, arf_rnd_t rnd)source
int arf_mul_ui(arf_ptr z, arf_srcptr x, ulong y, slong prec, arf_rnd_t rnd)source
int arf_mul_si(arf_ptr z, arf_srcptr x, slong y, slong prec, arf_rnd_t rnd)source
int arf_mul_mpz(arf_ptr z, arf_srcptr x, const mpz_t y, slong prec, arf_rnd_t rnd)source
int arf_mul_fmpz(arf_ptr z, arf_srcptr x, const fmpz_t y, slong prec, arf_rnd_t rnd)source

Set z to xyxy, correctly rounded.

arf_mul is a macro that calls arf_mul_rnd_down for ARF_RND_DOWN and arf_mul_rnd_any otherwise. Rounding down is the mode used by ball arithmetic, and arf_mul_rnd_down has dedicated code for one- and two-limb operands (arf_mul_rnd_any rounds those in registers too). Longer products are formed in full and rounded when the full product is cheap or not much longer than the output (up to 16 limbs in total, and the shapes of _arf_mul_prefer_full); otherwise only their top limbs are computed, with a guard limb (the high products of mpn_extras, flint_mpn_mulhigh_normalised and the balanced kernels), and the result is rounded from the guard limb when it certifies the rounding (_arf_mpn_round_guarded), the full product deciding otherwise (probability about 2−552^{-55} for random operands, and always for a product that is exact at prec bits). MPFR is no longer used.

Cite this page

The FLINT team, “arf_mul, arf_mul_ui, arf_mul_si, arf_mul_mpz, arf_mul_fmpz (arf.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/arf/arf_mul.html (generated 2026-11-20).