Question: I am doing interval bisection in my numerical analysis class and I'm a little confused on trying to complete the C program to get the

I am doing interval bisection in my numerical analysis class and I'm a little confused on trying to complete the C program to get the interval bisection to work. I am doing interval bisection in my numerical analysis class and I'm
a little confused on trying to complete the C program to get

The interval bisection method works iff the function is continuous and you can establish an initial left & right guess, such that: f(left) and f(right) have different signs (i.e.: one is positive and the other negative) COMPILE THIS CODE BY RUNNING: gcc interval_bisection04_lab.c-Im The -Im links with the math library * #include #include #include double f1 (double x) double y; y = x*x-2; return y; } double f2 (double x) // three roots, 11 -3 - sqrt(3) = -4.732050, // -3 + sqrt(3) = -1.267949, // 6 { double y: y = x*x*x - 30*x - 36; return y; } // f points at a function with one double input and a double output int interval_bisection(double (*f)(double x), double left, double right, double epsilon, int maxreps, double results[2]) // return 0 failure, else 'numreps' (>= 1) // 'maxreps' is the maximum iterations through the loop { // example of a valid function call to f: || double fl; // fl = f(left); // The algorithm should continue until 'maxreps' iterations have been // performed or the width of the interval is within 'epsilon' // your code goes here! } The interval bisection method works iff the function is continuous and you can establish an initial left & right guess, such that: f(left) and f(right) have different signs (i.e.: one is positive and the other negative) COMPILE THIS CODE BY RUNNING: gcc interval_bisection04_lab.c-Im The -Im links with the math library * #include #include #include double f1 (double x) double y; y = x*x-2; return y; } double f2 (double x) // three roots, 11 -3 - sqrt(3) = -4.732050, // -3 + sqrt(3) = -1.267949, // 6 { double y: y = x*x*x - 30*x - 36; return y; } // f points at a function with one double input and a double output int interval_bisection(double (*f)(double x), double left, double right, double epsilon, int maxreps, double results[2]) // return 0 failure, else 'numreps' (>= 1) // 'maxreps' is the maximum iterations through the loop { // example of a valid function call to f: || double fl; // fl = f(left); // The algorithm should continue until 'maxreps' iterations have been // performed or the width of the interval is within 'epsilon' // your code goes here! }

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!