Roger Hui wrote:
> Sorry, I can not resist.  The example is so short that even small
> reductions are significant, and there are a couple:
> - the parens are redundant
> - x and y can be used instead of x. and y. (J6.01)
>
> Thus:
>    lagint=:13 : 'y.%. (x.^/i.#x.)'
>
>    lagint=:13 : 'y%.x^/i.#x'
>


Fair enough.  In my defence, I wrote the response at 6am, and don't have
J601 on my default computer (which runs Red Hat 8).  I also understand
that this will give exact results on integers with extended precision.

All that I am doing is solving (V x)a=y for a, where V x is the
Vandermonde matrix of x.  As Roger has pointed out, this is useful in
other contexts.

The phrase I gave is suitable for casual use: you can do it a lot more
efficiently than using matrix inversion.  A particular case of this
problem leads to the fast Fourier transform.

If you are actually using Lagrange interpolation for large numbers of
points, you probably should be looking at B-spline interpolation instead.

Best wishes,

John

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to