Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B]
11-03-2021, 12:38 AM
Post: #18
 Albert Chan Senior Member Posts: 1,897 Joined: Jul 2018
RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B]
(10-31-2021 03:40 PM)Albert Chan Wrote:  Another approach, getting ζ(2) with alternating series.

I translated the code to Decimal Basic, to check its convergence rate.
Amazingly, it is almost the same as original! 2.0899 digit per iteration

However, accuracy is less by 0.4180 digit, compared with non alternating sum.
Cost per loop is a lot smaller though.

Code:
OPTION ARITHMETIC DECIMAL_HIGH 10 INPUT  PROMPT "n = ":n    LET x = 3*n*(n+1)+1    LET a = 0    LET b = 0    FOR i = n TO 2 step -1       LET t = i*i       LET a = 2/t - a       LET b = t*t / (x-b)       LET x = x - 4*i    NEXT i       LET z2 = (1-MOD(n,2)*2)/(x-4-1/(x-b)) - a + 2      PRINT "Accurate digits ="; 1-LOG10(ABS(PI*PI/6-z2))    GOTO 10 END

Note: I did not add the b initial correction, for fair comparison.

n = 100
Accurate digits = 210.27025201561072
n = 101
Accurate digits = 212.36014715889508
n = 102
Accurate digits = 214.45004193935936
n = 400
Accurate digits = 837.2346060430264
n = 401
Accurate digits = 839.32448364856168
n = 402
Accurate digits = 841.41436124813102

For n=478, it almost reached 1000 digits full precision (1 ULP error, last digit = 8 instead of 9)
 « Next Oldest | Next Newest »

 Messages In This Thread Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Gerson W. Barbosa - 10-23-2021, 02:49 PM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Albert Chan - 10-25-2021, 01:29 PM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Gerson W. Barbosa - 10-26-2021, 02:12 AM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Albert Chan - 10-26-2021, 09:47 AM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Albert Chan - 10-26-2021, 08:28 PM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Albert Chan - 10-29-2021, 02:16 PM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Albert Chan - 11-01-2021, 10:42 PM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Gerson W. Barbosa - 11-02-2021, 12:28 PM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Albert Chan - 10-27-2021, 05:12 PM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Albert Chan - 11-04-2021, 08:35 PM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Ren - 10-26-2021, 02:13 PM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - floppy - 10-26-2021, 03:04 PM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Albert Chan - 10-26-2021, 03:24 PM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Gerson W. Barbosa - 10-26-2021, 03:58 PM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Ren - 10-27-2021, 01:32 PM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Albert Chan - 10-31-2021, 03:40 PM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Albert Chan - 11-05-2021, 03:55 PM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Albert Chan - 11-01-2021, 12:56 AM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Gerson W. Barbosa - 11-01-2021, 05:04 AM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Albert Chan - 11-03-2021 12:38 AM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Albert Chan - 11-03-2021, 01:14 AM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Albert Chan - 11-03-2021, 11:28 PM RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B] - Albert Chan - 11-04-2021, 10:42 PM

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