Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accuracy error in the readme? #16

Open
MikaelSlevinsky opened this issue Jun 19, 2018 · 2 comments
Open

Accuracy error in the readme? #16

MikaelSlevinsky opened this issue Jun 19, 2018 · 2 comments

Comments

@MikaelSlevinsky
Copy link

In the context of numerical evaluation of L_{12}(1/2), the readme states

Note as well that because we are reducing dramatically the number of floating point operations, we are losing less precision than other methods.

Is this in reference to the method named goal12, whose result appears to be -0.23164963886602852?

The evaluation of L_{12}(1/2) can be done in Rational{BigInt} that avoids floating-point rounding errors. The result is:

julia> L12(x) = (1//479001600)*(x^12 - 144x^11 + 8_712x^10 - 290_400x^9 + 5_880_600x^8 - 75_271_680x^7 + 614_718_720x^6 - 3_161_410_560x^5 + 9_879_408_000x^4 - 17_563_392_000x^3 + 15_807_052_800x^2 - 5_748_019_200x + 479_001_600)
L12 (generic function with 1 method)

julia> L12(big(1//2))
-454494403199//1961990553600

julia> BigFloat(ans)
-2.316496388655191535372741969964192186414408636630858853081075303297525519747738e-01

julia> Float64(ans)
-0.23164963886551915

Perhaps someone may clarify to me how the goal12 method is more accurate than the other methods, notably the ApproxFun implementation that results in -0.2316496388655192, which is two units of least precision away from the correctly rounded rational result.

@miguelraz
Copy link
Owner

@MikaelSlevinsky ! Welcome and thanks for bringing this up.
I don't think that I can clarify this, because assuming that less floating point operations leading to a more precise result is wrong in the general case, as you have suitably pointed it out. I will strike that from the README.md.
Thanks!

@MikaelSlevinsky
Copy link
Author

P.S. if you want more info about stable recurrences for orthogonal polynomials, check out Section 4.2 here, and here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants