[Maxima] ratinterpol always rats?
biomates at telefonica.net
Sat Nov 8 00:38:34 CST 2008
> > I introduced the rat call in the lagrange function to force rational
> > arithmetic due to the inestability of floating point calculations in
> > high degree polynomials.
> I don't think using rat fixes the stability problem. :-)
Let me be more specific. The idea behind introducing rat was to solve
this type of results:
Let function lagrange2 be the same as lagrange, but without applying rat
to input data.
(%i9) m:[[140, 15.72], [141, 15.53], [142, 15.19],
[143, 16.56], [144, 16.21], [145, 17.39],
[146, 17.36], [147, 17.42], [148, 17.60],
[149, 17.75], [150, 18.95] ]$
(%i10) subst(x=140, lagrange2(m));
With some more precision I get a completely different result:
(%i11) (fpprec:25, subst(x=140, lagrange2(bfloat(m))));
This is what we now get with the lagrange function as defined in
(%i12) float( subst(x=140, lagrange(m)) );
I took this decision after a long thread in the list some time ago,
although I am not sure this is the best solution.
I'll introduce option force_rat and make documentation more clear on
More information about the Maxima