Probability, Statistics, Data Science, Mathematics.
this. D can be precomputed at the beginning of the method. The result is this Java: Analysis of the inverse CDF code How fast is it? A sample takes about 1μs to generate. So a million a second. This barely varies with N, s or p. How accurate is it? For large N and small s it’s usually exact. eg For