protected void doFunction(float[] inputs, int inputOffset,
            float[] outputs, int outputOffset) {
        // calculate the encoded values for each input


        float input = inputs[inputOffset];

        int subdomain = 0;
        while (subdomain < bounds.length && input >= bounds[subdomain]) {
            ++subdomain;
        }

        final float boundMin = subdomain == 0 ? getDomain(0) : bounds[subdomain - 1];
        final float boundMax = subdomain == bounds.length ? getDomain(1) : bounds[subdomain];

        final float encodedInput = FunctionType0.interpolate(
                input,
                boundMin,
                boundMax,
                encode[subdomain * 2],
                encode[subdomain * 2 + 1]);

        final float[] subfuncInputArr = new float[] { encodedInput };

        functions[subdomain].calculate(subfuncInputArr, 0, outputs, outputOffset);

   }