logfloat 0.13.0.1 → 0.13.1
raw patch · 3 files changed
+7/−5 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- VERSION +2/−0
- logfloat.cabal +2/−2
- src/Data/Number/LogFloat.hs +3/−3
VERSION view
@@ -1,3 +1,5 @@+0.13.1 (2015-03-10):+ - Fixed a major bug in sum 0.13 (2015-02-17): - monomorphized logFloat, logToLogFloat, fromLogFloat, logFromLogFloat - added sum, product, pow
logfloat.cabal view
@@ -1,5 +1,5 @@ ------------------------------------------------------------------- wren gayle romano <wren@community.haskell.org> ~ 2015.02.17+-- wren gayle romano <wren@community.haskell.org> ~ 2015.03.10 ---------------------------------------------------------------- -- By and large Cabal >=1.2 is fine; but >= 1.6 gives tested-with:@@ -8,7 +8,7 @@ Build-Type: Simple Name: logfloat-Version: 0.13.0.1+Version: 0.13.1 Stability: experimental Homepage: http://code.haskell.org/~wren/ Author: wren gayle romano
src/Data/Number/LogFloat.hs view
@@ -512,12 +512,12 @@ -- -- /Since: 0.13/ sum :: [LogFloat] -> LogFloat-sum xs = LogFloat (theMax + theSum)+sum xs = LogFloat (theMax + log theSum) where- theMax = logFromLogFloat (maximum xs)+ LogFloat theMax = maximum xs -- compute @\log \sum_{x \in xs} \exp(x - theMax)@- theSum = foldl' (\ acc x -> acc + exp (logFromLogFloat x - theMax)) 0 xs+ theSum = foldl' (\ acc (LogFloat x) -> acc + exp (x - theMax)) 0 xs -- TODO: expose a single-pass version for the special case where -- the first element of the list is (promised to be) the maximum