anchor.diff:  (in-package :cl-ipopt)
  +
  +(defun eval_f_lisp (x)
  +  (+ (* (aref x 0) (aref x 3) (+ (aref x 0) (aref x 1) (aref x 2))) (aref x 2)))
   
   (defcallback eval_f :int ((n :int) (x :pointer) (new_x :int) (obj_value :pointer))
     (assert (= n 4))
  
positive.code: 	;; Set some options
  	(addipoptnumoption nlp "tol" 1d-9)
  	(addipoptstroption nlp "mu_strategy" "adaptive")
  	;; Allocate space for initial point and set values
  	(setf (mem-aref x :double 0) 1d0
  	      (mem-aref x :double 1) 5d0
  
negative.code: 	(x1 (mem-aref x :double 1))
  	(x2 (mem-aref x :double 2))
  	(x3 (mem-aref x :double 3)))
      (setf (mem-ref obj_value :double) (eval_f_lisp (vector x0 x1 x2 x3))))
    1)
  
  (defcallback eval_grad_f :int ((n :int) (x :pointer) (new_x :int) (grad_f :pointer))
  