From: Raymond T. <rt...@us...> - 2002-01-22 02:31:16
|
Update of /cvsroot/maxima/maxima-pre59/src In directory usw-pr-cvs1:/tmp/cvs-serv1234/src Modified Files: limit.lisp Log Message: Replacement for the limit of tan functions. Use definition tan=sin/cos instead of complicated code. Index: limit.lisp =================================================================== RCS file: /cvsroot/maxima/maxima-pre59/src/limit.lisp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- limit.lisp 2002/01/09 20:46:37 1.3 +++ limit.lisp 2002/01/22 02:31:13 1.4 @@ -2491,6 +2491,7 @@ (SIMPLIFY (LIST (NCONS FN) (RIDOFAB ARG))) FN)))) +#+nil (DEFUN SIMPLIM%TAN (ARG) (let ((arg1 (ridofab (limit arg var val 'think)))) (COND @@ -2519,6 +2520,14 @@ ((equal arg1 -1) '$zerob) (t 0))) (t (SIMP-%TAN (LIST '(%TAN) ARG1) 1. NIL))))) + +;; Instead of the complicated implementation above, why not use the +;; fact that tan = sin/cos? Takes care of the bug that +;; limit(tan(x+%pi/4),x,0) doesn't return 1. +(defun simplim%tan (arg) + (simplimit `((mtimes simp) ((%sin simp) ,arg) + ((mexpt simp) ((%cos simp) ,arg) -1)) + var val)) (DEFUN SIMPLIM%ASINH (ARG) (COND ((MEMQ ARG '($INF $MINF $ZEROA $ZEROB $IND $UND)) |