public static double rawProbability(double x,double lambda){
  if (lambda == 0) {
    return ((x == 0) ? 1. : 0.);
  }
  if (Double.isInfinite(lambda) || x < 0) {
    return 0.;
  }
  if (x <= lambda * Double.MIN_NORMAL) {
    return Math.exp(-lambda);
  }
  if (lambda < x * Double.MIN_NORMAL) {
    double r=-lambda + x * Math.log(lambda) - GammaDistribution.logGamma(x + 1);
    return Math.exp(r);
  }
  final double f=MathUtil.TWOPI * x;
  final double y=-stirlingError(x) - devianceTerm(x,lambda);
  return Math.exp(y) / Math.sqrt(f);
}

public static double rawProbability ( double x , double lambda ) { if ( lambda == 0 ) { return ( ( x == 0 ) ? 1. : 0. ) ; } if ( Double . isInfinite ( lambda ) || x < 0 ) { return 0. ; } if ( x <= lambda * Double . MIN_NORMAL ) { return Math . exp ( - lambda ) ; } if ( lambda < x * Double . MIN_NORMAL ) { double r = - lambda + x * Math . log ( lambda ) - GammaDistribution . logGamma ( x + 1 ) ; return Math . exp ( r ) ; } final double f = MathUtil . TWOPI * x ; final double y = - stirlingError ( x ) - devianceTerm ( x , lambda ) ; return Math . exp ( y ) / Math . sqrt ( f ) ; }
poisson distribution probability , but also for non - integer arguments . lb ^ x exp ( - lb ) / x !
