Post Reply 
Valentin Albillo's "Boldly Going... Going Back to the roots" from 35S to 32SII / DM32
12-23-2023, 08:07 PM
Post: #3
RE: Valentin Albillo's "Boldly Going... Going Back to the roots" from 35S to...
Here is the Plus42 version. Very similar to the original 35S version, but taking advantage of Plus42 pre-parsing of equations, and still using indirect adressing to easily switch equations. Rather than an RPN program, just write your equation (using X as the variable) in the editor, press STO then X to store it on the stack, the STO EQ to store it into variable EQ, et voilà! Works like a charm, exacts same results as the original, but in a blink of an eye, given Plus42 light speed.

It could be clearer to use LSTO instead of STO for all the intermediate variables, not to clutter the variable catalog.

Code:
00 { 241-Byte Prgm }
01▸LBL "SOLVC"
02 STO "X"
03 XSTR "ABS(SIN(L(W:ANGLE(X))))+0×G(W)"
04 PARSE
05 LSTO "EQ1"
06 XSTR "L(X:SGN(COS(W))×ABS(X))"
07 PARSE
08 LSTO "EQ2"
09 1ᴇ-4
10 STO "S"
11 X↑2
12 STO "T"
13 0.5
14 STO "Y"
15▸LBL 00
16 EVALN "EQ"
17 RCL÷ "Y"
18 STO "U"
19 RCL "S"
20 STO+ "X"
21 EVALN "EQ"
22 STO "V"
23 RCL "S"
24 STO- "X"
25 STO- "X"
26 EVALN "EQ"
27 STO "W"
28 RCL+ "V"
29 RCL- "U"
30 RCL÷ "T"
31 RCL "V"
32 RCL- "W"
33 RCL "S"
34 STO+ "X"
35 ÷
36 RCL× "Y"
37 STO "W"
38 ÷
39 STO "V"
40 RCL× "U"
41 RCL÷ "W"
42 1
43 -
44 +/-
45 RCL "Y"
46 Y↑X
47 1
48 -
49 RCL÷ "V"
50 STO+ "X"
51 RCL÷ "X"
52 ABS
53 RCL "T"
54 X<Y?
55 GTO 00
56 EVALN "EQ1"
57 X<Y?
58 EVALN "EQ2"
59 RCL "X"
60 VIEW "X"
61 RTN
62 END
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Valentin Albillo's "Boldly Going... Going Back to the roots" from 35S to... - Vincent Weber - 12-23-2023 08:07 PM



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