public static double pchisq(double x,double ncp){
  double mean=Math.sqrt(ncp);
  double xh=Math.sqrt(x);
  return pnorm(xh - mean) - pnorm(-xh - mean);
}

public static double pchisq ( double x , double ncp ) { double mean = Math . sqrt ( ncp ) ; double xh = Math . sqrt ( x ) ; return pnorm ( xh - mean ) - pnorm ( - xh - mean ) ; }
returns the cumulative probability of the noncentral chi - squared distribution .
