PoissonDistribution generates numbers from the Poisson distribution. Adapted from stocc.cpp. 2018-08-28. Made thread safe, use in Jython scripts will be broken.
This function generates a random variate with the Poisson distribution. Uses inversion by chop-down method for L < 17, and ratio-of-uniforms method for L >= 17. For L < 1.E-6 numerical inaccuracy is avoided by direct calculation. For L > 2E9 too big--throws IllegalArgumentException Note this was a static method before 2018-08-28 (v2018a_8), so Jython calls should be PoissonDistribution().poisson().