question: public static double logFactorial ( int n ) { if ( n < 0 ) throw new IllegalArgumentException ( ) ; else if ( n <= 1 ) return 0 ; else return ( n * Math . log ( n ) ) - n + ( 0.5 * Math . log ( 2 * Math . PI * n ) ) ; }
target:  ln(n!). Implemented as Stirling's approximation.