% Simple first order accurate numeric first derivative
% Fp ~ (F(x+h)-F(x))/h
function fp=derivative(F, x)   
    h = 1e-6;
    x_h = x + h;
    fp=(F(x_h)-F(x))/h;
end