pseudo_random/well512.h
inline unsigned long WELLRNG512(WELLRNG512_args args_ )
{
unsigned long a = 0, b = 0, c = 0, d = 0;
    a = args_.state[args_.index];
    c = args_.state[(args_.index+13)&15];
    b = a^c^(a<<16)^(c<<15);
    c = args_.state[(args_.index+9)&15];
    c ^= (c>>11);
    a = args_.state[args_.index] = b^c;
    d = a^((a<<5)&0xDA442D24UL);
    args_.index = (args_.index + 15)&15;
    a = args_.state[args_.index];
    args_.state[args_.index] = a^b^d^(a<<2)^(b<<18)^(c<<28);
return args_.state[args_.index];
}
/* 
   return 32 bit random number 
   dbj: optional locking to be added
*/
return 32 bit random number
dbj: optional locking to be added
return 32 bit random number dbj : optional locking to be added
inline unsigned long WELLRNG512(WELLRNG512_args args_ )
{
unsigned long a = 0, b = 0, c = 0, d = 0;
    a = args_.state[args_.index];
    c = args_.state[(args_.index+13)&15];
    b = a^c^(a<<16)^(c<<15);
    c = args_.state[(args_.index+9)&15];
    c ^= (c>>11);
    a = args_.state[args_.index] = b^c;
    d = a^((a<<5)&0xDA442D24UL);
    args_.index = (args_.index + 15)&15;
    a = args_.state[args_.index];
    args_.state[args_.index] = a^b^d^(a<<2)^(b<<18)^(c<<28);
return args_.state[args_.index];
}
inline unsigned long WELLRNG512 ( WELLRNG512_args args_ ) { unsigned long a = 0 , b = 0 , c = 0 , d = 0 ; a = args_ . state [ args_ . index ] ; c = args_ . state [ ( args_ . index + 13 ) & 15 ] ; b = a ^ c ^ ( a << 16 ) ^ ( c << 15 ) ; c = args_ . state [ ( args_ . index + 9 ) & 15 ] ; c ^= ( c >> 11 ) ; a = args_ . state [ args_ . index ] = b ^ c ; d = a ^ ( ( a << 5 ) & 0xDA442D24UL ) ; args_ . index = ( args_ . index + 15 ) & 15 ; a = args_ . state [ args_ . index ] ; args_ . state [ args_ . index ] = a ^ b ^ d ^ ( a << 2 ) ^ ( b << 18 ) ^ ( c << 28 ) ; return args_ . state [ args_ . index ] ; }
return 32 bit random number
dbj: optional locking to be added
return 32 bit random number dbj : optional locking to be added