answersLogoWhite

0

#include

#include

#include

#define fn(x) (x*x*x-3*x*x-x+9)

void main()

{

clrscr();

float x,a,b,y,y1,y2;

cout<<"enter the initial value a&b"<

cin>>a>>b;

y1=fn(a);

y2=fn(b);

if(y1*y2>0)

{

cout<<"invalid interval"<

}

do

{

x=(a+b)/2;

y=fn(x);

if(y1*y<0)

{

b=x;

y2=y;

}

else

{

a=x;

y1=y;

}

}

while(fabs(b-a)>.001);

cout<<"the root of the equation ="<

getch();

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering

What is the defference between bisection method and newton method?

there are three variable are to find but in newton only one variable is taken at a time of a single iteration


Why it is advantageous to combine Newton Raphson method and Bisection method to find the root of an algebraic equation of single variable?

An improved root finding scheme is to combine the bisection and Newton-Raphson methods. The bisection method guarantees a root (or singularity) and is used to limit the changes in position estimated by the Newton-Raphson method when the linear assumption is poor. However, Newton-Raphson steps are taken in the nearly linear regime to speed convergence. In other words, if we know that we have a root bracketed between our two bounding points, we first consider the Newton-Raphson step. If that would predict a next point that is outside of our bracketed range, then we do a bisection step instead by choosing the midpoint of the range to be the next point. We then evaluate the function at the next point and, depending on the sign of that evaluation, replace one of the bounding points with the new point. This keeps the root bracketed, while allowing us to benefit from the speed of Newton-Raphson.


How do you write Square program using vb?

write a vb program to find the magic square


Write a program to find the grade obtained by the students of a class using structure?

Write a program to find the grade obtained by the students of a class


Write c program to find median?

If you are using an array : sort using qsort() then take middle element.

Related Questions

To find the roots of 2xx-5x plus 1 equals 0 by bisection method?

I'm not familiar with the "bisection method" to find the roots of 2x2-5x+1 = 0 but by completing the square or using the quadratic equation formula you'll find that the solution is: x = (5 + or - the square root of 17) over 4 Hope that helps.


How do you find the The initial range of Bisection method?

If this is in the context of finding a root of an equation, the answer is to make some guesses. Find value x1 and x2 such that f(x1) and f(x2) have opposite signs. Then, provided that f is a continuous function over (x1, x2), the bisection method will find its root.


What is the defference between bisection method and newton method?

there are three variable are to find but in newton only one variable is taken at a time of a single iteration


Write a program to find the product of two numbers using Halving and Doubling method?

i need this answer


Why it is advantageous to combine Newton Raphson method and Bisection method to find the root of an algebraic equation of single variable?

An improved root finding scheme is to combine the bisection and Newton-Raphson methods. The bisection method guarantees a root (or singularity) and is used to limit the changes in position estimated by the Newton-Raphson method when the linear assumption is poor. However, Newton-Raphson steps are taken in the nearly linear regime to speed convergence. In other words, if we know that we have a root bracketed between our two bounding points, we first consider the Newton-Raphson step. If that would predict a next point that is outside of our bracketed range, then we do a bisection step instead by choosing the midpoint of the range to be the next point. We then evaluate the function at the next point and, depending on the sign of that evaluation, replace one of the bounding points with the new point. This keeps the root bracketed, while allowing us to benefit from the speed of Newton-Raphson.


How to write a C program to find largest 2 numbers using pointers?

program to find maximum of two numbers using pointers


How do you write a java program to find the square root of a number?

You can use the Math.sqrt() method.


How do you get a new keyless entry device for your 2002 Chevy Venture?

I usually find them on E-bay. It is cheaper this way. Then you just program it using the method in the owners manual. Good luck.


What is the name for the method of using the displacements of water to find the volume of a strange shaped object?

Displacement method.... Is the method to find volume of an irregular object


Half deflection method to find galvanometer resistance?

We can find it by using wheatstone bridge.


How do you write Square program using vb?

write a vb program to find the magic square


How do you find the range using the subtraction method?

Range = Maximum - Minimum