Post Reply 
Quick HP42S question
05-25-2020, 09:33 AM
Post: #12
RE: Quick HP42S question
(05-25-2020 12:17 AM)Valentin Albillo Wrote:  I've programmed the exact same algorithm for both Free42 and the HP-71B. The algorithm generates and uses many thousand random numbers, initialized with 1, SEED in Free42 and RANDOMIZE 1 in the HP-71B.

As I thought Free42 includes the exact same RNG that a physical HP42S uses (which was taken from the HP-71B), I expected both programs to give the same results, but upon running them I discovered that in fact they don't. Both sequences of random numbers stay the same for a while but after some time they begin to not be exactly alike and when the programs use them they give slightly different results, perhaps 2147 and 2148, respectively.

The question is: is the RNG in Free42 guaranteed to produce the exact same sequence of random numbers as a physical HP42S would, no matter how long, or will they eventually part ways ?

I think we've established it's the same sequence now. The different results you see in your program must be due to arithmetical rounding differences elsewhere in the code, which is not surprising since Free42 BCD uses higher precision arithmetic than the 42S or 71B.

— Ian Abbott
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Quick HP42S question - Valentin Albillo - 05-24-2020, 11:31 PM
RE: Quick HP42S question - ijabbott - 05-24-2020, 11:36 PM
RE: Quick HP42S question - Thomas Okken - 05-24-2020, 11:37 PM
RE: Quick HP42S question - Thomas Okken - 05-25-2020, 12:29 AM
RE: Quick HP42S question - Joe Horn - 05-25-2020, 02:41 AM
RE: Quick HP42S question - ijabbott - 05-25-2020 09:33 AM
RE: Quick HP42S question - Gerald H - 05-25-2020, 05:30 AM
RE: Quick HP42S question - ijabbott - 05-25-2020, 08:57 AM
RE: Quick HP42S question - Werner - 05-25-2020, 06:40 AM
RE: Quick HP42S question - J-F Garnier - 05-25-2020, 09:06 AM
RE: Quick HP42S question - Albert Chan - 05-25-2020, 05:09 PM
RE: Quick HP42S question - Joe Horn - 05-25-2020, 07:22 AM



User(s) browsing this thread: 1 Guest(s)