Post Reply 
Viète à grande Vitesse or Accelerated Viète (kind of)
07-01-2024, 05:49 AM (This post was last modified: 07-01-2024 06:00 AM by Gerson W. Barbosa.)
Post: #26
RE: Viète à grande Vitesse or Accelerated Viète
(06-23-2024 06:00 PM)Albert Chan Wrote:  ...

Code:
00 { 79-Byte Prgm }
01▸LBL "Vh"
02 2
03 0
04 SIGN
05▸LBL 00
06 2
07 STO× ST Z
08 RCL+ ST L
09 SQRT
10 ×
11 DSE ST Z
12 GTO 00
13 1/X          @ z = sin(pi/2^(n+1)) = pi'/2^(n+1)
14 X↑2
15 ENTER
16 ENTER
17 ENTER
18 49
19 ×
20 72
21 ÷
22 ×
23 +
24 25
25 ×
26 42
27 ÷
28 ×
29 +
30 .45
31 ×
32 ×
33 +
34 6
35 ÷            @ eps ≈ asin(z)/z - 1
36 X<>Y
37 SQRT
38 ENTER
39 LN           @ ln(z)   z   eps
40 2
41 LN
42 ÷            @ log2(z) z   eps   eps
43 IP
44 2
45 -
46 LASTX
47 X<>Y
48 Y↑X
49 ÷            @ pi'   eps   eps   eps
50 ×
51 LASTX
52 +
53 END

  1 XEQ "Vh" --> 3.138316846974900201597524772067293
10 XEQ "Vh" --> 3.141592653589793238462643383274432
11 XEQ "Vh" --> 3.141592653589793238462643383279499
12 XEQ "Vh" --> 3.141592653589793238462643383279504

Same results:

 1 4 XEQ "VCW" --> 3.138316846974900201597524772067292
10 4 XEQ "VCW" --> 3.141592653589793238462643383274435
11 4 XEQ "VCW" --> 3.141592653589793238462643383279500
12 4 XEQ "VCW" --> 3.141592653589793238462643383279504

Now with eight coefficients:

1 8 XEQ "VCW" --> 3.141497389177767990537566794077536
2 8 XEQ "VCW" --> 3.141592652530259569168830657515667
6 8 XEQ "VCW" --> 3.141592653589793238462643383279186
7 8 XEQ "VCW" --> 3.141592653589793238462643383279508
8 8 XEQ "VCW" --> 3.141592653589793238462643383279503

No optimization attempt at this stage. No coin flipping for program label – it looks better this way:-)
Formulae later, if I find a suitable LaTeX editor (tired of editing these by hand).

Code:


00 { 108-Byte Prgm }
01▸LBL "VCW"
02 STO 01
03 X<>Y
04 2
05 STO 02
06 0
07 SIGN
08 STO 03
09▸LBL 00
10 2
11 STO× ST Z
12 RCL+ ST L
13 SQRT
14 ×
15 DSE ST Z
16 GTO 00
17 1/X
18 ×
19 X<> 01
20 LASTX
21 X↑2
22 STO 04
23 1ᴇ-3
24 RCL× ST Z
25 1
26 +
27 X<>Y
28 0.5
29▸LBL 01
30 STO+ ST X
31 RCL ST Z
32 IP
33 STO÷ ST Y
34 STO+ ST X
35 +/-
36 NOT
37 ×
38 LASTX
39 SIGN
40 STO+ ST X
41 RCL+ ST L
42 RCL× 02
43 X<>Y
44 RCL÷ ST Y
45 X<>Y
46 X<> ST L
47 X<> ST Z
48 ×
49 STO+ 03
50 X<> ST L
51 RCL× 04
52 X<>Y
53 4
54 STO× 02
55 R↓
56 ISG ST Z
57 GTO 01
58 RCL 01
59 RCL× 03
60 END

Edit to change Subject – this looks indeed accelerated although further tests are still needed.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Viète à grande Vitesse or Accelerated Viète - Gerson W. Barbosa - 07-01-2024 05:49 AM



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