Post Reply 
[VA] SRC #012b - Then and Now: Root
11-13-2022, 02:15 PM (This post was last modified: 11-17-2022 01:26 PM by Albert Chan.)
Post: #18
RE: [VA] SRC #012b - Then and Now: Root
For P(x) degree 24 or higher, min abs root is around z = (-2 ± √2*i)/3
We can use Newton's method to zeroed in true root, for N ≥ 24

|z|^2 ≈ (4+2)/9 = 2/3 --> |z|^148 ≈ (2/3)^74 ≈ 9E-14
Set N = 148, we have 12-digits accuracy for N ≥ 148 min abs root.

10 DESTROY ALL @ SETTIME 0
20 N=148 @ DIM P(N) @ P(1)=3 ! odd primes
30 FOR K=2 TO N @ P(K)=FPRIM(P(K-1)+2) @ NEXT K
40 COMPLEX Z,F0,F1 @ Z=(-2,SQR(2))/3 @ A1=-1
50 A0=A1 @ A1=ABS(Z) @ DISP TIME,Z,A1 @ IF A1=A1+10*(A1-A0)^2 THEN END
60 F0=0 @ F1=0 @ FOR K=N TO 1 STEP -1 @ F0=F0*Z+P(K) @ F1=F1*Z+K*P(K) @ NEXT K
70 F0=F0*Z+2 @ Z=Z-F0/F1 ! newton's method
80 GOTO 50

>RUN
 .51      (-.666666666667,.47140452079)      .816496580927
 1.9      (-.645842585444,.480858085479)     .805193854636
 3.22     (-.645737371307,.48318762432)      .806502965276
 4.53     (-.645758096686,.483177673982)     .806513598193
 5.9      (-.645758096347,.483177676218)     .806513599261
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] SRC #012b - Then and Now: Root - Albert Chan - 11-13-2022 02:15 PM



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