-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
None
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
Sum (relatively accurately) a list of differnet floating points numbers is hard, especially if these numbers are of different signs and different magnitudes. Add a stream of double with different orders, different results are assured. This may cause undesirable non-reproducibility.
Python provides a math.fsum method to support this. Similarly Ruby's sum method use a less accurate (but still much better than the naive method) algorithm to support this use case.
Correctly-rounded summation can be relatively fast and use relatively little memory if done with suitable algorithm.
Sum (relatively accurately) a list of differnet floating points numbers is hard, especially if these numbers are of different signs and different magnitudes. Add a stream of double with different orders, different results are assured. This may cause undesirable non-reproducibility.
Python provides a math.fsum method to support this. Similarly Ruby's sum method use a less accurate (but still much better than the naive method) algorithm to support this use case.
Correctly-rounded summation can be relatively fast and use relatively little memory if done with suitable algorithm.
- relates to
-
JDK-8024354 Explicitly permit DoubleStream.sum()/average() implementations to use higher precision summation
- Resolved