# Secant Method; how many iterations needed for a certain accuracy?

Currently, I am following a numerical methods course. I came across the following question on an old exam, and don't know how to approach it:

We have the function $$f(x)=e^{-x} -5x+10$$.

First, I had to calculate $$x_2$$, while given that $$x_0$$ =2.0 and $$x_1$$=2.1. This is just filling in the secant formula, where I obtained that $$x_2$$ = 2.02639...

The error of $$x_2$$ = $$(x_2$$-$$x_1$$)/$$x_2$$ = 0.03632698

Now the next question is where I am stuck: "How many iterations are needed to obtain an accuracy of $$1.0^{-9}$$?".

I know that the convergence factor of the Secant Method is the golden ratio, so it is converging faster than first order, but less fast than a second-order method. I have come across similar questions using the Bisection method instead of the Secant Method. Using the bisection method, we half the interval after every iteration, so we could solve the equation

$$(1/2)^{n}*error$$ $$(x_2)$$ $$<1.0^{-9}$$, where n denotes the amount of iterations.

Is there also such an equation I can use for the Secant method? Does it have anything to do with the factor $$1/2$$ that should be replaced by the golden ratio?

Thanks

• I've never learned of a way to hard-code an iteration count for secant method to get a guaranteed accuracy (although it is SUPER cool that it's even possible for Bisection method!) Have you tried estimating via an upper bound on the successive error ratios? That way you don't have to keep computing iterates by hand
– Zim
Jul 7, 2020 at 16:18
• If the secant method converges (to a regular simple root), the order of convergence is the golden ratio $\phi=\frac{1+\sqrt5}2=1.6...$. How many digits per step that gives depends on the function, so you would have to observe some steps to extrapolate a trend. On the other hand, once the trapping region of a root is reached, convergence to floating point accuracy is reached in 4-6 steps, so a-priori estimates are not that important or even possible. Jul 7, 2020 at 17:49
• @LutzLehmann I notices the mistake, it should be $e^{-x}$ thanks Jul 7, 2020 at 18:08