def falci(func, a, b, error_accept):

    def f(x):
        f = eval(func)
        return f
    error = (b - a)
    if (((f(a) * f(b)) >= 0) and (a >= b)):
        print('wrong a,b')
        return
    x = a
    n = 0
    while (error >= error_accept):
        data.append(n)
        n = (n + 1)
        data.append(str(a))
        data.append(str(b))
        x = (((x * f(b)) - (b * f(x))) / (f(b) - f(x)))
        data.append(str(x))
        x_axis.append(x)
        data.append(str(f(x)))
        y_axis.append(f(x))
        if (f(x) == 0):
            break
        elif ((f(x) * f(b)) < 0):
            a = x
        elif ((f(a) * f(x)) < 0):
            b = x
        c = data.copy()
        Data.append(c)
        error = abs((b - a))
        data.clear()
    print(('The root is %0.4f' % x))
def falci(func, a, b, error_accept):

    def f(x):
        f = eval(func)
        return f
    error = (b - a)
    if (((f(a) * f(b)) >= 0) and (a >= b)):
        print('wrong a,b')
        return
    x = a
    n = 0
    while (error >= error_accept):
        data.append(n)
        n = (n + 1)
        data.append(str(a))
        data.append(str(b))
        x = (((x * f(b)) - (b * f(x))) / (f(b) - f(x)))
        data.append(str(x))
        x_axis.append(x)
        data.append(str(f(x)))
        y_axis.append(f(x))
        if (f(x) == 0):
            break
        elif ((f(x) * f(b)) < 0):
            a = x
        elif ((f(a) * f(x)) < 0):
            b = x
        c = data.copy()
        Data.append(c)
        error = abs((b - a))
        data.clear()
    print(('The root is %0.4f' % x))