[Haskell-cafe] ANN: logfloat

wren ng thornton wren at freegeek.org
Sun Aug 17 01:30:55 EDT 2008

-- Announcing: logfloat 0.8.5

New official release of the logfloat package for manipulating log-domain 
floating numbers. This is primarily a maintenance release updating the 
documentation and with minor tweaks on typeclass-restricted polymorphism.

Substantively, I also broke out a new type class for numbers which can 
represent transfinite values. This is primarily to deal with issues 
about Rationals and other Fractional types which cannot represent them.

I also decided to switch the code over to *.hs format so that the 
Hackage build bot can generate the documentation more reliably.

-- Description

The main reason for casting numbers into the log-domain is to prevent
underflow when multiplying many small probabilities as is done in Hidden
Markov Models and other statistical models often used for natural
language processing. The log-domain also helps prevent overflow when
multiplying many large numbers. In rare cases it can speed up numerical
computation (since addition is faster than multiplication, though
logarithms are exceptionally slow), but the primary goal is to improve
accuracy of results. A secondary goal has been to maximize efficiency
since these computations are frequently done within a /O(n^3)/ loop.

The Data.Numeric.LogFloat module provides a new data type LogFloat which
handles all the conversions and optimizations and can be treated as any
other number thanks to type classes.

-- Links




Haddock (Darcs version):

Live well,

More information about the Haskell-Cafe mailing list