neumaierSum: Using the Neumaier method, take a more accurate sum

Description Usage Arguments Value References Examples

Description

Using the Neumaier method, take a more accurate sum

Usage

1
neumaierSum(numbers)

Arguments

numbers

A vector of numbers to sum.

Value

Sum of numbers, a bit more accurate than kahanSum

References

https://en.wikipedia.org/wiki/Kahan_summation_algorithm

Examples

1
2
sum(c(1,1e100,1,-1e100)) ## Should be 2, gives 0
neumaierSum(c(1,1e100,1,-1e100)) ## Gives 2

PreciseSums documentation built on May 2, 2019, 7:23 a.m.