@Override
    public Result value(Function<Double, Double> function) {
        Result result = null;
        try
        {
            AcceleratorSingleStep<Double> richardson = new RichardsonExtrapolationReal(4.0);
            HashMap<Integer, Double> values = new HashMap<Integer, Double>();
            double lowerBound = this.getRegion().getLowerBound();
            double length = this.getRegion().getUpperBound() - lowerBound;
            final double iterativeSplits = 2.0;

            int iteration = 0;
            double i = length*(function.value(lowerBound) + function.value(lowerBound + length)) /
                    iterativeSplits;
            values.put(iteration, i);
            this._ImproveValues(values, iteration, richardson);
            for (iteration = 1; iteration < this.getMaximumIterations() &&
                    !this._HasConverged(values, iteration - 1); iteration++) {
                i /= iterativeSplits;
                length /= iterativeSplits;
                for (int j = 1; j <= Math.pow(iterativeSplits, iteration-1.0); j++) {
                    i += length*function.value(lowerBound + ((iterativeSplits*(double)j - 1.0))*length);
                }

                values.put(iteration, i);
                this._ImproveValues(values, iteration, richardson);
            }
            if (this._HasConverged(values, iteration - 1))
                result = new IterativeSuccess(iteration,
                        values.get(iteration - 1));
            else if (this.getMaximumIterations() <= iteration)
                result = new MaximumIterationsFailure(iteration);
            else
                throw new ArithmeticException("Unknown termination: " +
                        "Values have not converged and maximum iterations " +
                        "have not been reached.");
        }
        catch (Exception e)
        { result = new UnhandledExceptionThrown(e); }
        return result;
    }