      implicit   none
      integer    n
      parameter  (n=2)
c
      integer    i, maxfcn, nout
      real       ftol, fx, s, x(n), x0(n)
      external   fcn, dumpol, umach
c
      data x0 / -1.2, 1.0 /
c
      ftol   = 1.0e-10
      maxfcn = 200
      s      = 1.0
c
      call umpol(fcn, n, x0, s, ftol, maxfcn, x, fx)
c
      call umach(2, nout)
      write (nout, 999) (x(i), i=1,n), fx
999   format ('x = (', 2(2x,f4.2), '), fx = ', e12.6)
c
      end
c                             Minimoitava funktio
      subroutine fcn(n, x, f)
      integer  n
      real     x(n), f
      f = 100.0*(x(1)*x(1)-x(2))**2 + (1.0-x(1))**2
      return
      end
