(defun gr2 (x)
  (+ 2 (* 3 (first x)) (- (expt (first x) 2))))

(new-fitness-function 'gr2 (make-instance 'ga-function 
                             :fitness-function 'gr2 
                             :lower-bound 0.0
                             :upper-bound 4
                             :min-f -2.0
                             :max-f 2.0))