arb_dot, arb_dot_simple, arb_dot_precise
#include <flint/arb.h>void arb_dot(arb_t res, const arb_t initial, int subtract, arb_srcptr x, slong xstep, arb_srcptr y, slong ystep, slong len, slong prec)sourcevoid arb_dot_simple(arb_t res, const arb_t initial, int subtract, arb_srcptr x, slong xstep, arb_srcptr y, slong ystep, slong len, slong prec)sourcevoid arb_dot_precise(arb_t res, const arb_t initial, int subtract, arb_srcptr x, slong xstep, arb_srcptr y, slong ystep, slong len, slong prec)sourceSet res to s + (-1)^{\mathit{subtract}} \sum_{i=0}^{\mathit{len}-1} x_i y_i, where s is initial (or 0 if initial is NULL) and the entries are read with strides xstep and ystep.
subtract must be 0 or 1. A negative len counts as 0, and the strides may be negative. res may alias initial but not an entry of x or y.
arb_dot is the function to use. It accumulates all products in one fixed-point sum with a single final rounding and computes all radius contributions with mag arithmetic in one pass, so it is both faster and more accurate than a loop of arb_addmul: the internal sum carries 4 + \log_2 \mathit{len} guard bits, so the midpoint error is close to that of a single rounding of the exact dot product, and the midpoint is not computed to more bits than the radii justify. arb_dot_simple is that loop, kept for testing and used as a fallback for exponents outside the range of the fast code. arb_dot_precise computes the exact dot product of the midpoints before rounding, which can be very slow; it is meant for testing. The algorithm is described in Dot products of balls.
The FLINT team, “arb_dot, arb_dot_simple, arb_dot_precise (arb.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/arb/arb_dot.html (generated 2026-10-20).
@misc{flint-doc-arb-arb-dot,
author = {{The FLINT team}},
title = {{arb\_dot, arb\_dot\_simple, arb\_dot\_precise (arb.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/arb/arb_dot.html},
note = {Generated 2026-10-20}
}