public static INDArray approximateDerivative(Function<INDArray,INDArray> f,
                                                 INDArray x,
                                                 INDArray relStep,INDArray f0,
                                                 INDArray bounds)  {
        if(x.rank() > 2) {
            throw new ND4JIllegalArgumentException("Argument must be a vector or scalar");
        }

        INDArray h = computeAbsoluteStep(relStep,x);
        INDArray[] upperAndLower = prepareBounds(bounds, x);
        INDArray[] boundaries = adjustSchemeToBounds(x,h,1,upperAndLower[0],upperAndLower[1]);
        return denseDifference(f,x,f0,h,boundaries[1]);

    }
public static INDArray approximateDerivative ( Function < INDArray , INDArray > f , INDArray x , INDArray relStep , INDArray f0 , INDArray bounds ) { if ( x . rank ( ) > 2 ) { throw new ND4JIllegalArgumentException ( "Argument must be a vector or scalar" ) ; } INDArray h = computeAbsoluteStep ( relStep , x ) ; INDArray [ ] upperAndLower = prepareBounds ( bounds , x ) ; INDArray [ ] boundaries = adjustSchemeToBounds ( x , h , 1 , upperAndLower [ 0 ] , upperAndLower [ 1 ] ) ; return denseDifference ( f , x , f0 , h , boundaries [ 1 ] ) ; }
@param f
@param x
@param relStep
@param f0
@param bounds
@return