public double nextDouble(double mean,double gamma,double cut){
  double val, rval, displ;
  if (gamma == 0.0)   return mean;
  if (cut == Double.NEGATIVE_INFINITY) {
    rval=2.0 * randomGenerator.raw() - 1.0;
    displ=0.5 * gamma * Math.tan(rval * (Math.PI / 2.0));
    return mean + displ;
  }
 else {
    val=Math.atan(2.0 * cut / gamma);
    rval=2.0 * randomGenerator.raw() - 1.0;
    displ=0.5 * gamma * Math.tan(rval * val);
    return mean + displ;
  }
}

public double nextDouble ( double mean , double gamma , double cut ) { double val , rval , displ ; if ( gamma == 0.0 ) return mean ; if ( cut == Double . NEGATIVE_INFINITY ) { rval = 2.0 * randomGenerator . raw ( ) - 1.0 ; displ = 0.5 * gamma * Math . tan ( rval * ( Math . PI / 2.0 ) ) ; return mean + displ ; } else { val = Math . atan ( 2.0 * cut / gamma ) ; rval = 2.0 * randomGenerator . raw ( ) - 1.0 ; displ = 0.5 * gamma * Math . tan ( rval * val ) ; return mean + displ ; } }
returns a random number from the distribution ; bypasses the internal state .
