Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B]
|
11-04-2021, 08:35 PM
(This post was last modified: 11-05-2021 05:01 PM by Albert Chan.)
Post: #21
|
|||
|
|||
RE: Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B]
(10-27-2021 05:12 PM)Albert Chan Wrote: (*) this is how initial b is estimated, by looking ahead. Let's get generalized CF convergents from the top down, instead of bottom up. I set c=8.0, to reduce expensive symbolic calculations (setting c=2.0 will get ¼th as big) Also, I use x = n+0.5 instead of N = n+0.5, to match Decimal Basic code. Warning: Decimal Basic is case-insensitive, N and n are the same variable. XCas> nextv(v, cf) := [v[1], normal(cf*v)] // 2nd row = next convergent XCas> v := identity(2) // initial b convergents, start with 1/0, b0/1 = 0/1 XCas> c, n, x2 := 8.0, x-0.5, x*x XCas> v := nextv(v, [(n+=1)^4, (c:=10-c)*(x2+=x)]):; e2r(quo(v[1])) [0.5, 0.5, 0.25] // b = horner([0.5, 0.5, 0.25], n+0.5) Repeat the last command, we have: [0.470588235294, 0.387543252595, 0.0976999796458] [0.472222222222, 0.401234567901, 0.141117969822] [0.472131147541, 0.399892502016, 0.133170617805] ... [0.472135955, 0.4, 0.13416407865] // converged 12 digits Guessing that coefficients are somehow related to ϕ, above is likely this: lua> r = sqrt(5) -- = 2*phi - 1 lua> 2*(r-2), 0.4, 0.06*r 0.4721359549995796 0.4 0.1341640786499874 Let's test this, for Decimal Basic version of zeta2(n) Code: OPTION ARITHMETIC DECIMAL_HIGH n = 100 Accurate digits = 217.89547073326986 n = 101 Accurate digits = 219.99818460987848 n = 102 Accurate digits = 222.10077322982628 n = 400 Accurate digits = 846.6549411985644 n = 401 Accurate digits = 848.74806270861004 n = 402 Accurate digits = 850.84117615610204 For n=474, it reached 1000 digits full precision. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)