RFR 8005311: Add Scalable Updatable Variables, DoubleAccumulator, DoubleAdder, LongAccumulator, LongAdder

Doug Lea dl at cs.oswego.edu
Sat Jan 12 15:04:33 UTC 2013

On 01/11/13 21:37, Joe Darcy wrote:

> I would prefer to cautionary note along the lines of "if you want numerical
> accuracy, take care to use a summation algorithm with defined worst-case behavior."
> (Varying magnitude is not so much of a problem if you add things up in the right
> order.)

Thanks. I do not believe such an algorithm exists, because
no ordering control is possible, and all other known accuracy
improvements (like Kahn) require multiword atomicity, which we
explicitly do not provide.

Which leaves me thinking that the current disclaimer (below)
is the best we can do.


>>> "The order of accumulation within or across threads is not guaranteed.
>>> Thus, this class may not be applicable if numerical stability is
>>> required, especially when combining values of substantially different
>>> orders of magnitude."

More information about the core-libs-dev mailing list