Thursday, September 24, 2015

Write an Algorithm for the Newton - Raphson Method.

Step1:-  Assign an initial value to x, say x0 & set value of E.
Step2:-  Evaluate f ( x0 ) & f ' ( x0 ) .
Step3:-  Find the improved estimate to x0.
              x1 = x0 - ( f (x0) / f ' (x0) )
Step4:-  Check for accuracy of the latest estimate.
              Compare relative error to a predefined value E.
              If absolute value of (x1 - x0) / x1 ≤  E
                   Stop.
              else
                  Continue.
Step5:-  Replace x0 by x1 & repeat Step 3 & Step 4.