public static double exp(double lambda){
  return -Math.log(1 - Math.random()) / lambda;
}

public static double exp ( double lambda ) { return - Math . log ( 1 - Math . random ( ) ) / lambda ; }
return a real number from an exponential distribution with rate lambda .
