Post Reply 
Arctangent function program [HP-42S, Free42]
09-15-2024, 04:55 PM (This post was last modified: 09-15-2024 08:37 PM by Gerson W. Barbosa.)
Post: #17
RE: Arctangent function program [HP-42S, Free42]
(09-14-2024 10:37 PM)Thomas Klemm Wrote:  Here's the program for the HP-12C:
Code:
01 {       01 } 1
02 {       05 } 5
03 {    44 00 } STO O
04 {       35 } CLx
05 {       36 } ENTER
06 {       01 } 1
07 { 44 30 00 } STO - 0
08 {       40 } +
09 {    45 00 } RCL 0
10 {    43 35 } x=0
11 { 43 33 23 } GTO 23
12 {       02 } 2
13 {       20 } *
14 {       40 } +
15 {       34 } X<=>Y
16 {    45 00 } RCL 0
17 {       20 } *
18 {       36 } ENTER
19 {       20 } *
20 {       34 } X<=>Y
21 {       10 } /
22 { 43 33 06 } GTO 06
23 {       33 } Rv
24 {       10 } /

Since we’re at it, here’s tangent using basically the same nice scheme of yours:

Code:
01 {       36 } ENTER
02 {       20 } *
03 {        8 } 8
04 {     44 0 } STO 0
05 {       35 } CLx
06 {       36 } ENTER
07 {        1 } 1
08 { 44 30  0 } STO - 0
09 {       40 } +
10 {    45  0 } RCL 0
11 {    43 35 } x=0
12 { 43 33 19 } GTO 19
13 {        2 } 2
14 {       20 } *
15 {       40 } +
16 {       10 } /
17 {       16 } CHS
18 { 43 33 07 } GTO 7
19 {       33 } Rv
20 {       22 } 1/x
21 {       34 } x<=>y
22 {    43 21 } SQRTx
23 {       20 } *
24 { 43 33 00 } GTO 00

3.141592654 ENTER 4 / g GTO 00 R/S -> 1.000000000

1.5707 g GTO 00 R/S -> 10381.32(037)

( ~ 7 seconds on the good old 12C )

———-

P.S.:

Or, if we want all of them on the stack:

Code:
...
24 {       36 } ENTER
25 {       36 } ENTER
26 {       36 } ENTER
27 {       20 } *
28 {        1 } 1
29 {       40 } +
30 {    43 21 } SQRTx
31 {       22 } 1/x
32 {       20 } *
33 {    43 36 } LASTx
34 {       34 } x<=>y
35 { 43 33 00 } GTO 00

g GTO 00 R/S ->

T: TAN(x)
Z: TAN(x)
Y: COS(x)
X: SIN(x)


———-

Code:

36 { xx xx xx } XXXX 
37 { xx xx xx } XXXX
...
...  (*)

g GTO 36 R/S ->

Z: ATAN(x)
Y: ACOS(x)
X: ASIN(x)


(*) These are left as an exercise to the interested reader.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Arctangent function program [HP-42S, Free42] - Gerson W. Barbosa - 09-15-2024 04:55 PM



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