optimize() function



The "optimize" function does much less than its name implies.  In
particular, in the case of n-ary operators, it does not take into
account associativity and commutativity at all -- it only looks for
common subtrees.

You could probably write a simple greedy algorithm which would give
decent (though not optimal) results.

Be careful, though: mathematical identities are not floating-point identities.

           -s



On Fri, Jan 23, 2009 at 6:07 AM, Bastian Pranzas <bastian at pranzas.com> wrote:
> Hi,
>
> I use maxima to find formulas I want to use in software development.
> It is pretty common, that I can bring my formulas to sums of products
> of serveral variables. To keep calculation time at a minimum I want to
> minimize the actual count of operations. I found that the optimize()
> function attempts to do what I want. But it is not very successful
> i.e. an expression like a*b*c+b*c*d, that contains the product b*c
> twice can not be optimized. Is there a way to do this with maxima? If
> not (sorry for being off-topic), does somebody know of a (free) CAS
> that can do this?