(04-21-2024 07:27 PM)Ángel Martin Wrote: it's done, quite easy since it's almost a one-by-one replacement...
but the choice of those real data registers is very inefficient (it requires multiple ZENTER^ instructions sprinkled throughout the program).
If I understand your description you used:
R01 and R24
R02 and R25
R03 and R36
etc...
for real and imaginary parts?
Redoing that to use adjacent (contiguous) numbered registers will eliminate the need for all those ZENTER^, abd thus reduce the execution time even further...
Code:
9:24PM 04/21
01*LBL "RZVA"
02*LBL 01
03 STO 24
04 RDN
05 STO 01
06 1 E-4
07 STO 19
08 X^2
09 STO 20
10 ,5
11 STO 25
12*LBL 02
13 XEQ IND 00
14 0
15 RCL 25
16 Z/
17 STO 21
18 RDN
19 STO 02
20 RCL 19
21 ST+ 24
22 XEQ IND 00
23 STO 22
24 RDN
25 STO 03
26 RCL 19
27 ST- 24
28 ST- 24
29 XEQ IND 00
30 STO 23
31 RDN
32 STO 04
33 R^
34 RCL 03
35 RCL 22
36 Z+
37 ZENTER^
38 RCL 02
39 RCL 21
40 Z-
41 ZENTER^
42 0
43 RCL 20
44 Z/
45 STO 06
46 RDN
47 STO 05
48 RCL 03
49 RCL 22
50 ZENTER^
51 RCL 04
52 RCL 23
53 Z-
54 ZENTER^
55 0
56 RCL 19
57 ST+ 24
58 Z/
59 ZENTER^
60 0
61 RCL 25
62 Z*
63 STO 23
64 RDN
65 STO 04
66 RCL 06
67 RCL 05
68 ZENTER^
69 RCL 04
70 RCL 23
71 Z/
72 STO 22
73 RDN
74 STO 03
75 R^
76 ZENTER^
77 RCL 02
78 RCL 21
79 Z*
80 ZENTER^
81 RCL 04
82 RCL 23
83 Z/
84 1
85 -
86 CHS
87 X<>Y
88 CHS
89 X<>Y
90 RCL 25
91 Z^X
92 1
93 -
94 ZENTER^
95 RCL 03
96 RCL 22
97 Z/
98 ST+ 24
99 RDN
100 ST+ 01
101 R^
102 ZENTER^
103 RCL 01
104 RCL 24
105 Z/
106 R-P
107 RCL 20
108 X<Y?
109 GTO 02
110 RCL 01
111 RCL 24
112 R-P
113 RDN
114 STO 23
115 SIN
116 ABS
117 RCL 20
118 X<=Y?
119 GTO 03
120 RCL 23
121 COS
122 ENTER^
123 ABS
124 X#0?
125 /
126 RCL 01
127 RCL 24
128 R-P
129 X<>Y
130 RDN
131 *
132 STO 24
133*LBL 03
134 RCL 01
135 RCL 24
136 ZAVIEW
137 END
Cheers,
ÁM
Yes, when I adapted Valentin's program I wanted to reduce the risk of errors, so whenver he used variable X for instance, I used the corresponding letter number for the real part (here 24) and I used the registers as needed going forward for the imaginary parts (so here: 1), leaving 00 free to store the function's name. But please double check, I might not have gone in order 100% of the times. Best is to check the RCLs... When I did this I had not 41Z and consecutive registers in mind, it didn't matter
How long does it take to solve with R=PI?
Cheers