[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Sand 1, D-72076 Tübingen, Germany
New Address!   --   Neue Adresse!
[Uni logo]


ZBRENT Source code in zbrent.pro

ZBRENT

Name
     ZBRENT
Purpose
     Find the zero of a 1-D function up to specified tolerance.
Explanation
     This routine assumes that the function is known to have a zero.
     Adapted from procedure of the same name in "Numerical Recipes" by
     Press et al. (1992), Section 9.3
Calling Sequence
       x_zero = ZBRENT( x1, x2, FUNC_NAME="name", MaX_Iter=, Tolerance= )
Input Parameters
       x1, x2 = scalars, 2 points which bracket location of function zero,
                                               that is, F(x1) < 0 < F(x2).
       Note: computations are performed with
       same precision (single/double) as the inputs and user supplied function.
Required Keywords
       FUNC_NAME = function name (string)
               Calling mechanism should be:  F = func_name( px )
               where:  px = scalar independent variable, input.
                       F = scalar value of function at px,
                           should be same precision (single/double) as input.
Optional Input Keywords
       MAX_ITER = maximum allowed number iterations, default=100.
       TOLERANCE = desired accuracy of minimum location, default = 1.e-3.
Output Parameters
       Returns the location of zero, with accuracy of specified tolerance.
Procedure
       Brent's method to find zero of a function by using bracketing,
       bisection, and inverse quadratic interpolation,
Example
       Find the root of the COSINE function between 1. and 2.  radians
        IDL> print, zbrent( 1, 2, FUNC = 'COS')
       and the result will be !PI/2 within the specified tolerance
Revision History
       Written, Frank Varosi NASA/GSFC 1992.
       FV.1994, mod to check for single/double prec. and set zeps accordingly.
       Converted to IDL V5.0   W. Landsman   September 1997
       Use MACHAR() to define machine precision   W. Landsman September 2002

Last modified by pro2html on 2002 September 27 at 03:49 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically