Interpolation function



Daniel Lakeland wrote:

<< entirely correct explanation>>

>
>
>Imagine that you want to write a function which works like this:
>
>myfunc : splineinterpolate(xes,yes);
>
>myfunc(newx); /* gives the interpolated value based on the xes and yes
>that were passed to splineinterpolate*/
>
>In other words what splineinterpolate should return is a function that
>knows how to compute interpolated numbers. The first thought would be
>something like this.
>
>splineinterpolate(xes,yes) := lambda([x], dosomeinterpolationstuff(xes,yes));
>

In the note I just sent out, you could do it this way.

 define (myfunc(newx), doit(xes,yes,length(xes), newx);

and the function myfunc would refer only to those values you intended.
You might want to do
define (myfunc(newx), ratsimp(doit ....));

RJF