anchor.diff:      integer :: jj
       integer :: i
   
  -    double precision :: startpt(VARS)
  -    double precision :: rho
  -    double precision :: epsilon
  -    double precision :: endpt(VARS)
  +    real(DP) :: startpt(VARS)
  +    real(DP) :: rho
  +    real(DP) :: epsilon
  +    real(DP) :: endpt(VARS)
   
   #ifndef WOODS
       ! Starting guess for Rosenbrock's test function.
  
positive.code: 
  ! === Helper function.
  ! Given a point, look for a better one nearby, one coord at a time.
  double precision function best_nearby(delta, point, prevbest, nvars)
      use proto__, only: VARS, f
  
      implicit none
  
      ! Returns: The objective function value at a nearby.
  
      ! Arg. The delta between prevbest and point.
      double precision, intent(inout) :: delta(:)
  
      ! Arg. The coordinate from where to begin.
      double precision, intent(inout) :: point(:)
  
      ! Arg. The previous best-valued coordinate.
      double precision, intent(in) :: prevbest
  
      ! Arg. The number of variables.
      integer, intent(in) :: nvars
  
      double precision :: minf
      double precision :: z(VARS)
      double precision :: ftmp
  
      integer :: i
  
  
negative.code:     ! Function prototypes.
      interface
          ! The objective function f(x,n).
          real(kind(1.d0)) function f(x, n)
              real(kind(1.d0)), intent(in)     :: x(:)
              integer, intent(inout), optional :: n
          end function f
  
          ! The helper function best_nearby(...).
          real(kind(1.d0)) function best_nearby(delta, point, prevbest, nvars)
              real(kind(1.d0)), intent(inout) :: delta(:)
              real(kind(1.d0)), intent(inout) :: point(:)
              real(kind(1.d0)), intent(in)    :: prevbest
              integer, intent(in)             :: nvars
          end function best_nearby
  
          ! The main optimization function hooke(...).
          integer function hooke(nvars, startpt, endpt, rho, epsilon, itermax)
              integer, intent(in)           :: nvars
              real(kind(1.d0)), intent(in)  :: startpt(:)
              real(kind(1.d0)), intent(out) :: endpt(:)
              real(kind(1.d0)), intent(in)  :: rho
              real(kind(1.d0)), intent(in)  :: epsilon
              integer, intent(in)           :: itermax
          end function hooke
      end interface
  end module proto__
  
  ! === The user-supplied objective function f(x,n).
  real(DP) function f(x, n)
      use proto__, only: DP, funevals
  
      implicit none
  
      ! Returns: The objective function value.
  
      ! Arg. The point at which f(x) should be evaluated.
      real(DP), intent(in) :: x(:)
  
      ! Arg. The number of coordinates of x.
      integer, intent(inout), optional :: n
  
  #ifndef WOODS
  ! Rosenbrock's classic parabolic valley ("banana") function.
      real(DP) :: a
      real(DP) :: b
      real(DP) :: c
  
      funevals = funevals + 1
  
  