Chord method is used for finding root of the function in given interval.


Function f, which is continous function and interval [a,b]. Function must satisfy given equation: f(a) * f(b) < 0 - signs of that values are different, which means that given function in given interval has at least one root in interval [a,b].
Root in given interval.
1. Calculate x = (a * f(b) - b* f(a)) / (f(b) - f(a));
2. Check if abs(f(x)) < precision.
3. If it is end algorithm and return x.
4. Check if f(a) * f(x) < 0.
5. If it is make x = (x * f(a) - a* f(x)) / (f(a) - f(x)).
6. Else make x = (x * f(b) - b * f(x)) / (f(b) - f(x)).
7. Go to step 2.

Sample Output:

f(x) = x * (x + 2) -1
[-3, 0]

root: -2.414201183431953

Chord Method Step By Step

Iteration Numberabxf(xn)
5-30-2.4117647058823533 -0.006920415224912602
8-30-2.414201183431953 -3.501277966366789E-5


  • easy to implement.
  • faster thanĀ bisection method.
  • no need to calculate derivative of given function.


  • has trouble with some functions.
Java Implementation Python Implementation C++ Implementation C# Implementation

Chord Method Algorithm
Tagged on:         

Leave a Reply

Your email address will not be published. Required fields are marked *

By continuing to use the site, you agree to the use of cookies. You can read more about it the Cookies&Privacy Policy Section Above. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this. You can read more about it the Cookies&Privacy Policy Section.