qwerty9143
Technical User
The Newton method is used to determine the value of x that makes |f(x)| < t0≈0. The value of x is determined from the following formula, where x0 is the initial guess:
xn+1 = xn - (f(xn)/f'(xn)) n=0,1,2,...
In this equation, the prime denotes the derivative with respect to x.The value of n is a function of the tolerance, which is a very small value, and the choice of x0. Write a FORTRAN script that obtains the value of x when
f(x)=cos(x) + sin(x)
f'(x)= -sin(x) + cos(x)
and when x0=1.5 and t0<10-8. Have the output of the program displayed to the Console the various quantities as shown below.
At x = 2.35619450,f(x)= 6.0407994966881623E-009 after 4 iterations