While it is nice of you to try to improve the limit program, I think that a
more systematic approach would be better.
Here's a suggestion.
1. define a class of limit problems that are not solved properly by the
existing program. (either wrong answer or very slow).
2. design an algorithm that will solve those problems, and explain (maybe
prove) that it is correct.
3. write the algorithm in detail, with comments, test and time it, comparing
it to the previous one.
It is also possible to set up a program so that it is called only when the
built-in limit program returns unevaluated (that is, lim(...) is returned).
If the built-in limit program returns incorrect results, then I think there
are 3 ways to repair it. (a) intercept the arguments that cause bad answers
and use a different method, (b) find the bug in the program and fix it,
or (c) you could replace the whole program with a new and better one.
Good luck!!
RJF
> -----Original Message-----
> From: maxima-bounces at math.utexas.edu [mailto:maxima-
> bounces at math.utexas.edu] On Behalf Of miguel lopez
> Sent: Friday, December 22, 2006 6:41 AM
> To: maxima at math.utexas.edu
> Subject: Re: [Maxima] infinitesimal limit wizard
>
> Stavros Macrakis <macrakis <at> alum.mit.edu> writes:
> Can you show that your result is
> > correct?
> >
> > -s
> > This is the source code, I think is simple enough to understand, it can
> be
> improved easily. But is not tested, I have done it this morning, perhaps
> I can
> document the code.
>
>
>
> h(x):= block([re],re:g(x), if re=false then x else re);
>
>
>
> lst1:[sin,asin,sinh,tan,atan,tanh];
> lst2:[cos,cot];
>
>
> inflag:true;
> var:x;
> x0:0;
>
>
>
>
> g(x):=block([o,a,re],
> if atom(x) then return(x),
> o: op(x),u:args(x)[1],
> if o ="^" then
> (re:g(u), if re = false then return(x) else return
> (re^args(x)[2])),
> if op(x)="*" then return(map(h,x)),
> if member(o,lst1) then return(try(u)),
> if member(o,lst2) then return(try(%pi/2 - u)),
> if o='log then return(try(u-1)) else return(x));
>
>
>
> try(a):= block([ga],ga:g(a),
> if ga # a then return (g(ga)),
> if limit(a,var,x0)=0 then pr(a) else false);
>
>
>
>
> pr(f):= block([re],re: first(ratdisrep(taylor(f,var,x0,20))),
> if (re # 0) then re else f);
>
>
>
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima