Open
Description
"How to produce numerically stable/reliable Haskell programs? "
- Numerically stable summation : Numeric.Sum in https://hackage.haskell.org/package/math-functions
- case in point:
> foldr (+) 0 [1.0, 10.0e100, 1.0, (-10.0e100)]
1.0
> foldl (+) 0 [1.0, 10.0e100, 1.0, (-10.0e100)]
0.0
import Numeric.Sum -- math-functions
> Numeric.Sum.sum kbn [1.0, 10.0e100, 1.0, (-10.0e100)] 2.0