Newton Raphson Method Pseudocode

Earlier in Newton Raphson Method Algorithm, we discussed about an algorithm for computing real root of non-linear equation using Newton Raphson Method. In this tutorial we are going to develop pseudocode for this method so that it will be easy while implementing using programming language.

Pseudocode for Newton Raphson Method

1. Start

2. Define function as f(x)

3. Define derivative of function as g(x)

4. Input:
	a. Initial guess x0 
	b. Tolerable Error e
	c. Maximum Iteration N

5. Initialize iteration counter step = 1

6. Do 
	If g(x0) = 0
		Print "Mathematical Error"
		Stop
	End If

	x1 = x0 - f(x0) / g(x0)
	x0 = x1
	
	step = step + 1
	
	If step > N
		Print "Not Convergent"
		Stop
	End If

   While abs f(x1) > e 

7. Print root as x1

8. Stop

Recommended Readings

  1. Newton Raphson Method Algorithm
  2. Newton Raphson Method Pseudocode
  3. Newton Raphson Method Using C
  4. Newton Raphson Method Using C++
  5. Newton Raphson Method Online Calculator