HP Forums
(100LX) LCPRNG - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (100LX) LCPRNG (/thread-4218.html)



(100LX) LCPRNG - Gerald H - 06-24-2015 01:30 PM

The linear congruential pseudo-random number generator

R# := R# * AR# + CR# mod R#MOD

is implemented in this formula:

R#=0*AR#*CR#+L(r,MOD(MOD(MOD(MOD(MOD(L(x,G(R#)-L(i,MOD(G(R#),100000000)))*L(h,G(AR#)-L(j,MOD(G(AR#),100000000))),R#MOD)+MOD(G(x)*G(j),-R#MOD),R#MOD)+MOD(G(h)*G(i),-R#MOD),-R#MOD)+G(i)*G(j),-R#MOD)+CR#,R#MOD))+0*L(Frct,G(r)/R#MOD)*Frct

Enter desired multiplier in AR#, constant in CR# & modulus in R#MOD, then set the seed value in R# (all positive integers < 10^16).

Actuate R# to place the next pseudo-random integer in R#.

Do not press Frct, the value is only for display purposes.