Post Reply 
Calculation of pi on many machines
11-23-2020, 01:52 PM (This post was last modified: 11-23-2020 02:14 PM by Gerson W. Barbosa.)
Post: #9
RE: Calculation of pi on many machines
Your DM-42 version is about three times faster than Ron Knapp’s (17/5 = 3.4), except that it doesn’t work here. I’ve double-checked the listing and compared it against the 41 version, but there must be something I may have overlooked.

Code:

00 { 188-Byte Prgm }
01▸LBL "PI"
02 ENTER
03 CLRG
04 17
05 +
06 2
07 STO 04
08 LOG
09 ÷
10 IP
11 STO 01
12 R↓
13 34
14 ÷
15 4
16 +
17 STO 00
18 STO 02
19 TIME
20 STO 03
21 0
22▸LBL 00
23 RCL IND 00
24 FP
25 XEQ 01
26 X<> IND 00
27 IP
28 1ᴇ17
29 ÷
30 XEQ 01
31 1ᴇ17
32 ×
33 STO+ IND 00
34 R↓
35 DSE 00
36 RCL 00
37 4
38 X>Y?
39 GTO 02
40 R↓
41 R↓
42 GTO 00
43▸LBL 01
44 RCL 01
45 ×
46 X<>Y
47 1ᴇ17
48 ÷
49 +
50 IP
51 LASTX
52 FP
53 RTN
54▸LBL 02
55 0
56 ISG 00
57 FIX 05
58▸LBL 05
59 1ᴇ17
60 ×
61 RCL IND 00
62 IP
63 +
64 XEQ 03
65 X<> IND 00
66 FP
67 +
68 1ᴇ17
69 ×
70 XEQ 03
71 1ᴇ17
72 ÷
73 STO+ IND 00
74 R↓
75 ISG 00
76 FIX 05
77 RCL 00
78 RCL 02
79 X<Y?
80 GTO 04
81 R↓
82 R↓
83 GTO 05
84▸LBL 03
85 ENTER
86 ENTER
87 RCL 01
88 STO+ ST X
89 ISG ST X
90 FIX 05
91 STO ST T
92 MOD
93 X<>Y
94 R↑
95 ÷
96 IP
97 RTN
98▸LBL 04
99 2
100 STO+ 04
101 DSE 01
102 GTO 06
103 TIME
104 RCL 03
105 HMS-
106 VIEW ST X
107 RTN
108▸LBL 06
109 VIEW 01
110 DSE 00
111 0
112 GTO 00
113 END

Edited to fix a typo and a phrase.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Calculation of pi on many machines - Gerson W. Barbosa - 11-23-2020 01:52 PM



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