Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We used the bisection method to find the root of a polynomial equation in the second C++ home- work. If you recall, we were solving

image text in transcribed

We used the bisection method to find the root of a polynomial equation in the second C++ home- work. If you recall, we were solving f(x) = 3 +Cz-10 = 0 by guessing initial upper and lower bounds zu and zl on the root z*, and we then proceeded by: (i) finding the mid-point Zmid = ( +Zu)/2; (ii) evaluating the function at this new value, ie, computing f(Trna); (iii) replacing one of the two bounds xi or 3u with Emid, thus cutting the interval in half; and (iv) repeating this until the bounds were very close together Let's re-implement the bisection method here in a slightly more general way. Specifically, we want the actual bisection algorithm (the description above) to be in the main part of the program, but we want the actual function evaluation (i.e., where we compute the value of f(x) for any x) to be in a C++ function declared as float myfcn(float x); Take the initial bounds as zl =-100 and ru-100, and keep iterating until Tu-z!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions

Question

Bachelors degree in Information Systems or Statistics

Answered: 1 week ago