public static double exp(double lambda){
  if (!(lambda > 0.0))   throw new IllegalArgumentException("Rate lambda must be positive");
  return -Math.log(1 - uniform()) / lambda;
}

public static double exp ( double lambda ) { if ( ! ( lambda > 0.0 ) ) throw new IllegalArgumentException ( "Rate lambda must be positive" ) ; return - Math . log ( 1 - uniform ( ) ) / lambda ; }
returns a random real number from an exponential distribution with rate & lambda ; .
