# The Algorithm for The Fixed Point Method

We will now look at the algorithm for the fixed point method in approximating a root of a function.

Obtain a function $f$ in the appropriate form ($f(x) = 0 \Leftrightarrow x = g(x)$) and assume that a root $\alpha$ exists. Obtain an initial approximation $x_0$, a maximum number of iterations, and an error tolerance $\epsilon$.

For $i = 1, 2, ...$ up to the maximum number of iterations prescribed:

**Step 1:** Obtain the successive approximations by the fixed point method with the following formula:

**Step 2:** Check the error tolerance:

If the above inequality is true, then stop. $x_n$ is a good approximation of the root $\alpha$. If the inequality above is false, then continue to compute successive approximations until the maximum number of iterations is reached. If the maximum number of iterations is reached and the error tolerance $\epsilon$ is not obtained, then print out a failure message.