I'm using 2 classes from the Apache Commons Math packages, namely


Here is the relevant code

Java Code:
SplineInterpolator spliner = new SplineInterpolator();
double[] xs = {0.0,1.0,2.0,3.0};
double[] ys = {0.0,1.0,4.0,9.0};
PolynomialSplineFunction polySplineFunc = spliner.interpolate(xs,ys);
In theory, and stated from Apache - "The interpolate(double[], double[]) method returns a PolynomialSplineFunction ... over the subintervals determined by the x values, x[0] < x[i] ... < x[n]." Spline API

The actual command I'm having issues with is
Java Code:
System.out.println("polySplineFunc at 0.5: " + polySplineFunc.value(0.5));
In which I get
Java Code:
Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
Unhandled exception type ArgumentOutsideDomainException

During debugging I used the call

Java Code:
System.out.println("polySplineFunc N: " + polySplineFunc.getN());
	System.out.println("polySplineFunc knots: " + polySplineFunc.getKnots()[0] + " " +polySplineFunc.getKnots()[1] + " " +polySplineFunc.getKnots()[2] + " " +polySplineFunc.getKnots()[3]);
in which case I got

Java Code:
polySplineFunc N: 3
polySplineFunc knots: 0.0 1.0 2.0 3.0
Now the PolynomialSplineFunction API states it will throw the given error if the double value passed to the value method is below or above the lowest and highest x value, respectively. However 0.5 clearly falls between 0 and 3.

Sorry to be so lengthy but I know this is part of Apache and not standard Java, so I want to be as descriptive as possible. Any help appreciated, I think these 2 classes will really help me out!