Algorithm of method of false position is given below-[25-28]
To find a root of f(x) = 0 in the interval [a0, b0] with which f(a0)
f(b0) < 0 with tolerance D
xn+1 = bn – (bn – an) f(bn) / [f(bn) – f(an)], n=0, 1, 2, ……
if ( |f(xn+1)| < D ) root found, stop iteration
else
if [ f(xn+1) f(bn) < 0 ] an+1 = xn+1; bn+1 = bn
else
an+1 = an; bn+1 = xn+1
Computer program developed by us to calculate square roots of
natural numbers from 1 to 25 is given below-