Question: Please Implement the Bisection Method in C++ using the pseudocode given on pages 116-117 of the text. Test your code against the examples. NOT in

Please Implement the Bisection Method in C++ using the pseudocode given on pages 116-117 of the text. Test your code against the examples. NOT in Matlab. Only C++
- f(x) = x3 3x +1 on [0,1]
- g(x) = x3 2*sin(x) on [0.5,2]
- h(x) = x+10-xcosh(50/x) on [120,130]
- j(x) = x3 3x -5 on [2,3]
procedure Bisection(f, a, b, nmax, ) integer n, nmax; real a, b, c, fa, fb, fc, error fa = f(a) fb = f(b) if sign(fa) = sign(fb) then output a, b, fa, fb output "function has same signs at a and b" return (Continued) Bisection Pseudocode end if error-b-a for n = 0 to nmax error error/2 ca + error fc = f(c) output n, c, fc, error if errori
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
