// Path: fast-rng/src/main/java/biz/k11i/util/MathFunctions.java
// public static final double exp(double value) {
//     return JafamaMath.exp(value);
// }
// 
// Path: fast-rng/src/main/java/biz/k11i/util/MathFunctions.java
// public static final double log(double value) {
//     return JafamaMath.log(value);
// }
// 
// Path: fast-rng/src/main/java/biz/k11i/util/MathFunctions.java
// public static final double pow(double value, double power) {
//     return JafamaMath.pow(value, power);
// }


import java.util.Random;
import static biz.k11i.util.MathFunctions.exp;
import static biz.k11i.util.MathFunctions.log;
import static biz.k11i.util.MathFunctions.pow;
            // min <= 1, max = 1

            if (min == 1.0) {
                // max = 1, min = 1
                return BetaRNGAlgorithms.Unif.INSTANCE;
            }

            return BetaRNGAlgorithms.CdfInversion.INSTANCE;
        }
    }


}

class BetaRNGAlgorithms {
    /**
     * Implementation of Beta random number generator using Jöhnk's algorithm.
     * <p>
     * Jöhnk, M. D.
     * <i>"Erzeugung von betaverteilten und gammaverteilten Zufallszahlen."</i>
     * Metrika 8.1 (1964): 5-15.
     * </p>
     */
    static class Johnk implements BetaRNG {
        static final BetaRNG INSTANCE = new Johnk();

        @Override
        public double generate(Random random, double alpha, double beta) {
            while (true) {
                double u = log(random.nextDouble()) / alpha;
// Path: fast-rng/src/main/java/biz/k11i/util/MathFunctions.java
// public static final double exp(double value) {
//     return JafamaMath.exp(value);
// }
// 
// Path: fast-rng/src/main/java/biz/k11i/util/MathFunctions.java
// public static final double log(double value) {
//     return JafamaMath.log(value);
// }
// 
// Path: fast-rng/src/main/java/biz/k11i/util/MathFunctions.java
// public static final double pow(double value, double power) {
//     return JafamaMath.pow(value, power);
// }


// Path: fast-rng/src/main/java/biz/k11i/rng/BetaRNG.java
import java.util.Random;
import static biz.k11i.util.MathFunctions.exp;
import static biz.k11i.util.MathFunctions.log;
import static biz.k11i.util.MathFunctions.pow;

            // min <= 1, max = 1

            if (min == 1.0) {
                // max = 1, min = 1
                return BetaRNGAlgorithms.Unif.INSTANCE;
            }

            return BetaRNGAlgorithms.CdfInversion.INSTANCE;
        }
    }


}

class BetaRNGAlgorithms {
    /**
     * Implementation of Beta random number generator using Jöhnk's algorithm.
     * <p>
     * Jöhnk, M. D.
     * <i>"Erzeugung von betaverteilten und gammaverteilten Zufallszahlen."</i>
     * Metrika 8.1 (1964): 5-15.
     * </p>
     */
    static class Johnk implements BetaRNG {
        static final BetaRNG INSTANCE = new Johnk();

        @Override
        public double generate(Random random, double alpha, double beta) {
            while (true) {
                double u = log(random.nextDouble()) / alpha;
                double v = log(random.nextDouble()) / beta;