• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE | GATE-CS-2015 (Set 2) | Question 51

The secant method is used to find the root of an equation f(x) = 0. It is started from two distinct estimates xa and xb for the root. It is an iterative procedure involving linear interpolation to a root. The iteration stops if f(xb) is very small and then xb is the solution. The procedure is given below. Observe that there is an expression which is missing and is marked by? Which is the suitable expression that is to be put in place of? So that it follows all steps of the secant method? Secant
Initialize: xa, xb, ε, N     // ε = convergence indicator
fb = f(xb) i = 0
while (i < N and |fb| > ε) do
   i = i + 1                 // update counter
   xt = ?                    // missing expression for
                             // intermediate value
   xa = xb                   // reset xa
   xb = xt                   // reset xb
   fb = f(xb)                // function value at new xb
end while
if |fb| > ε
  then // loop is terminated with i = N
  write “Non-convergence”
else
  write “return xb”
end if 

(A)

xb – (fb– f(xa)) fb/ (xb – xa)

(B)

xa– (fa– f(xa)) fa/ (xb – xa)

(C)

xb – (fb – xa) fb/ (xb – fb(xa)

(D)

xa – (xb – xa) fa/ (fb – f(xa))

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments