public double nextDouble(double alpha,double beta){
  double a=alpha;
  double b=beta;
  if (a > 1.0) {
    if (b > 1.0)     return (b1prs(a,b,randomGenerator));
    if (b < 1.0)     return (1.0 - b01(b,a,randomGenerator));
    if (b == 1.0) {
      return (Math.exp(Math.log(randomGenerator.raw()) / a));
    }
  }
  if (a < 1.0) {
    if (b > 1.0)     return (b01(a,b,randomGenerator));
    if (b < 1.0)     return (b00(a,b,randomGenerator));
    if (b == 1.0) {
      return (Math.exp(Math.log(randomGenerator.raw()) / a));
    }
  }
  if (a == 1.0) {
    if (b != 1.0)     return (1.0 - Math.exp(Math.log(randomGenerator.raw()) / b));
    if (b == 1.0)     return (randomGenerator.raw());
  }
  return 0.0;
}

public double nextDouble ( double alpha , double beta ) { double a = alpha ; double b = beta ; if ( a > 1.0 ) { if ( b > 1.0 ) return ( b1prs ( a , b , randomGenerator ) ) ; if ( b < 1.0 ) return ( 1.0 - b01 ( b , a , randomGenerator ) ) ; if ( b == 1.0 ) { return ( Math . exp ( Math . log ( randomGenerator . raw ( ) ) / a ) ) ; } } if ( a < 1.0 ) { if ( b > 1.0 ) return ( b01 ( a , b , randomGenerator ) ) ; if ( b < 1.0 ) return ( b00 ( a , b , randomGenerator ) ) ; if ( b == 1.0 ) { return ( Math . exp ( Math . log ( randomGenerator . raw ( ) ) / a ) ) ; } } if ( a == 1.0 ) { if ( b != 1.0 ) return ( 1.0 - Math . exp ( Math . log ( randomGenerator . raw ( ) ) / b ) ) ; if ( b == 1.0 ) return ( randomGenerator . raw ( ) ) ; } return 0.0 ; }
returns a beta distributed random number ; bypasses the internal state .
