def derivate(f, a, d=10 ** -8, left=False):
    """
    estimate derivate
    :param f: function float -> float
    :param a: point
    :param d: little piece of increment
    :param left: if True, will derivate f from left (from right by default)
    :return:
    """
    return (f(a + d) - f(a)) / d if not left else (f(a) - f(a + d)) / d
