value to evaluate PMF (e.g. number of "heads")
number of successes until stopping
true probability
fp_binomialPMF provides accurate values for large values of n
import mir.bignum.fp: Fp, fp_log; import mir.test: shouldApprox; 1.fp_negativeBinomialPMF(1_000_000, Fp!128(0.75)).fp_log!double.shouldApprox == negativeBinomialLPMF(1, 1_000_000, 0.75);
Computes the negative binomial probability mass function (PMF) directly with extended floating point types (e.g. Fp!128), which provides additional accuracy for extreme values of k, r, or p.