Function: math-cot-raw

math-cot-raw is an autoloaded and byte-compiled function defined in calc-math.el.gz.

Signature

(math-cot-raw X)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-math.el.gz
(defun math-cot-raw (x)   ; [N N]
  (cond ((eq (car x) 'cplx)
	 (let* ((x (math-mul x '(float 1 0)))
                (expx (math-exp-raw (nth 2 x)))
		(expmx (math-div-float '(float 1 0) expx))
                (sh (math-mul-float (math-sub-float expx expmx) '(float 5 -1)))
                (ch (math-mul-float (math-add-float expx expmx) '(float 5 -1)))
		(sc (math-sin-cos-raw (nth 1 x)))
		(d (math-add-float
                    (math-sqr (car sc))
                    (math-sqr sh))))
	   (and (not (eq (nth 1 d) 0))
		(list 'cplx
		      (math-div-float
                       (math-mul-float (car sc) (cdr sc))
                       d)
                      (math-neg
                       (math-div-float
                        (math-mul-float sh ch)
                        d))))))
	((eq (car x) 'polar)
	 (math-polar (math-cot-raw (math-complex x))))
	(t
	 (let ((sc (math-sin-cos-raw x)))
	   (if (eq (nth 1 (car sc)) 0)
	       (math-div (cdr sc) 0)
	     (math-div-float (cdr sc) (car sc)))))))