3 ms·
Use the Kahan summation algorithm.
by skratky 2y ago
Use the Kahan summation algorithm.
- tialaramex 2y agoKahan solves my examples but in general cannot be relied on to deliver any specific benefit - it's never worse but it may not be meaningfully better either. Pairwise algorithms can promise better results but aren't applicable unless we're OK with the idea of separately storing the numbers somewhere while we run the algorithm or we provide this hash table with a random access mechanism it may otherwise have no use for.