public static double dnormLog(double x,double mean,double sd){
  if (sd <= 0.0)   throw new IllegalArgumentException("standard deviation <= 0.0");
  return -Math.log(sd) + dnormLog((x - mean) / sd);
}

public static double dnormLog ( double x , double mean , double sd ) { if ( sd <= 0.0 ) throw new IllegalArgumentException ( "standard deviation <= 0.0" ) ; return - Math . log ( sd ) + dnormLog ( ( x - mean ) / sd ) ; }
returns the log - density value of a standard normal .
