// Wilson and Hilferty, again recommended for general use in the PDF above
// (anything from their group “G1” works).
// https://en.wikipedia.org/wiki/Poisson_distribution#Confidence_interval
// Wilson and Hilferty, again recommended for general use in the PDF above
// (anything from their group “G1” works).
// https://en.wikipedia.org/wiki/Poisson_distribution#Confidence_interval
{
let low = val * Math.pow(1.0 - 1.0 / (9.0 * val) - z / (3.0 * Math.sqrt(val)), 3.0) / num;
let high = (val + 1.0) * Math.pow(1.0 - 1.0 / (9.0 * (val + 1.0)) + z / (3.0 * Math.sqrt(val + 1.0)), 3.0) / num;
{
let low = val * Math.pow(1.0 - 1.0 / (9.0 * val) - z / (3.0 * Math.sqrt(val)), 3.0) / num;
let high = (val + 1.0) * Math.pow(1.0 - 1.0 / (9.0 * (val + 1.0)) + z / (3.0 * Math.sqrt(val + 1.0)), 3.0) / num;