in reply to Re^2: Lagrange Polynomials in Perl
in thread Lagrange Polynomials in Perl

It should be exact for polynomials, correct? Have you tried that?

Replies are listed 'Best First'.
Re^4: Lagrange Polynomials in Perl
by Mascasc (Novice) on Apr 29, 2015 at 14:53 UTC
    It should be exact at the points you supply it, and it does work for that. Unfortunately since the algorithm only sees points and not the whole polynomial, it's a left hand doesn't know what the right hand is doing situation...and you still get some error between the points you supply. Although I have tried it with some polynomials, and it's pretty convincing.

      My understanding from Lagrange_polynomial is that it is exact for polynomials. So if you see differences you might still have an issue.

        If you look under the examples on the wikipedia article, example 1 gives an exact result, and example 2 gives a non-exact one. Although, "polynomials that give exact interpolations" would be a really interesting paper.