final double[] xData = getKeys();
final double[] yData = getValues();
final int n = xData.length - 1;
if (n == 0) {
final double a = yData[0];
return new RealPolynomialFunction1D[] {new RealPolynomialFunction1D(a) };
} else if (n == 1) {
final double a = yData[1];
final double b = (yData[1] - yData[0]) / (xData[1] - xData[0]);
return new RealPolynomialFunction1D[] {new RealPolynomialFunction1D(a, b) };
} else {
final RealPolynomialFunction1D[] quadratic = new RealPolynomialFunction1D[n - 1];
for (int i = 1; i < n; i++) {
quadratic[i - 1] = getQuadratic(xData, yData, i);
}