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

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++

  1. f(x) = x3 3x +1 on [0,1]
  2. g(x) = x3 2*sin(x) on [0.5,2]
  3. h(x) = x+10-xcosh(50/x) on [120,130]
  4. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!