Am Montag, den 07.12.2009, 23:05 +0100 schrieb Dieter Kaiser:
I have replaced the function intersection with the following
implementation:
(defun not-freeof-infinities-p (expr)
(let ((flag nil))
(dolist (sym '($inf $minf $infinity $ind $und))
(if (member sym expr :test #'eq)
(return (setq flag t))))
flag))
This functions seems to be somewhat more efficient than the function
intersection. These are the results for one of the examples:
(%i2) qq: ratsimp((x^50000-1)/(x-1))$
Evaluation took 2.1121 seconds (2.1806 elapsed) using 7.631 MB.
We test the expressions to be free of infinities:
(%i3) for i thru 1000 do qq:qq+1$
Evaluation took 22.4814 seconds (22.5831 elapsed) using 381.737 MB.
(%i4) for i thru 1000 do qq:qq+1$
Evaluation took 22.4614 seconds (22.5891 elapsed) using 381.737 MB.
(%i5) for i thru 1000 do qq:qq+1$
Evaluation took 22.2574 seconds (22.3724 elapsed) using 381.737 MB.
We switch off the test:
(%i6) for i thru 1000 do qq:qq+1,simpinfinities:false$
Evaluation took 22.3414 seconds (22.7901 elapsed) using 381.738 MB.
(%i7) for i thru 1000 do qq:qq+1,simpinfinities:false$
Evaluation took 22.3614 seconds (22.4699 elapsed) using 381.738 MB.
(%i8) for i thru 1000 do qq:qq+1,simpinfinities:false$
Evaluation took 22.4134 seconds (22.5303 elapsed) using 381.738 MB.
I do not get a significant increase of the runtime of the testsuite with
this implementation.
Dieter Kaiser