def bisection_method(f, left, right, value, tol=1e-6, max_iters=1e12):
    """
    Simple bisection solver, which works well for finding roots of monotonic functions
    """
    mid = (left+right)/2
    i = 1
    # utilising the knowledge that the function is monotonically decreasing
    while (abs(f(mid) - value) > tol) & (i<max_iters):
        if f(left) < value:
            right = left
            left *= 0.5
        elif f(right) > value:
            left = right
            right *= 2
        elif f(mid) > value:
            left = mid
        else:
            right = mid
        mid = (left+right)/2
        i += 1
    return mid