FLINT3.7.0-dev

_d1_vec_dot, _d2_vec_dot, _d3_vec_dot, _d4_vec_dot, _d1_vec_dot_rev, _d2_vec_dot_rev, _d3_vec_dot_rev, _d4_vec_dot_rev

Synopsis#include <flint/dfloat.h>
void _d1_vec_dot(d1_t res, d1_srcptr initial, int subtract, d1_srcptr x, d1_srcptr y, slong len)
void _d2_vec_dot(d2_t res, d2_srcptr initial, int subtract, d2_srcptr x, d2_srcptr y, slong len)
void _d3_vec_dot(d3_t res, d3_srcptr initial, int subtract, d3_srcptr x, d3_srcptr y, slong len)
void _d4_vec_dot(d4_t res, d4_srcptr initial, int subtract, d4_srcptr x, d4_srcptr y, slong len)
void _d1_vec_dot_rev(d1_t res, d1_srcptr initial, int subtract, d1_srcptr x, d1_srcptr y, slong len)
void _d2_vec_dot_rev(d2_t res, d2_srcptr initial, int subtract, d2_srcptr x, d2_srcptr y, slong len)
void _d3_vec_dot_rev(d3_t res, d3_srcptr initial, int subtract, d3_srcptr x, d3_srcptr y, slong len)
void _d4_vec_dot_rev(d4_t res, d4_srcptr initial, int subtract, d4_srcptr x, d4_srcptr y, slong len)

Set res to s \pm \sum_i x_i y_i (vec_dot) or s \pm \sum_i x_i y_{len-1-i} (vec_dot_rev), where s is initial (or zero if initial is NULL) and the sign is negative if subtract is nonzero, as _gr_vec_dot and _gr_vec_dot_rev.

The SIMD versions keep four lane accumulators and combine them at the end; vec_dot_rev (the kernel of classical polynomial multiplication and of the power series base cases) loads the blocks of y in reverse lane order, so that it gives the same result as vec_dot on a reversed copy of y. Dot products shorter than 32 terms for d1, 10 for d2 and d3, and 8 for the balls use a lean scalar loop.

Cite this page

The FLINT team, “_d1_vec_dot, _d2_vec_dot, _d3_vec_dot, _d4_vec_dot, _d1_vec_dot_rev, _d2_vec_dot_rev, _d3_vec_dot_rev, _d4_vec_dot_rev (dfloat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/dfloat/_d1_vec_dot.html (generated 2026-10-20).