vstat
Loading...
Searching...
No Matches
compensated_sum< T > Struct Template Reference

#include <compensated_sum.hpp>

Detailed Description

template<typename T>
struct VSTAT_NAMESPACE::compensated_sum< T >

Knuth TwoSum compensated accumulator.

Captures the exact rounding error of each addition via eve::two_add, yielding significantly better precision than naive summation for large sequences of double values. Has no meaningful effect for float.

Works with both scalar floating-point types and eve::wide<T>.

Usage: compensated_sum<double> s; for (auto x : data) s(x); double result = s.value();


The documentation for this struct was generated from the following file: