(49G) An Inverse Congruential Pseudo Random Number Generator
|
07-11-2015, 07:31 AM
(This post was last modified: 06-15-2017 01:47 PM by Gene.)
Post: #1
|
|||
|
|||
(49G) An Inverse Congruential Pseudo Random Number Generator
Iset takes takes two positive integers S & P from the stack & sets the six parameters
Iseed Ia Ic Im Iπ Ipow S is the size of the prime Iπ & P the power Ipow of the prime used in the formula Iseed := (Iseed ^ -1) * Ia + Ic MOD Iπ ^ Ipow Iπ ^ Ipow is used to set the size of the other parameters. Actuate IXNEXT to return the next pseudo-random integer to the stack. ISET uses one sub-programme, see below. Code:
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)