help-gsl
[Top][All Lists]

## [Help-gsl] The spline polynomial coefficients are unique (????)

 From: Athanasios Anastasiou Subject: [Help-gsl] The spline polynomial coefficients are unique (????) Date: Fri, 13 May 2005 21:54:37 +0100 User-agent: Mozilla Thunderbird 1.0 (X11/20041206)

```Hello All

For the purposes of a piece of software i am writting i have to perform
some spline interpolation in real time.

I searched around the internet and found a derivation of the suitable
equations but for the case where dx is constant, for example x=[0..2pi]
and y some function y=f(x). In my case i had to perform interpolation in
a set of scattered points, so i derived the equations for the general
case and wrote some code to implement that. (With a little help from
Numerical Recepies in C for the solution of the tridiagonal system).

The problem is that i get three different implementations for three
different spline interpolation "providers" and honestly i dont know
which one to assume true!!! (so much for the uniqueness of the polyonym
:-) [only joking])

For the same kind of spline curve (The natural one with a slope of 0 at
the endpoints) i get a different evaluated curve for Matlab, GSL and
MyImplementation!!!!

I know that the derivation is correct, besides checking it 4 times i
also worked it out by forcing dx to be constant and i reached the
equations i had from the equidistant derivation. I also know that the
function for solving tridiagonal systems is correct, i tested it with a
benchmarking case where i knew what the results were supposed to be (its
a 31x31 matrix so i cant be that lucky to get all the numbers
correct!!!!). Additionaly i know that the code is correct, its not THAT
hard a thing to take it from paper to software in this case...

So my questions are these:
1. Is there any spline benchmarking dataset (x,y pairs) to check my code
against?
2. Would it be safe to assume that any errors are probably due to round
off errors or any other machine inaccuracies?
```
3. In the end i will most probably use GSL if i dont get it right, but i want
```to get it right just for the sake of it, is there any willing extra pair
of eyes to cast a gaze on my code and perhaps come up with something
that my eyes dont see?
4.  I am not using the divided differences form as i noted is used in a
very good book by Carl De Boor (Practical Guide to splines) i am
deriving the coefficients of the polynomials directly...Could this
introduce any extra instabilities?

Looking forward hearing from you
thanOS

```