User Tools

Site Tools


base:ax_tinyrand8

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
base:ax_tinyrand8 [2021-11-27 23:53] – created wilbase:ax_tinyrand8 [2021-11-28 03:25] – seeding function further explained wil
Line 5: Line 5:
 This version stores the seed as arguments and uses self-modifying code and requires only 15 bytes for the random function. The execution time is constant at 18 cycles and much faster than for example a 789-Xorshift. This version stores the seed as arguments and uses self-modifying code and requires only 15 bytes for the random function. The execution time is constant at 18 cycles and much faster than for example a 789-Xorshift.
  
-The seeding function was tricky, since putting any two values into b1 and c1 comes with a 10% risk of ending up in a cycle with shorter period. Therefore, a seeding function is provided that takes an 8 bit values and generates a seed that is guaranteed to be in cycle with a period of 59748. +The seeding function was tricky, since putting any two values into b1 and c1 comes with a 10% risk of ending up in a cycle with shorter period. Therefore, a seeding function is provided that takes an 8 bit values and generates a seed that is guaranteed to be in cycle with a period of 59748. However, there are only 64 different states reachable after seeding. 
 + 
 +In a test, I plotted the output of 51200 random values, which don't seem to reveal any visible patterns: 
 + 
 +{{ :base:rand_ax+.png?nolink&400 |}}
  
 <code> <code>
base/ax_tinyrand8.txt · Last modified: 2021-11-29 00:12 by wil