cpp/numeric/random/negative binomial distribution

Produces random non-negative integer values $i$, distributed according to discrete probability function:



The value represents the number of failures in a series of independent yes/no trials (each succeeds with probability $p$), before exactly $k$ successes occur.

satisfies.