/*
 * (C) Copyright 2016 JOML

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.

 */
package org.joml.sampling;

/**
 * Internal random number generator.
 * 
 * @author Kai Burjack
 */
class Random {

    /**
     * Currently, we just use Java's {@link java.util.Random} class.
     */
    private final java.util.Random rnd;

    /**
     * Create a new instance of {@link Random} and initialize it with the given <code>seed</code>.
     * 
     * @param seed
     *            the seed number
     */
    Random(long seed) {
        this.rnd = new java.util.Random(seed);
    }

    /**
     * @return a random float within [0..1)
     */
    float nextFloat() {
        return rnd.nextFloat();
    }

}

@@ -1234,80 +1234,1253 @@
   * 
-Currently, we just use Java's %7B@link java.util.Random%7D class.%0D%0A     */%0D%0A
+Reference %3Ca href=%22http://xoroshiro.di.unimi.it/xoroshiro128plus.c%22%3Ehttp://xoroshiro.di.unimi.it/%3C/a%3E%0D%0A     */%0D%0A    private static final class Xorshiro128 %7B%0D%0A        /**%0D%0A         * = 0x1p-24f%0D%0A         */%0D%0A        private static final float INT_TO_FLOAT = Float.intBitsToFloat(864026624);%0D%0A%0D%0A        /**%0D%0A         * Xorshiro128 state%0D%0A         */%0D%0A        private long _s0;%0D%0A        private long _s1;%0D%0A%0D%0A        /**%0D%0A         * SplitMix64 State%0D%0A         */%0D%0A        private long state;%0D%0A%0D%0A        Xorshiro128(long seed) %7B%0D%0A            this.state = seed;%0D%0A            this._s0 = nextSplitMix64();%0D%0A            this._s0 = nextSplitMix64();%0D%0A        %7D%0D%0A%0D%0A        private long nextSplitMix64() %7B%0D%0A            long z = state += 0x9e3779b97f4a7c15L;%0D%0A            z = (z %5E (z %3E%3E%3E 30)) * 0xbf58476d1ce4e5b9L;%0D%0A            z = (z %5E (z %3E%3E%3E 27)) * 0x94d049bb133111ebL;%0D%0A            return z %5E (z %3E%3E%3E 31);%0D%0A        %7D%0D%0A%0D%0A        /**%0D%0A         * Reference: %3Ca href=%0D%0A         * %22https://github.com/roquendm/JGO-Grabbag/blob/master/src/roquen/math/rng/PRNG.java%22%3Ehttps://github.com/roquendm/%3C/a%3E%0D%0A         * %0D%0A         * @author roquendm%0D%0A         */%0D%0A        final float nextFloat() %7B%0D%0A            return (nextInt() %3E%3E%3E 8) * INT_TO_FLOAT;%0D%0A        %7D%0D%0A%0D%0A    
     
@@ -2491,30 +2491,357 @@
 ate 
-f
 in
-al java.util.Random
+t nextInt() %7B%0D%0A            long s0 = _s0;%0D%0A            long s1 = _s1;%0D%0A            long result = s0 + s1;%0D%0A            s1 %5E= s0;%0D%0A            _s0 = Long.rotateLeft(s0, 55) %5E s1 %5E (s1 %3C%3C 14); // a, b%0D%0A            _s1 = Long.rotateLeft(s1, 36); // c%0D%0A            return (int) (result & 0xFFFFFFFF);%0D%0A        %7D%0D%0A    %7D%0D%0A%0D%0A    private final Xorshiro128
  rnd
@@ -3079,24 +3079,19 @@
 new 
-java.util.Random
+Xorshiro128
 (see

Use Xoroshiro128+ PRNG