template<class T>
class ROOT::Math::KahanSum< T >
The Kahan compensate summation algorithm significantly reduces the numerical error in the total obtained by adding a sequence of finite precision floating point numbers.
This is done by keeping a separate running compensation (a variable to accumulate small errors).
The intial values of the result and the correction are set to the default value of the type it hass been instantiated with.
Examples:
std::vector<double> numbers = {0.01, 0.001, 0.0001, 0.000001, 0.00000000001};
The Kahan compensate summation algorithm significantly reduces the numerical error in the total obtai...
void Add(const T &x)
Single element accumulated addition.
static T Accumulate(const Iterator begin, const Iterator end, const T &initialValue=T{})
Iterate over a datastructure referenced by a pointer and return the result of its accumulation.
Definition at line 92 of file Util.h.