lab14a - / In your comments, it's appropriate to note that...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// In your comments, it's appropriate to note that you are modifying an existing // program, note where you got the original program (a URL would be acceptable), // and give me credit as the original author. // Programmer: Doug Hogan // Section: N/A // Program: Lab 14 Partial Solution // Date: July 29, 2008 // Description: This program is a partial implementation of Bisection Method, // Algorithm 2.1, p. 49, Burden/Faires Numerical Analysis text // // Goal: Find a solution to f(x) = 0 given continuous function f // on interval [a,b], where f(a) and f(b) have opposite signs // // Example function used : f(x) = x^3 + 4x^2 - 10 = 0; root in [1,2] #include <iostream> #include <math.h> using namespace std; const double TOLERANCE = 0.0001; // maximum amount of error allowed in an approximation const int MAX_ITERATIONS = 20; // maximum number of iterations to allow int main() { double zero = RootByBisection(1.0, 2.0); cout << endl << "Root found at: " << zero << endl; return 0; } double f(double x)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

lab14a - / In your comments, it's appropriate to note that...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online