test_zero, a C code which defines nonlinear functions that may be used to test zero finders.
Zero finders are programs that seek a (scalar) root of a scalar equation F(X) = 0. Some zero finders require that an initial "change-of-sign" interval [A,B] be supplied, with the function having opposite sign at the two endpoints, thus guaranteeing that there is some value C between A and B for which F(C) = 0 (assuming that the function F is continuous). In other cases, a particular zero finder may want information about the first or second derivative of the function. And some zero finders can handle situations where the function has a multiple root, or where the function is a polynomial.
The code supplies a set of nonlinear functions, along with change of sign interval, first and second derivatives, suggested starting points, so that the behavior of any zero finder can be analyzed.
The code includes implementations of some simple zero finders, as a demonstration of how the package might be used.
The functions, which are accessible by number, are
The information on this web page is distributed under the MIT license.
test_zero is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.
bisection, a C code which applies the bisection method to seek a root of f(x) over a change-of-sign interval a <= x <= b.
bisection_rc, a C code which seeks a solution to the equation F(X)=0 using bisection within a user-supplied change of sign interval [A,B]. The procedure is written using reverse communication (RC).
zero_brent, a C code which seeks a solution of a scalar nonlinear equation f(x) = 0, by Richard Brent.
zero_laguerre, a C code which uses Laguerre's method to find the zero of a function. The method needs first and second derivative information. The method almost always works when the function is a polynomial.
zero_muller, a C code which seeks a root of a nonlinear equation using the Muller method, with complex arithmetic.
zero_rc, a C code which seeks solutions of a scalar nonlinear equation f(x) = 0, or a system of nonlinear equations, using reverse communication (RC).