Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In this case, it seems as if stable_mean is less accurate than the naive sum?


The two behaves differently, so you can not strictly compare the two. Most of the time stable_mean will give more accurate results, but this is not always the case. For example you can create test cases where the naive approach will return an exact result but stable_mean will have some rounding error.

Kahan summation however is always more precise than naive summation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: