question / comments about sublis



Not that it matters all that much, but  sublis is potentially faster than 
subst:

sublis makes 2 calls to simplus & 12 to great:

(%i37) (untimer(), timer(?simplus,?great))$
(%i38) sublis([w=a, x=b,y=c,z=d], w + x + y + z)$

(%i39) timer_info();
(%o39) 
matrix([function,time//call,calls,runtime,gctime],[great,0,12,0,0],[simplus,0,2,0,0],[total,0,14,0,0])

subst makes 5 calls to simplus and 30 to great:

(%i41) (untimer(), timer(?simplus, ?great))$
(%i42) subst([w=a, x=b,y=c,z=d], w + x + y + z)$

(%i43) timer_info();
(%o43) 
matrix([function,time//call,calls,runtime,gctime],[great,0,30,0,0],[simplus,0,5,0,0],[total,0,35,0,0])

(1) When speed matters, I'd guess that ratsubst is faster than both,
(2) subst allows substitution of nonatoms, sublist doesn't --- so we're 
not comparing equals.

Barton