Post Reply 
Easter Sunday Trigs ( rpn38-CX)
04-03-2016, 12:20 AM (This post was last modified: 04-03-2016 12:44 AM by Gerson W. Barbosa.)
Post: #22
RE: Easter Sunday Trigs ( rpn38-CX)
(04-02-2016 11:12 PM)bshoring Wrote:  Gerson,
For what it's worth, I was able to eliminate one program step on the latest and greatest trig program.

I replaced the 2nd & 3rd steps:
02 - 31 ENTER
03 - 61 ×

with a single "RCL X 8" as that squares the value in X register. Having previously removed the line that swapped X<>Y at step 30, the program is now 97 steps.

Regards,
Bob

Great! Also, the same can be done twice around 60 steps further in the program. Since I prefer sine in X, I can spare yet another step:

Code:


Trigonometric Functions

R.0: 5.817764173314432e-03
R.1: 0.199999779
R.2: 0.142841665
R.3: 1.107161127e-01
R.4: 0.086263068
R.5: 0.05051923
R.6: 3.2818376136867e-08
R.7: 5.553916059e-14
R.8: 4.4756602e-20
R.9: 2.0935e-26


Angles in DEGREES

-90 =< x <= 90

R/S               --> sin(x)
R/S x<>y      --> cos(x)
R/S x<>y /    --> tan(x)

GTO 30 R/S --> asin(x)       0 =< x <= 1
GTO 41 R/S --> acos(x)      0 =< x <= 1
GTO 49 R/S --> atan(x)   1e-50 < x < 1e42

by Gerson W. Barbosa - Apr/2016


01 - 21 8         STO 8
02 - 22 61 8      RCL × 8
03 - 31           ENTER
04 - 31           ENTER
05 - 31           ENTER
06 - 86 61 9      RCL × .9
07 - 86 41 8      RCL − .8
08 - 61           ×
09 - 86 51 7      RCL + .7
10 - 61           ×
11 - 86 41 6      RCL − .6
12 - 61           ×
13 - 86 51 0      RCL + .0
14 - 22 61 8      RCL × 8
15 - 21 8         STO 8
16 - 21 51 8      STO + 8
17 - 3            3
18 - 22 8         RCL 8
19 - 22 61 8      RCL × 8
20 - 41           −
21 - 61           ×
22 - 21 8         STO 8
23 - 22 61 8      RCL × 8
24 - 32           CHS
25 - 1            1
26 - 51           +
27 - 24 21        √x
28 - 22 8         RCL 8
29 - 25 7 00      GTO 00
30 - 25 6         x=0
31 - 25 7 00      GTO 00
32 - 31           ENTER
33 - 61           ×
34 - 24 71        1/x
35 - 1            1
36 - 41           −
37 - 25 6         x=0
38 - 22 73 9      RCL .9
39 - 24 71        1/x
40 - 25 7 48      GTO 48
41 - 25 6         x=0
42 - 25 7 38      GTO 38
43 - 31           ENTER
44 - 61           ×
45 - 24 71        1/x
46 - 1            1
47 - 41           −
48 - 24 21        √x
49 - 25 6         x=0
50 - 25 7 00      GTO 00
51 - 1            1
52 - 33           x≷y
53 - 25 5         x≤y
54 - 25 7 57      GTO 57
55 - 24 71        1/x
56 - 9            9
57 - 0            0
58 - 21 9         STO 9
59 - 25 33        R↓
60 - 24 71        1/x
61 - 21 8         STO 8
62 - 22 61 8      RCL × 8
63 - 51           +
64 - 24 21        √x
65 - 22 41 8      RCL − 8
66 - 21 8         STO 8
67 - 22 61 8      RCL × 8
68 - 31           ENTER
69 - 31           ENTER
70 - 31           ENTER
71 - 86 61 5      RCL × .5
72 - 86 41 4      RCL − .4
73 - 61           ×
74 - 86 51 3      RCL + .3
75 - 61           ×
76 - 86 41 2      RCL − .2
77 - 61           ×
78 - 86 51 1      RCL + .1
79 - 61           ×
80 - 3            3
81 - 24 71        1/x
82 - 41           −
83 - 61           ×
84 - 1            1
85 - 51           +
86 - 22 61 8      RCL × 8
87 - 8            8
88 - 25 12        12÷
89 - 61           ×
90 - 86 71 0      RCL ÷ .0
91 - 22 9         RCL 9
92 - 25 6         x=0
93 - 33           x≷y
94 - 33           x≷y
95 - 41           −
96 - 25 7 00      GTO 00

By storing the constant 1/3 in register 7 and replacing the steps 80 through 82 with a single RCL- 7 instruction, per Willy's idea above, two other steps can be saved, thus leaving us six steps more to play with.

Regards,

Gerson.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Easter Sunday Trigs ( rpn38-CX) - Gerson W. Barbosa - 04-03-2016 12:20 AM



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