Post Reply 
Inverse Sinc Approximation (HP-42S)
01-24-2015, 03:30 AM (This post was last modified: 01-24-2015 04:25 AM by Gerson W. Barbosa.)
Post: #1
Inverse Sinc Approximation (HP-42S)
The approximation is good only when the arguments approach 1 (better on Free42). Anyway, this might be useful in some situations.

Sinc Function

Code:

00 { 66-Byte Prgm }
01>LBL "ASINC"
02 ENTER
03 ENTER
04 ENTER
05 78
06 175
07 ÷
08 ×
09 456
10 175
11 ÷
12 -
13 ×
14 243
15 35
16 ÷
17 +
18 ×
19 2424
20 175
21 ÷
22 -
23 ×
24 1587
25 175
26 ÷
27 +
28 SQRT
29 .END.


\[0.7 \rightarrow 1.4(0990334015)\]
\[0.8 \rightarrow 1.131(05968014)\]
\[0.9 \rightarrow 0.78668(1275111)\]
\[\frac{\sqrt{8}}{\pi }\rightarrow 0.78539(6392174)\]
\[0.95 \rightarrow 0.5519109(01224)\]
\[0.999 \rightarrow 0.077471290(5533)\]
\[0.999 \rightarrow 0.077471290316(5) (Free42)\]


[Image: Inv_Sinc_zpsf9ced504.png]

Edited to add plot.
Find all posts by this user
Quote this message in a reply
01-29-2015, 05:52 PM
Post: #2
RE: Inverse Sinc Approximation (HP-42S)
A rough improvement over the previous one:

Code:

00 { 164-Byte Prgm }
01>LBL "ASINC"
02 ENTER
03 +/-
04 E^X
05 62
06 ×
07 21
08 -
09 IP
10 STO 01
11 X<>Y
12 78
13 175
14 ÷
15 RCL× ST Y
16 456
17 175
18 ÷
19 -
20 RCL× ST Y
21 243
22 35
23 ÷
24 +
25 RCL× ST Y
26 2424
27 175
28 ÷
29 -
30 RCL× ST Y
31 1587
32 175
33 ÷
34 +
35 STO 02
36 X<>Y
37 +/-
38 1
39 +
40 STO 03
41>LBL 00
42 RCL 03
43 4
44 RCL+ 01
45 Y^X
46 LASTX
47 -1.99209761578E-1
48 RCL× ST L
49 1.98659851625
50 +
51 E^X
52 X<>Y
53 -1.44092400765
54 Y^X
55 ×
56 ×
57 STO+ 02
58 DSE 01
59 GTO 00
60 RCL 02
61 SQRT
62 .END.

0.999 7.7471290(5533)e-2 [ 1.2 seconds ]
0.999 7.74712903165e-2 (Free42)
0.990 2.45317808(947)e-1
0.990 2.45317808854e-1 (Free42)
0.950 5.51910978(573)e-1
0.950 5.51910978(542)e-1 (Free42)
0.900 7.866830720(53)e-1
0.900 7.866830720(28)e-1 (Free42)
0.800 1.1311025855(6)
0.800 1.131102585(58) (Free42)
0.700 1.41018537(706)
0.700 1.41018537(705) (Free42)
0.600 1.660034813(68)
0.600 1.660034813(67) (Free42)
0.500 1.89549426(538) [ 7.8 seconds ]
0.500 1.89549426(538) (Free42)
0.400 2.1253451(8634)
0.400 2.1253451(8634) (Free42)
0.300 2.3564411(3218)
0.300 2.3564411(3218) (Free42)
0.200 2.59573(889746)
0.200 2.59573(889746) (Free42)
0.100 2.85234(009548)
0.100 2.85234(009547) (Free42)
0.050 2.99145(085513)
0.050 2.99145(085514) (Free42)
0.000 3.1415(7574992) [ 17.7 seconds ]
0.000 3.1415(7574992) (Free42)
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: