Regula Falsi Method ( Method of False Position )

Regula Falsi Method  :

ALGORITHM :

  1. Read x0, x1, e, n
    x0 and x1 are two initial guesses to the root such that f(x0)*f(x1)<0.
    The prescribed precision is e and n is maximum number of iterations. 
  2.  f0 ← f(x0)
  3.  f1 ← f(x1)
  4. For i = 1 to n in steps of 1 do
  5.  x2 ← (x0 f1 – x1f0)/(f1 – f0)
  6. f2 ← f(x2)
  7. If | f2 | ≤ e then
  8. Begin write ‘convergent solution’, x2, f2
  9. Stop end
  10. If sign (f2) ≠ sign (f0)
  11. Then begin x1 ← x2
  12. f1 ← f2 end
  13. Else begin x0 ← x2
  14. f0 ← f2 end
  15. [end for]
  16. Write ‘Does not converge in n iterations’
  17. Write x2, f2
  18. Stop.

C SOURCE CODE :


OUTPUT : 

Leave a Reply

Your email address will not be published. Required fields are marked *