News for hackers. Stuff that matters.
Re:How to Correctly Sum Up Numbers by kardos on Sunday November 03, 2024 @09:29PM (#42037868)
Sorting is costly though!

This summing problem is solved by xsum: https://gitlab.com/radfordneal/xsum

There is room for more work here to make it faster or use less memory though.

Re:How to Correctly Sum Up Numbers by 77pt77 on Tuesday November 05, 2024 @01:08PM (#42053809)
sorting is nlogn in general and faster for numerics.

Plus after sorting you can use SIMD to sum everything much faster.

But yes, xsum and the like are more accurate.