function sample( randu, randn, alpha, beta ) {
	var ga;
	var gb;
	if ( alpha === beta && alpha > 1.5 ) {
		return sample1( randu, randn, alpha );
	}
	if ( alpha > 1.0 && beta > 1.0 ) {
		return sample2( randu, randn, alpha, beta );
	}
	if ( alpha < 1.0 && beta < 1.0 ) {
		return sample3( randu, alpha, beta );
	}
	// General case of using two gamma random variates:
	ga = standardGamma( randu, randn, alpha );
	gb = standardGamma( randu, randn, beta );
	return ga / ( ga + gb );
}
Returns a random number drawn from a beta distribution.

@private
@param {PRNG} randu - pseudorandom number generator for uniformly distributed numbers
@param {PRNG} randn - pseudorandom number generator for normally distributed numbers
@param {PositiveNumber} alpha - first shape parameter
@param {PositiveNumber} beta - second shape parameter
@returns {Probability} pseudorandom number