Bug # 535363 and using polynomialp



Hi!

I'm trying to get better at both lisp and maxima, and thought that
looking at some of the ancient bugs on sourceforge might help me.

For this one, rtoy suggests:

"Alternatively, we could make L'Hopital check to see if the
numerator or denominator is a polynomial and change the
limit appropriately."

which I think is a good idea, so I was looking at limit.lisp and
finally worked out the calling structure of limit2 down to lhospital. I
thought a logical thing to do might be to have another global variable,
$lhospitalpolylim, which would be bigger by default than $lhospitallim.

When lhospital-catch got hold of a numerator/denominator pair for the
first time, it would test to see whether the denominator was a
polynomial in the variable that was tending to wherever. If so, it
would allow $lhospitalpolylim iterations instead of $lhospitallim
iterations if $lhospitalpolylim was bigger than the degree of the
polynomial. This would be absolutely sure to finish happily.

Thoughts:
 - There should still be an upper limit even if there's a poly
underneath, as the top might get arbitrarily horrible, so you don't
want to be calling limit2 1000 times for example.
 - This idea could be extended if there's some nice way of telling
what the behaviour of the denominator under repeated differentiation
is. I don't know whether that is easily doable.

HOWEVER:

Clearly to implement this, I'd need to test whether the denominator
was a polynomial. This is trivial with polynomialp, I think, but I
wanted to check:

a) Whether the whole idea was a waste of time anyway
b) Whether people were averse to having the linear algebra package
pulled into limit.lisp

and if so

c) Whether there was another approach - polynomialp looks rather
overly clever for what this would need.



Any suggestions? 

Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 307 bytes
Desc: not available
Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20070921/986c1491/attachment.pgp