ratinterpol always rats?



> I think this is just the nature of polynomial evaluation.  Also, isn't
> it usually better (numerically) to leave the lagrange interpolating
> polynomial in Lagrange form, that is, as a sum of products?

You're right. It gives better results. In this case, lagrange2 is
defined without the rat call at the beginning and without the expand
call at the end:

(%i10) subst([x=140.000001], lagrange2(m));
(%o10)                         15.72006516824082
(%i11) subst(x=140, lagrange2(m));
(%o11)                               15.72
(%i12) (fpprec:25, subst(x=140, lagrange2(bfloat(m))));
(%o12)                   1.572000000000000063948846b1
(%i13) subst([x=140.000001], lagrange2(m));
(%o13)                         15.72006516824082

It seems I introduced the rat to solve the problem created by expand.

Thanks for your comments.