anchor.diff:  (defun maxima-to-lisp-string (maxima-string)
     "convert simplified maxima output string to lisp string"
     (let* ((*read-default-float-format* 'double-float)
  -	 (lisp-string (format nil "~a" (read-from-string maxima-string)))) ; fix Maxima output
  +	 ;; fix Maxima output & replace RAT with ratios
  +	 (lisp-string 
  +	  (rat-string-to-ratio
  +	   (princ-to-string (read-from-string maxima-string)))))
       (loop for (maxima lisp) in *maxima-lisp-table-string*
          do (setq lisp-string
   		(regex-replace-all (format nil "\\(~a( SIMP)?( RATSIMP)?\\)" maxima) lisp-string lisp)))
  
positive.code:     (%sqrt sqrt)
      (%sinh sinh)
      (%cosh cosh)
      (%atan atan)
      (%atan2 atan2)
      (%signum signum)
      (%max max))
    "lookup table of maxima > lisp expressions")
  
  (defmethod atan2 ((n1 number)(n2 number))
  
negative.code:   "Delay simplification of a block of code"
    `(let ((bld-maxima::*delay* t))
       ,@body))
  
  (defun simplify-lisp-expr (lexpr &optional (simpfun '$ev))
    "Simplify a lisp expression using socket to Maxima"
    (let* ((mstring (lisp-to-maxima-string (princ-to-string lexpr)))
  	 (lfuns (match-lisp-funs mstring))
  	 (rfuns (loop for lfun in lfuns
  		   collect (princ-to-string (gensym)))))
      (read-from-string
       (maxima-to-lisp-string
        (re-rename-lisp-funs
         (princ-to-string
  	(second
  	 (maxima-send-lisp
  	  (format nil "(mfuncall '~a '~a)"
  		  simpfun
  		  (rename-lisp-funs mstring lfuns rfuns)))))
         lfuns rfuns)))))
  
  (defun simp (lexpr &optional (simpfun '$ev))
    "Simplify a lisp math expression using specified Maxima
  simplification function. Just return the expression if *DELAY* is T."
    (if *delay* lexpr (simplify-lisp-expr lexpr simpfun)))
  
  (defun trigreduce (lexpr)
    (simp lexpr '$trigreduce))
  
  (defun trigexpand (lexpr)
    (simp lexpr '$trigexpand))
  
  (defun trigsimp (lexpr)
    (simp lexpr '$trigsimp))
  
  (defun trigrat (lexpr)
    (simp lexpr '$trigrat))
  