Function: math-hyperbolic-trig-rewrite

math-hyperbolic-trig-rewrite is a byte-compiled function defined in calc-alg.el.gz.

Signature

(math-hyperbolic-trig-rewrite FN)

Documentation

Rewrite hyperbolic functions in terms of sinhs and coshs.

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-alg.el.gz
(defun math-hyperbolic-trig-rewrite (fn)
  "Rewrite hyperbolic functions in terms of sinhs and coshs."
  (cond
   ((not (consp fn))
    fn)
   ((eq (car-safe fn) 'calcFunc-sech)
    (list '/ 1 (cons 'calcFunc-cosh (math-hyperbolic-trig-rewrite (cdr fn)))))
   ((eq (car-safe fn) 'calcFunc-csch)
    (list '/ 1 (cons 'calcFunc-sinh (math-hyperbolic-trig-rewrite (cdr fn)))))
   ((eq (car-safe fn) 'calcFunc-tanh)
    (let ((newfn (math-hyperbolic-trig-rewrite (cdr fn))))
      (list '/ (cons 'calcFunc-sinh newfn)
            (cons 'calcFunc-cosh newfn))))
   ((eq (car-safe fn) 'calcFunc-coth)
    (let ((newfn (math-hyperbolic-trig-rewrite (cdr fn))))
      (list '/ (cons 'calcFunc-cosh newfn)
            (cons 'calcFunc-sinh newfn))))
   (t
    (mapcar #'math-hyperbolic-trig-rewrite fn))))