Perhaps Kahan Summation (q.v.) would help.
Another method is to sum in pairs; 1+2, 3+4,... then continue until finished. (Also known as Wolfe Summation.) It may be easier to program than Kahan's method.
(03-22-2022 06:59 PM)Valentin Albillo Wrote: [ -> ]I reckoned that I would lose about 6-7 digits due to rounding/truncation but in the end, I was losing as much as 11 digits for N=100,000 (let alone for N=1,000,000) because the internal code used in Free42 for large integer exponents is seriously flawed. Serves me right for blindly trusting it !
No. Errors mainly comes from rounding of base Y = 1 - 1/k^2.
Even if Y^X operation is dead-on accurate, you still have O(n^2+) error.
(03-23-2022 12:07 PM)Thomas Okken Wrote: [ -> ]I just uploaded a set of Plus42 builds with a new pow(Phloat, Phloat) implementation.
Confirmed, for n = 1e5:
PN(Old Y^X build) = 3.1416083615137915628728
51211516763
PN(New Y^X build) = 3.1416083615137915628728
34571497810