public static double pdf(double val, double dof) {
    if(val <= 0 || val == Double.POSITIVE_INFINITY) {
      return 0.0;
    }
    final double k = dof * .5;
    return FastMath.exp((dof - 1.0) * FastMath.log(val) + (1 - k) * MathUtil.LOG2 - GammaDistribution.logGamma(k) - val * val / 2.);
  }
public static double pdf ( double val , double dof ) { if ( val <= 0 || val == Double . POSITIVE_INFINITY ) { return 0.0 ; } final double k = dof * .5 ; return FastMath . exp ( ( dof - 1.0 ) * FastMath . log ( val ) + ( 1 - k ) * MathUtil . LOG2 - GammaDistribution . logGamma ( k ) - val * val / 2. ) ; }
PDF function

@param val Value
@param dof Degrees of freedom
@return Pdf value