from numpy import log as ln def g(x): return ln(4+x-x**2) def FixedPoint(p0,tolerance): p = g(p0) abs_error = abs(p-p0) p0 = p while abs_error>=tolerance: p = g(p0) abs_error = abs(p-p0) p0 = p return p starting_point = 2 tolerance = 10**-10 fixed_point = FixedPoint(starting_point,tolerance) print('Fixed-point of g(x) = {0} is x = {1:.7f}'.format(formula,fixed_point)) So, i have this fixed point root finding algorithm to find the root of ln(4+x-x^2), how do i add the aitken sequence program to increase the rate of convergence of finding the root of ln(4+x-x^2). im having trouble in keeping the value of each iterations.
exp(x)=4+x-x^2. What did you already try for Aitken's delta squared process? It could look similar to math.stackexchange.com/a/3109837/115115