> > Well, if you just need to minimize the total number of operations,
> > then I think factor() is all you need. If you want to introduce some
> > metric (ie. + has cost 1, * has cost 2, power has cost 5) then this
> > can be done too but it is some work...
>
> It would be enough to just minimize the count of the operations. But
> factor() only does this for factors of the whole expression, so it
> doesn't do what I need in something like a*b*c+b*c*d+a
Maybe facsum will be useful:
(%i4) i : a*b*c+b*c*d+a$
(%i8) facsum(i,b);
(%o8) b*c*(d+a)+a
Of course, all this could be automated, but maybe this will work for you.
Barton