Git Product home page Git Product logo

polynomial's Introduction

This program takes a given polynomial and finds its roots using first the bisection method, then 
the secant method, and lastly a hybrid method composed of bisection method for first two iterations and 
secant method for the rest. Prints out the result and the number of iterations for each method.

FOR THIS PROGRAM TO WORK PROPERLY: 
Please enter 
1) The coefficients of the polynomial in descending power order  
2) The guess values for the root, the smaller one coming first 
3) And finally the tolerance value which determines the precision of the solution.

Bisection Method takes the two guess values and looks for a very short interval 
in which the function has a change in sign, it implies there is a root in the interval
if the function is continuous. The method begins with the given values for the interval and 
reduces the distance between them until a solution as accurately as the given tolerance is found.
At each iteration, the function's value is calculated at the midpoint of the current interval. 
And the half of the interval which does not have the sign of the value of midpoint is discarded.
When the iteration ends, the midpoint becomes the result.

Secant Method approximates the function by the secant line of the given points which are 
reasonably close to the exact root, then takes the zero of it as the next approximate solution. 
The line is refound in each iteration. Although it is complex, this process requires less 
iterations than the others.

Hybrid Method uses both methods, the bisection method for first two iterations and secant method 
for the rest of the iterations. It is in between the two methods by means of efficiency.

polynomial's People

Contributors

supiket avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.