Subject: Problem with expand in lagrange interpolation
From: Stavros Macrakis
Date: Wed, 13 Jun 2007 14:11:10 -0400
On 6/13/07, Daniel Lakeland <dlakelan at street-artists.org> wrote:
> so perhaps instead of "expand" try applying "horner"
The horner form doesn't really help, but there are more numerically stable
forms of the interpolation polynomial.
ratm: rat(m), ratprint:false;
=> [[140,393/25],[141,1553/100],[142,1519/100],[143,414/25],
[144,1621/100],[145,1739/100],[146,434/25],[147,871/50],[148,88/5],
[149,71/4],[150,379/20]]
ll: lagrange(ratm) =>
-(5819*x^10-8444745*x^9+5514581775*x^8-2133880870950*x^7
+541841656184997*x^6-94339399381119585*x^5
+11405822718354472525*x^4-945537147217441911600*x^3
+51436942780422391818084*x^2-1658071148059604302261920*x
+24050212653044846394504000)
/90720000
float(subst(x=140,ll)) => 15.72
float(subst(x=140.0,ll)) => -4379.238038800706
float(subst(x=140.0,horner(ll,x))) => -2414.498810582011