Question: Write a program in c++ to implement the fixed-point iteration method. Then use your code to find all the roots of f (x) = ?2
Write a program in c++ to implement the fixed-point iteration method. Then use your code to find all the roots of f (x) = ?2 + 6x ? 4x^2 + 0.5x^3 ; the roots should be calculated such that the relative approximate error is less than 10^-6 . Notice that the method will not converge always, and thus a maximum number of iterations must be specified. Use the following initial guesses 0, 1.37, 6.2 . What do you observe? Your code should, for all iterations, output the iteration number, the current estimate of the root, and the relative approximate error.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
