public static double lnFactorial(double x){
  return Statistics.lnGamma(x + 1);
}

public static double lnFactorial ( double x ) { return Statistics . lnGamma ( x + 1 ) ; }
returns natural logarithm of factorial using gamma function .
