public float[] calculate(float[] x) {
        // create output array
        float y[] = new float[x.length * C0.length];
        float yValue;
        // for each y value, apply exponential interpolation function
        for (int i = 0; i < x.length; i++) {
            // C0 and C1 should have the same length work through C0 length
            for (int j = 0; j < C0.length; j++) {
                // apply the function as defined above.
                yValue = (float) (C0[j] + Math.pow(x[i], N) * (C1[j] - C0[j]));

                // Range is optional but if present should be used to clip the output
                if (range != null)
                    yValue = Math.min(Math.max(yValue, range[2 * j]), range[2 * j + 1]);

                // finally assign the interpolation value.
                y[i * C0.length + j] = yValue;
            }
        }
        return y;
    }