@mattgodbolt
@daliasCassandrich Maximum accuracy would have you sum the negative and positive values separately in order of increasing magnitude. It would be interesting to see the performance/accuracy tradeoff for various schemes to avoid a full sort.
@arclight
@mattgodbolt Yeah, but for most purposes you don't care about maximum accuracy. The types, nature of the data, and range of values should be such that the result is numerically ok whatever order you do the summation in, but it should be reproducible (and thus not up to allowing compiler to do random reordering) because all sorts of things have underappreciated reproducibility requirements. Reprobuilds. Science. Games/simulations maintaining sync. Etc.
If you have a fediverse account, you can quote this note from your own instance. Search https://hachyderm.io/users/dalias/statuses/115758923122258922 on your instance and quote it. (Note that quoting is not supported in Mastodon.)