Computes the poisson probability mass function (PMF) directly with extended floating point types (e.g. Fp!128), which provides additional accuracy for large values of lambda or k.
value to evaluate PMF (e.g. number of "heads")
expected rate of occurence
import mir.bignum.fp: Fp; import mir.conv: to; import mir.math.common: approxEqual, exp; for (size_t i; i <= 10; i++) { assert(i.fp_poissonPMF(Fp!128(5.0)).to!double.approxEqual(poissonPMF(i, 5.0))); }
Poisson Distribution
See Implementation
Computes the poisson probability mass function (PMF) directly with extended floating point types (e.g. Fp!128), which provides additional accuracy for large values of lambda or k.