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 computer code and data files described and made available on this web page are 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_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).
BRENT, a C code which contains Richard Brent's routines for finding the zero, local minimizer, or global minimizer of a scalar function of a scalar argument, without the use of derivative information.
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.