src/java.base/share/classes/java/util/random/Xoshiro256StarStar.java
branchJDK-8193209-branch
changeset 57684 7cb325557832
parent 57547 56cbdc3ea079
child 59080 1b314be4feb2
equal deleted inserted replaced
57671:6a4be8bf8990 57684:7cb325557832
   233      * @return a pseudorandom {@code long} value
   233      * @return a pseudorandom {@code long} value
   234      */
   234      */
   235    public long nextLong() {
   235    public long nextLong() {
   236         final long z = x0;
   236         final long z = x0;
   237         long q0 = x0, q1 = x1, q2 = x2, q3 = x3;
   237         long q0 = x0, q1 = x1, q2 = x2, q3 = x3;
   238         { long t = q1 << 17; q2 ^= q0; q3 ^= q1; q1 ^= q2; q0 ^= q3; q2 ^= t; q3 = Long.rotateLeft(q3, 45); }  // xoshiro256 1.0
   238        {   // xoshiro256 1.0
       
   239            long t = q1 << 17;
       
   240            q2 ^= q0;
       
   241            q3 ^= q1;
       
   242            q1 ^= q2;
       
   243            q0 ^= q3;
       
   244            q2 ^= t;
       
   245            q3 = Long.rotateLeft(q3, 45);
       
   246        }
   239         x0 = q0; x1 = q1; x2 = q2; x3 = q3;
   247         x0 = q0; x1 = q1; x2 = q2; x3 = q3;
   240         return Long.rotateLeft(z * 5, 7) * 9;  // "starstar" mixing function
   248         return Long.rotateLeft(z * 5, 7) * 9;  // "starstar" mixing function
   241     }
   249     }
   242 
   250 
   243     public BigInteger period() {
   251     public BigInteger period() {