limits of signum expressions



Am Mittwoch, den 03.02.2010, 06:35 -0600 schrieb Barton Willis:

> (setf (get '%signum 'simplim%function) 'simplim%signum)
> 
> (defun simplim%signum (e x pt)
>   (let* ((e (limit (cadr e) x pt 'think)) (sgn (mnqp e 0)))
>     (cond ((eq t sgn) (take '(%signum) e)) ;; limit of argument of signum
>    is not zero
>    ((eq nil sgn) '$und)             ;; limit of argument of signum is zero
>    (noncontinuous)
>    (t (throw 'limit nil)))))        ;; don't know

At first I was not sure about the last line of your code. The first time
I introduced a simplim%function I thought it is the best to return
always a simplified expression, e.g. a noun form, when nothing is known
about the limit. But I have not studied this point in detail again. To
throw 'limit might be even better.

By the way: Functions which are undefined for specific values have to
use the function simp-domain-error and not the function domain-error to
throw an error. This way the limit for the specific values will work. It
is one of the main tasks of a simplim%function to handle such specific
values, e.g. 

(%i8) expintegral_ei(0);
expintegral_ei: expintegral_ei(0) is undefined.
 -- an error. To debug this try: debugmode(true);

The correct limit is handled in a simplim%function:

(%i10) limit(expintegral_ei(x),x,0);
(%o10) minf

Dieter Kaiser