} } du=(*df)(u); Now all the housekeeping, sigh. if (fu = x) a=x; else b=x; MOV3(v,fv,dv, w,fw,dw) MOV3(w,fw,dw, x,fx,dx) MOV3(x,fx,dx, u,fu,du) } else { if (u | 408 Chapter 10. Minimization or Maximization of Functions du df u Now all the housekeeping sigh. if fu fx if u x a x else b x MOV3 v fv dv w fw dw MOV3 w fw dw x fx dx MOV3 x fx dx u fu du else if u x a u else b u if fu fw w x MOV3 v fv dv w fw dw MOV3 w fw dw u fu du else if fu fv v x v w MOV3 v fv dv u fu du nrerror Too many iterations in routine dbrent return Never get here. CITED REFERENCES AND FURTHER READING Acton . 1970 Numerical Methods That Work 1990 corrected edition Washington Mathematical Association of America pp. 55 454-458. 1 Brent . 1973 AlgorithmsforMinimizationwithoutDerivatives Englewood Cliffs NJ PrenticeHall p. 78. Downhill Simplex Method in Multidimensions With this section we begin consideration of multidimensional minimization that is finding the minimum of a function of more than one independent variable. This section stands apart from those which follow however All of the algorithms after this section will make explicit use of a one-dimensional minimization algorithm as a part of their computational strategy. This section implements an entirely self-contained strategy in which one-dimensional minimization does not figure. The downhill simplex method is due to Nelder and Mead 1 . The method requires only function evaluations not derivatives. It is not very efficient in terms of the number of function evaluations that it requires. Powell s method is almost surely faster in all likely applications. However the downhill simplex method may frequently be the best method to use if the figure of merit is get something working quickly for a problem whose computational burden is small. The method has a geometrical naturalness about it which makes it delightful to describe or work through A simplex is the geometrical figure consisting in N dimensions of N 1 points or vertices and all their interconnecting line segments polygonal faces etc. In two dimensions a simplex is a triangle. In three dimensions it is a tetrahedron not .