asa047, a C++ code which minimizes a scalar function of several variables using the Nelder-Mead algorithm, by R ONeill.

The code is Applied Statistics Algorithm 47.


The computer code and data files described and made available on this web page are distributed under the MIT license


asa047 is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version and a Python version.

Related Data and Programs:


COMPASS_SEARCH, a C++ code which seeks the minimizer of a scalar function of several variables using compass search, a direct search algorithm that does not use derivatives.

PRAXIS, a C++ routine which minimizes a scalar function of several variables.

TOMS178, a C++ code which optimizes a scalar functional of multiple variables using the Hooke-Jeeves method.


Original FORTRAN77 version by R ONeill; C++ version by John Burkardt.


  1. John Nelder, Roger Mead,
    A simplex method for function minimization,
    Computer Journal,
    Volume 7, 1965, pages 308-313.
  2. R ONeill,
    Algorithm AS 47: Function Minimization Using a Simplex Procedure,
    Applied Statistics,
    Volume 20, Number 3, 1971, pages 338-345.

Source Code:

Last revised on 25 January 2020.