# [PD] better tabread4~

Matt Barber brbrofsvl at gmail.com
Thu Jul 3 10:01:21 CEST 2008

```>> On the other hand, doesn't [tabread4~]'s Lagrange interpolator have a
>> continuous 2nd derivative while the [tabread4c~] Hermite one does not?
>
> No. A Lagrange interpolator on N points is a polynomial of degree N-1, and
> so its Nth derivative is a flat zero function without holes, and so it is
> infinitely differentiable. However, those are pieced together as a disparate
> mosaïc in a way that is not even C1 (continuous 1st derivative), which is
> what prompted Cyrille to work on a replacement in the first place. Note that
> a discontinuous 1st derivative implies that all other orders of derivatives
> are discontinuous.
>

I'm with you on the general piecewise Lagrange not being C1, but I
don't think it follows that all other orders are discontinuous --
can't they alternate?  At any rate, check out the 2nd derivatives of
the piecewise cubic Lagrange.  I believe that at x=0 it will be y[-1]
- 2*y[0] + y[1], while at x=1 it will be y[0] - 2*y[1] + y[2].
Therefore, since the terms match at the points on adjacent pieces, the
2nd derivative is continuous even though the first isn't.  I'd imagine
you could run into this kind of phenomenon especially with piecewise
functions.  Not sure what it means for the spectral response of the
interpolator, though.

Matt

```