Function: math-sec-raw

math-sec-raw is a byte-compiled function defined in calc-math.el.gz.

Signature

(math-sec-raw X)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-math.el.gz
(defun math-sec-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-mul-float (math-sqr (car sc))
                                    (math-sqr sh))
                    (math-mul-float (math-sqr (cdr sc))
                                    (math-sqr ch)))))
	   (and (not (eq (nth 1 d) 0))
		(list 'cplx
		      (math-div-float (math-mul-float (cdr sc) ch) d)
		      (math-div-float (math-mul-float (car sc) sh) d)))))
	((eq (car x) 'polar)
	 (math-polar (math-sec-raw (math-complex x))))
	(t
	 (let ((cs (math-cos-raw x)))
           (if (eq cs 0)
               (math-div 1 0)
	     (math-div-float '(float 1 0) cs))))))