public static double PoissonDistribution(int k, double x) { if (k < 0 || x < 0) return 0.0; return ComplementedIncompleteGamma((double) (k + 1), x); }