New PRNG for calculators
|
06-06-2024, 08:17 PM
(This post was last modified: 06-06-2024 08:37 PM by Namir.)
Post: #1
|
|||
|
|||
New PRNG for calculators
I was just tinkering with an HP-21 calculator and I tried the following (I had to do the INT part by hand):
r1 = Frac(exp(exp(exp(r0)))) Where r0 is the old random number, and r1 is the new random number. I then wrote a Matlab program to generate a million random number. Here is a sample set of results: min = 1.646694727241993e-07 max = 0.999999882210702 mean = 0.500182006746859 sdev = 0.288245734345533 For the auto correlation between 1000 elements: min = -0.003854280151534 max = 0.003319062287133 mean = 1.567008799132003e-05 sdev = 0.001003357884267 The method looks good for random numbers for calculators. Namir |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)