# Bisection Method C Program

By | May 30, 2017

Let’s understand the bisection method in numerical analysis and learn how to implement bisection method in C programming with an explanation, output, advantages, disadvantages and much more.

#### What is Bisection method?

The bisection method is a root-finding method based on simple iterations. It bisects (or divides) the intervals, and thereby, selects another sub-interval in which the root must probably occur. The bisection method is used to solve transcendental equations.

The bisection method is used to find the real roots of a non-linear function. An interval basically consists of an end value and a start value, with which the mid-point is calculated.

Here, the size of the interval is reduced to 50% after every iteration and the number of iterations can be defined a priori.

The bisection method is based on the Intermediate Value Theorem. The bisection method is also popularly known as binary search method, dichotomy method and internal halving method.

The non-linear function used here is: x3 – 4x – 9

#### Bisection Method Theorem

An equation f(x) = 0, where f(x) is a real continuous function, has at least one root between a and b, if f(a) f(b) < 0.

The first method describes the implementation of bisection method in C programming using For loop whereas the second method demonstrates the use of If-Else method.

#### Bisection Method Algorithm

• Input an interval(start and end values), continuous function and function values f(a) and f(b).
• Find the mid-point value of the function.
• If the transformation is satisfactory, return the mid-point and then stop the iteration.
• Check the sign value of f(c) and replace the appropriate function and values.

In another way, the algorithm of bisection method can also be represented in the following way:

Given a function f (x) continuous on an interval [a,b] and f (a) * f (b) < 0

• The convergence is guaranteed in bisection method.
• The error can be controlled in this method.
• One function evaluation per iteration.
• The bisection method usually converges in a linear fashion.

• The convergence of bisection method is very slow compared to other iterative methods.
• The approximate rate of convergence of bisection method is 0.5.

Note: This bisection method in C programming is compiled with GNU GCC compiler using CodeLite IDE on Microsoft Windows 10 operating system.

#### Output

If you have any doubts about the implementation of Bisection method in C programming, let us know about it in the comment section.

NUMERICAL METHODS C PROGRAMS
Newton-Raphson Method C Program
Weddle’s Rule Algorithm C Program
Euler’s Method C Program
Secant Method C Program
Gauss Seidel Method C Program
Simpson’s 3/8th Rule C Program
Picard’s Method C Program
Regula Falsi Method C Program
Bisection Method Algorithm and Flowchart
Simpson’s 1/3rd Rule C Program
Trapezoidal Rule C Program

## 6 thoughts on “Bisection Method C Program”

1. Vikas Nair

The bisection methods seems to be very similar to Newton Raphson method though.

2. Vijay Kumar

Thanks for the bisection method. I, now, get to understand the power of C programming. Its really amazing.

3. Drishti Suri

The false position method is much faster than bisection method.

4. John Tuli

This bisection method C program is so informative. Thank you so much for the flowchart.

5. Anil Soni

The bisection method in C programs are described in such an easy manner. Thanks for it. I could now understand the algorithm.

6. Rajkumar Nabelli

Thank you so much!