limit(sin(a/x)*x,x,inf),a=100 takes about 90 seconds on
a 1Ghz machine, whereas for a=5 it takes 0.1 seconds,
and for unbound a, it takes 0.4 sec.
I am guessing that limit calls trigexpand or some such,
leading to completely unnecessary blowup in the
intermediate results.
Logged In: YES
user_id=895922
Yes, it seems that limit calls trigexpand (I traced
trigexpand).
One observation: tlimit is very fast on this problem.
Is tlimit often better (faster, fewer bugs, ...)
than limit? I didn't know about tlimit for years
and I still forget about it.
Barton
Logged In: YES
user_id=28849
One workaround is to set trigexpandtimes:false. Then it's
very fast.
The function
lhospital
callsexpand-trigs
. Andexpand-trigs
callstrigexpand.
I commented out the call to
expand-trigs
inlhospital.
Additionally, I also eliminated the call totansc
Less drastically, the call to
tansc
could remain. Another idea would be to locally settrigexpandtimes
to false (as Raymond observed).My change didn't cause any problems with the testsuite, but my version of the limit code has a few other changes in it. Maybe others can try this experiment.