def numeric_derivative(func, x, eps=0.001):
        'Estimate the derivative using numerical methods'
        y0 = func(x - eps)
        y1 = func(x + eps)
        return (y1 - y0) / (2.0 * eps)
Estimate the derivative using numerical methods
recipes/Python/580610_Auto_differentiation/recipe-580610.py