docs icon indicating copy to clipboard operation
docs copied to clipboard

Discussion on numerical accuracy

Open ocramz opened this issue 7 years ago • 0 comments

"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

ocramz avatar Mar 26 '18 09:03 ocramz