to be honest i am a bit confused .. i don't know where to start ..
Code:
program to find the root of the equation x^3+3x-1 by newton raphson method
PHP Code:
Computation of a root of f(x)= 0 by newton raphson method
step 0
Code:
define f(x) , f'(x)
step 1
Code:
Input x0 , epsilon,maxit
x0 is the initial guess of the root , epsilon is the desired accuracy of the root and maxit is the maximum number of iterations allowed
step 2 step 3 step 4
Code:
compute df0 = f'(x0)
step 5 step 6 step 7
Code:
check if |(x1-x0)|x1|< epsilon , then print "root is" , x1 and stop
else if i<n, then set x0=x1 and go to step 3
step 8
Code:
write "iterations do not converge"
step 9