Post Reply 
[VA] SRC #010 - Pi Day 2022 Special
03-18-2022, 04:22 PM
Post: #15
RE: [VA] SRC #010 - Pi Day 2022 Special
(03-18-2022 08:48 AM)Ángel Martin Wrote:  Yes, I've changed the approach to using a summation instead of a product - even if in the MCODE realm there's not much of a difference at the end of the day: you may gain some accuracy in the sums (instead of multiplications) but you lose some in the final Log/Exp conversions.

We don't notice the difference because correction is not strong enough.
Summing smallest term first, we would keep almost all good digits.

(03-16-2022 11:49 AM)J-F Garnier Wrote:  N=1E5, w/o correction:
VA : 3.14160 83615 13791 56287 28512 11516 805
JFG: 3.14160 83615 13791 56287 28668 95754 789

Lets recover true PN, and compare errors of products vs exp(sum of logs)

PN = C*PI = exp(ln(C))*PI = expm1(ln(C))*PI + PI

(03-17-2022 06:22 PM)Albert Chan Wrote:  Or, based from continued fraction approximation of little c: (again, N = 2n+1)

\(\Large \ln(C) =
\frac{1}{N \;
- \frac{1}{{9 \over 5}N \;
+ \frac{1}{{125 \over 8}N \;+\;...}}}\)

Note that ln(C) is odd function. Rewrite ln(C) as polynomial of 1/N, we have:

\(\displaystyle
\ln(C) = \frac{1}{N}
+ \frac{5/9}{N^3}
+ \frac{13/45}{N^5}
+ \frac{127/315}{N^7}
- \frac{89/135}{N^9}
\;+\; ... \)

n = 1E5       // note: my n is JFG N
N = 2n+1 ⇒ N^7 ≈ 128E35 > 1E37

Free42: ln(C), summing to N^5 only (slight errors doesn't matter)

ln(C)       → 4.99997500019444277779222209722329e-6
E↑X-1      → 4.999987500090277109379748231267083e-6
PI * PI + → 3.141608361513791562872866895754895      // true PN

VA (products for PN) errors = 15,684,238,090 ULP             // O(n^2) error ?
JFG (log sum for PN) errors = 106 ULP
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] SRC #010 - Pi Day 2022 Special - Albert Chan - 03-18-2022 04:22 PM



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