|
From: Daniel V. <dan...@ya...> - 2025-10-22 06:47:06
|
Hi Barton,
I don't know if this will help you or not but I'm running the same testsin Maxima "5.38.1" (I know, it's old) in Windows 10 (I know, it's old)and I get very different results:
fpprintprec:5$
timer(?simpprod)$
xxx : product(f(i),i,1,∞)$
xxx : subst(f(i) = product(g(k),k,1,∞), xxx)$
timer_info();
matrix([function,time\/\/call,calls,runtime,gctime], [simpprod,0.0013867*sec,3098,4.296*sec,0], [total,0.0013867*sec,3098,4.296*sec,0])
:lisp(defun infsimp (e) e);
WARNING: redefining MAXIMA::INFSIMP in DEFUN INFSIMPxxx : product(f(i),i,1,∞)$
xxx : subst(f(i) = product(g(k),k,1,∞), xxx)$
timer_info();
matrix([function,time\/\/call,calls,runtime,gctime], [simpprod,0.0013775*sec,3256,4.485*sec,0], [total,0.0013775*sec,3256,4.485*sec,0])
xxx : product(product(product(g(k),k,1,∞),m,1,∞),s,1,∞)$
:lisp(print $xxx)
((%PRODUCT) ((%PRODUCT SIMP) ((%PRODUCT SIMP) (($G SIMP) $K) $K 1 $INF) $M 1 $INF) $S 1 $INF) ((%PRODUCT) ((%PRODUCT SIMP) ((%PRODUCT SIMP) (($G SIMP) $K) $K 1 $INF) $M 1 $INF) $S 1 $INF)
Daniel Volinski
En martes, 21 de octubre de 2025, 23:06:44 GMT+3, Barton Willis via Maxima-discuss <max...@li...> escribió:
#yiv4441728438 P {margin-top:0;margin-bottom:0;}Last observation for now:
(%i1) xxx : product(product(product(g(k),k,1,inf),m,1,inf),s,1,inf)$
(%i2) :lisp(print $xxx)((%PRODUCT) ((%PRODUCT) ((%PRODUCT SIMP) (($G SIMP) $K) $K 1 $INF) $M 1 $INF) $S 1 $INF)
The outer two products are not marked as simplified, but the inner product is simplified.
--BartonFrom: Barton Willis <wi...@un...>
Sent: Tuesday, October 21, 2025 12:11 PM
To: <max...@li...> <max...@li...>; Barton Willis <wi...@un...>
Subject: Re: modest calculation that calls infsimp 2.4 million times <!--#yiv4441728438 p {margin-top:0;margin-bottom:0;}-->
(%i2) timer(?simpprod);(%o2) [simpprod](%i3) xxx : product(f(i),i,1,inf)$(%i4) xxx : subst(f(i) = product(g(k),k,1,inf), xxx)$(%i5) timer_info();(%o5) matrix( [function, time\/call, calls, runtime, gctime], [simpprod, 1.4972326095270472*10^-4*sec, 47066, 7.046875*sec, 0], [total, 1.4972326095270472*10^-4*sec, 47066, 7.046875*sec, 0] )
Over 47,000 calls to simpprod is crazy. Let's try this again, but define infsimp to be the identity fumction:
(%i1) timer(?simpprod);(%o1) [simpprod](%i2) :lisp(defun infsimp (e) e);INFSIMP(%i2) xxx : product(f(i),i,1,inf)$(%i3) xxx : subst(f(i) = product(g(k),k,1,inf), xxx)$(%i4) timer_info();(%o4) matrix( [function, time\/call, calls, runtime, gctime], [simpprod, 4.222972972972973*10^-4*sec, 74, 0.03125*sec, 0], [total, 4.222972972972973*10^-4*sec, 74, 0.03125*sec, 0] )
Now only 74 calls to simpprod—that's too many, I think, but it's better than 47,000.From: Barton Willis via Maxima-discuss <max...@li...>
Sent: Monday, October 20, 2025 9:21 AM
To: <max...@li...> <max...@li...>
Subject: [Maxima-discuss] modest calculation that calls infsimp 2.4 million times <!--#yiv4441728438 p {margin-top:0;margin-bottom:0;}-->
| | Caution: Non-NU Email |
If you all are looking for a puzzle that is possibly more fun than Sudoko or Queens, figure out whyinfsimp is called over 2.4 million times to do the following modest calculation:
(%i1) timer(?infsimp)$
(%i2) xxx : product(f(i),i,1,inf)$
(%i3) xxx : subst(f(i) = product(g(k),k,1,inf), xxx)$
(%i4) xxx : subst(g(k) = product(w(m),m,1,inf), xxx)$
(%i5) timer_info();(%o5) matrix( [function, time\/call, calls, runtime, gctime], [infsimp, 6.329070747905959*10^-5*sec, 2400382, 151.921875*sec, 0], [total, 6.329070747905959*10^-5*sec, 2400382, 151.921875*sec, 0] )
I haven't tried to figure this out.
--Barton_______________________________________________
Maxima-discuss mailing list
Max...@li...
https://lists.sourceforge.net/lists/listinfo/maxima-discuss
|