home *** CD-ROM | disk | FTP | other *** search
/ BUG 1 / BUGCD1996_0708.ISO / pc / aplic / mercury / rosen.eka < prev    next >
Text File  |  1992-11-03  |  303b  |  15 lines

  1. ; This demonstrates minimizing a simple function with an initialization.
  2. ; It is the Rosenbrock function, a tricky case for function minimizers.
  3.  
  4. MINIMIZE F
  5.  
  6.  F = A + B + (X - Z)^2 + 100000 (Y - X^2)^2
  7.  Z = 2.34
  8.  A = 4
  9.  B = 3
  10.  
  11.   X := -1.2
  12.   Y := 1
  13.  
  14. { Exact solution is x = 2.34, F = 7. }
  15.