Chris Beaumont's IDL Library

Download source code

single page | use frames     summary     class     fields     routine details     file attributes



Numerical recipes

result = goldenmin(func, xa, xb, xc [, tol=tol] [, verbose=verbose] [, _extra=_extra], fmin=fmin)

This function finds a (local) minimum of a function, given three points which bracket this minimum. The routine is lifted from the routine 'golden' from Numerical Recipes

Return value

The value x for which f(x) is a mimum in the range [xa, xb].


func in required

The string name of a function to minimize. This function must be of the form y = f(x). It must return a scalar.

xa in required

The first of three points bracketing the minimum

xb in required

The second point. f(xb) must be < than both f(xa) and f(xc), and must lie between xa and xc

xc in required

The final point bracketing the minimum


tol in optional

The desired fractional precision of the minimum coordinate. Defaults to .001 if absent.

verbose in optional

Print extra information

_extra in optional

Any extra keywords will be passed to FUNC


Author information


Written by: Chris Beaumont, Feb 2009 Added _extra keyword. cnb. June 2009

File attributes

Modifcation date: Tue Mar 20 12:03:52 2012
Lines: 108