= Solution
A small difference between successive <secant method> iterates alone does not certify a small absolute error. Instead use a <residual root error bound>. On $[2,3]$,
$$
f'(x)=\frac{\ln x+1}{\ln2}\geq m:=1+\frac1{\ln2}>0,
$$
and $f(2)<0<f(3)$, so there is a unique <root> $r\in(2,3)$. For an iterate $x\in[2,3]$, the <mean value theorem> gives
$$
|x-r|=\frac{|f(x)|}{|f'(\xi)|}\leq\frac{|f(x)|}{m}.
$$
Therefore \b[stop when $x\in[2,3]$ and $|x\log_2x-4|\leq(1+1/\ln2)10^{-10}$]. This guarantees the desired absolute error in exact arithmetic; the evaluated <residual of a root equation> should include an allowance for its much smaller <roundoff error>. A safeguarded implementation can retain the bracket $[2,3]$ and use <bisection> if a proposed <secant method> step leaves it.
Back to article page