Simulating 15C RAN # on 35s
02-15-2015, 07:28 AM
Post: #5
 Thomas Klemm Senior Member Posts: 1,551 Joined: Dec 2013
RE: Simulating 15C RAN # on 35s
(02-15-2015 05:24 AM)Paul Dale Wrote:  Shouldn't there be a FRAC surround the entire expression?

Correct:
RND(n+1) = Frac(1574352261*RND(n) + 0.1017980433)

Or then we could use:
RND(n+1) = Frac(15743.52261*($$10^5$$*RND(n)) + 0.1017980433)

This allows to split the factors into an integer and fraction part and use:
$$(a+b)(c+d)=ac+ad+bc+bd$$
The good thing is that $$ac$$ is an integer. Thus we can omit it.

Here's a program for the HP-42S:
Code:
00 { 56-Byte Prgm }
01 LBL "RAN#"
02 1E5
03 *
04 FP
05 LASTX
06 IP
07 0.52261
08 *
09 X<>Y
10 RCL* ST L
11 LASTX
12 15743
13 *
14 R↑
15 +
16 FP
17 +
18 0.1017980433
19 +
20 FP
21 END

It should be straightforward to translate that to the HP-35S.

Cheers
Thomas
 « Next Oldest | Next Newest »

 Messages In This Thread Simulating 15C RAN # on 35s - Tugdual - 02-14-2015, 05:13 PM RE: Simulating 15C RAN # on 35s - Namir - 02-15-2015, 03:44 AM RE: Simulating 15C RAN # on 35s - Tugdual - 02-15-2015, 04:01 AM RE: Simulating 15C RAN # on 35s - Paul Dale - 02-15-2015, 05:24 AM RE: Simulating 15C RAN # on 35s - Thomas Klemm - 02-15-2015 07:28 AM RE: Simulating 15C RAN # on 35s - rprosperi - 02-15-2015, 03:30 PM RE: Simulating 15C RAN # on 35s - Tugdual - 02-15-2015, 03:45 PM RE: Simulating 15C RAN # on 35s - rprosperi - 02-15-2015, 04:12 PM RE: Simulating 15C RAN # on 35s - Tugdual - 02-15-2015, 08:03 AM RE: Simulating 15C RAN # on 35s - Thomas Klemm - 02-15-2015, 08:24 AM RE: Simulating 15C RAN # on 35s - Tugdual - 02-15-2015, 10:37 AM RE: Simulating 15C RAN # on 35s - Paul Dale - 02-15-2015, 11:21 AM RE: Simulating 15C RAN # on 35s - Tugdual - 02-15-2015, 11:42 AM RE: Simulating 15C RAN # on 35s - Thomas Klemm - 02-15-2015, 11:37 AM RE: Simulating 15C RAN # on 35s - Tugdual - 02-15-2015, 12:01 PM RE: Simulating 15C RAN # on 35s - Thomas Klemm - 02-15-2015, 12:54 PM RE: Simulating 15C RAN # on 35s - Thomas Klemm - 02-15-2015, 05:00 PM RE: Simulating 15C RAN # on 35s - Tugdual - 02-15-2015, 05:17 PM RE: Simulating 15C RAN # on 35s - Thomas Klemm - 02-15-2015, 05:57 PM

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