[Haskell-cafe] ANN: logfloat 0.12.1

wren ng thornton wren at freegeek.org
Thu Apr 1 01:51:58 EDT 2010

-- logfloat 0.12.1

This package provides a type for storing numbers in the log-domain, 
primarily useful for preventing underflow when multiplying many 
probabilities as in HMMs and other probabilistic models. The package 
also provides modules for dealing with floating numbers correctly.

-- Changes since

* Fixed a number of bugs where LogFloat values would become NaN when 
they should not. These bugs involved using normal-space positive 
infinity and so would not affect clients using the package for 

The fixes do introduce some extra checks though. If anyone is using the 
package for probabilities in a large enough project and could run some 
benchmarks to see how 0.12.1 compares to I'd love to hear the 
results. (I'm not sure that doing microbenchmarks would actually give 
much insight about real programs.) If the overhead is bad enough I can 
add a LogProb type which ensures things are proper probabilities in 
order to avoid the new checks.

-- Compatibility / Portability

The package is compatible with Hugs (September 2006) and GHC (6.8, 6.10, 
6.12). For anyone still using GHC 6.6, the code may still work if you 
replace LANGUAGE pragma by equivalent OPTIONS_GHC pragma.

The package is not compatible with nhc98 and Yhc because 
Data.Number.RealToFrac uses MPTCs. The other modules should be compatible.

-- Links




Haddock (Darcs version):

Live well,

More information about the Haskell-Cafe mailing list