jueves, 27 de abril de 2017

Bisection method, Java code

The bisection method, which is alternatively called binary chopping, interval halving, or Bolzano’s method, is one type of incremental search method in which the interval is always divided in half. If a function changes sign over an interval, the function value at the midpoint is evaluated. The location of the root is then determined as lying at the midpoint of the subinterval within which the sign change occurs. The process is repeated to obtain refined estimates. A simple algorithm for the bisection calculation is listed in the following figure.


Reference; Numerical Methods for Engineers. Steven C. Chapra and Raymond P. Canale

martes, 25 de abril de 2017

Lagrange Polynomial Java code


The Lagrange interpolating polynomial is simply a reformulation of the Newton polynomial
that avoids the computation of divided differences. It can be represented concisely as

where