Post Reply 
HP42s first major program (Double Integral) Best way to approach?
06-01-2020, 08:02 PM
Post: #38
RE: HP42s first major program (Double Integral) Best way to approach?
Albert: well it was just my first try, and it worked straight away - this doesn't happen often ;-) so I was eager to post it.
And I called it AGM2 because I already have a stack-only version of AGM, that returns only the agm.

DM48: yes, LSTO is one of the Free42 extensions, Local variables that are automatically cleared at RTN. Just replace it by STO for the 42S.
(ah that will not work: I see I have "A" and "B" twice there. So, change the A,B,C in BORE to lowercase). Along with Albert's suggestions and one more small change, here's the latest version:

Code:
00 { 204-Byte Prgm }
01▸LBL "BORE"
02 MVAR "a"
03 MVAR "b"
04 MVAR "c"
05▸LBL 10
06 VARMENU "BORE"
07 RTN
08 RCL "c"
09 RCL "a"
10 XEQ "HV"
11 LSTO "t"
12 RCL "c"
13 RCL "b"
14 XEQ "HV"
15 RCL- "t"
16 GTO 10
17▸LBL "AGM2"
18 LSTO "B"
19 R↓
20 LSTO "A"
21 X↑2
22 LSTO "S"
23 0.5
24 LSTO "T"
25▸LBL 02
26 RCL "A"
27 RCL× "B"
28 SQRT
29 X<> "B"
30 RCL- "A"
31 RCL ST X
32 2
33 ÷
34 STO+ "A"
35 RCL "S"
36 RCL "T"
37 STO+ "T"
38 R↑
39 X↑2
40 ×
41 -
42 ENTER
43 X<> "S"
44 X≠Y?
45 GTO 02
46 RCL "A"
47 RTN
48▸LBL "EK"
49 X↑2
50 1
51 -
52 +/-
53 SQRT
54 1
55 X<>Y
56 STO+ ST Y
57 SQRT
58 STO+ ST X
59 XEQ "AGM2"
60 PI
61 X<>Y
62 ÷
63 STO× ST Y
64 X<>Y
65 4
66 ÷
67 RTN
68▸LBL "HV"
69 LSTO "D"
70 X<>Y
71 LSTO "d"
72 X<>Y
73 ÷
74 XEQ "EK"
75 RCL- ST Y
76 X<>Y
77 LASTX
78 +
79 RCL "d"
80 X↑2
81 ×
82 X<>Y
83 RCL "D"
84 X↑2
85 ×
86 +
87 RCL× "D"
88 3
89 ÷
90 END
Cheers, Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP42s first major program (Double Integral) Best way to approach? - Werner - 06-01-2020 08:02 PM



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