Skip to content

Implementations of the 16-bit Xorshift-798 algorithm

Notifications You must be signed in to change notification settings

impomatic/xorshift798

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Xorshift-798

Xorshift-798 is an efficient 16-bit pseudorandom number generator. The next number in the sequence is produced using three operations where the number is XORed with a shifted copy of itself. The shifts 7, 9 and 8 can be implemented efficiently in assembly using single shifts and swapping bytes. The equivalent C code is:

uint16_t xs = 1;

uint16_t xorshift( )
{
    xs ^= xs << 7;
    xs ^= xs >> 9;
    xs ^= xs << 8;
    return xs;
}

More information:

About

Implementations of the 16-bit Xorshift-798 algorithm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published