is a collection of types, constants and utility functions for handling
probabilities in the SRILM library.
A floating point number representing a probability.
Logarithm to base 10 of a probability.
Log of probability 0.
Log of probability infinity (not a legal probability, of course).
Log of probability 1.
The number of significant digits in a LogP
A positive value close to 0; probability sums less than this should be
considered effectively zero.
Boolean parseLogP(const char *string, LogP &prob)
Converts a floating point string representation into a LogP.
iff the number was parsed correctly.
This function should be much faster than generic C library functions
for floating point parsing.
Also, it parses singular LogP's (plus/minus infinity) correctly.
Computes the LogP resulting from interpolating two LogP's.
If p1 and p2 are probabilities corresponding to prob1
and prob2, respectively, then the result is the LogP corresponding
to lambda * p1 + (1 - lambda) * p2.
The following functions deal with bytelogs.
Bytelogs are logarithms scaled to represent probabilties and likelihoods
as a short integer in SRI's DECIPHER(TM) recognizer
(bytelog(p) = log(p) * 10000.5 / 1024).
double ProbToBytelog(Prob prob)
Converts a probability to a bytelog.
double LogPtoBytelog(LogP prob)
Convert a LogP to a bytelog.
LogP BytelogToLogP(double bytelog)
Convert a bytelog to a LogP.
Andreas Stolcke <email@example.com>.
Copyright 1995, 1996 SRI International