public static double logpdf(double val,double loc,double scale){
  val=Math.abs((val - loc) / scale);
  double f=1.0 + Math.exp(-val);
  return -val - Math.log(scale * f * f);
}

public static double logpdf ( double val , double loc , double scale ) { val = Math . abs ( ( val - loc ) / scale ) ; double f = 1.0 + Math . exp ( - val ) ; return - val - Math . log ( scale * f * f ) ; }
log probability density function .
