@@ -0,0 +1,2083 @@
+package biz.k11i.rng.test.util.distribution;%0A%0Aimport org.apache.commons.math3.distribution.BetaDistribution;%0Aimport org.openjdk.jmh.annotations.Benchmark;%0Aimport org.openjdk.jmh.annotations.Level;%0Aimport org.openjdk.jmh.annotations.OutputTimeUnit;%0Aimport org.openjdk.jmh.annotations.Param;%0Aimport org.openjdk.jmh.annotations.Scope;%0Aimport org.openjdk.jmh.annotations.Setup;%0Aimport org.openjdk.jmh.annotations.State;%0A%0Aimport java.util.concurrent.TimeUnit;%0Aimport java.util.stream.IntStream;%0A%0A@State(Scope.Benchmark)%0A@OutputTimeUnit(TimeUnit.MILLISECONDS)%0Apublic class BetaDistributionBenchmark %7B%0A    @Param(%7B%220.1%22, %221.0%22, %22100.0%22%7D)%0A    private double alpha;%0A%0A    @Param(%7B%220.1%22, %221.0%22, %22100.0%22%7D)%0A    private double beta;%0A%0A    private ContinuousDistribution probDist;%0A    private BetaDistribution commonsMath3;%0A%0A    @State(Scope.Benchmark)%0A    public static class X %7B%0A        private final double%5B%5D values;%0A        private int index;%0A        private double next;%0A%0A        public X() %7B%0A            final int N = 100000;%0A            values = IntStream.rangeClosed(0, N)%0A                    .mapToDouble(i -%3E i / (double) N)%0A                    .toArray();%0A        %7D%0A%0A        @Setup(Level.Iteration)%0A        public void init() %7B%0A            index = 0;%0A        %7D%0A%0A        @Setup(Level.Invocation)%0A        public void next() %7B%0A            next = values%5Bindex%5D;%0A%0A            if (++index %3E= values.length) %7B%0A                index = 0;%0A            %7D%0A        %7D%0A    %7D%0A%0A    @Setup(Level.Trial)%0A    public void setUp() %7B%0A        probDist = ProbabilityDistributions.beta(alpha, beta);%0A        commonsMath3 = new BetaDistribution(alpha, beta);%0A    %7D%0A%0A    @Benchmark%0A    public double commonsMath3Cdf(X x) %7B%0A        return commonsMath3.cumulativeProbability(x.next);%0A    %7D%0A%0A    @Benchmark%0A    public double commonsMath3InverseCdf(X x) %7B%0A        return commonsMath3.inverseCumulativeProbability(x.next);%0A    %7D%0A%0A    @Benchmark%0A    public double cdf(X x) %7B%0A        return probDist.cdf(x.next);%0A    %7D%0A%0A    @Benchmark%0A    public double inverseCdf(X x) %7B%0A        return probDist.inverseCdf(x.next);%0A    %7D%0A%7D%0A

Add benchmark