Function: calcFunc-sech

calcFunc-sech is an autoloaded and byte-compiled function defined in calc-math.el.gz.

Signature

(calcFunc-sech X)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-math.el.gz
(defun calcFunc-sech (x)   ; [N N] [Public]
  (cond ((eq x 0) 1)
	(math-expand-formulas
	 (math-normalize
	  (list '/ 2 (list '+ (list 'calcFunc-exp x)
                           (list 'calcFunc-exp (list 'neg x))))))
	((Math-numberp x)
	 (if calc-symbolic-mode (signal 'inexact-result nil))
	 (math-with-extra-prec 2
	   (let ((expx (math-exp-raw (math-float x))))
	     (math-div '(float 2 0) (math-add expx (math-div 1 expx))))))
	((eq (car-safe x) 'sdev)
	 (math-make-sdev (calcFunc-sech (nth 1 x))
			 (math-mul (nth 2 x)
                                   (math-mul (calcFunc-sech (nth 1 x))
                                             (calcFunc-tanh (nth 1 x))))))
	((and (eq (car x) 'intv) (math-intv-constp x))
	 (setq x (math-abs x))
	 (math-sort-intv (nth 1 x)
			 (calcFunc-sech (nth 2 x))
			 (calcFunc-sech (nth 3 x))))
	((or (equal x '(var inf var-inf))
	     (equal x '(neg (var inf var-inf))))
         0)
        ((equal x '(var nan var-nan))
         x)
	(t (calc-record-why 'numberp x)
	   (list 'calcFunc-sech x))))