function m = getSlope(f, varargin)

    eps = 1e-9;
    switch nargin
        case 1        
            m = @(x) (f(x + eps) - f(x)) / eps;
        case 2
            x0 = varargin{1};
            m = (f(x0 + eps) - f(x0)) / eps;
    end
    
end