   (outputf terminate?
            "f = % .8e, |grad| = % .8e, |dx| = % .8e%n"
            :value
-           (comp m/magnitude force :gradient)
+           (comp m/magnitude :gradient)
            (fn [state]
              (if-not (:initial-step state)
-               (m/magnitude (force (:last-step state)))
+               (m/magnitude (:last-step state))
                Double/NaN))))
 
 (defn pause

      optimiser
      initial-params
      (fn [state]
        (swap! log* conj (util/map-vals force state))
        (terminate? state)))
    @log*))


  [terminate? cutoff]
  (fn [state]
    (or (terminate? state)
        (<= (:value state)
            cutoff))))

(defn limit-gradient
  [terminate? cutoff]
  (fn [state]
    (or (terminate? state)
        (<= (m/magnitude (:gradient state))
            cutoff))))

;;;; I/O
