Neat Fortran/Numerical tricks

Quote:

>[for finding real zeros of a scalar function]

>I teach them to always use (and have them write as an assignment) a combined

>bisection/newton or bisection/secant method so they get guaranteed

>convergence and often the speed of the better algorithms.

I would suggest teaching them *about* the (bisection/secant or

bisection/Newton) method, but having them program using a existing

high quality "black box" code which implements the method carefully.

The books by Forsythe, Malcolm, and Moler, and more recently by

Kahaner, Moler, and Nash, exemplify this philosophy.

The key point here is that your students will probably continue to

use the programs from this course for years to come, in a wide range

of problems. It's thus important for them to become familiar with

*high* *quality* codes. These need not be any harder to use than

ones of lesser quality, and fortunately are often available (free!)

from your favorite archive site.

For the (Van Wijngaarden-Dekker-Brent bisection/secant) method under

discussion, the best implementation seems to be the standard ZEROIN

code available from netlib. (Forsythe, Malcolm, and Moler give both

a detailed exposition and a complete source listing of this code.)

Note that the version of this code in Numerical Recipes has been

modified from the original, and can suffer from spurious floating

point underflow.

University of Texas at Austin / Physics Dept / Center for Relativity

and (for a few more months) University of British Columbia / Astronomy