question: public static double dchisq ( double x , double ncp ) { if ( ncp == 0.0 ) return dchisq ( x ) ; double xh = Math . sqrt ( x ) ; double mean = Math . sqrt ( ncp ) ; return ( dnorm ( xh - mean ) + dnorm ( - xh - mean ) ) / ( 2 * xh ) ; }
target:  Returns the density of the noncentral Chi-squared distribution.