Question about simplification



On 3/25/2013 7:57 PM, Barton Willis wrote:
> Try:
>
> (%i1) load("opsubst")$
>
> (%i2) reduce_product_gamma(e) := block([l],
>    l : map('first, gatherargs(e,'gamma)),
>    l : sublist(l, lambda([s], not integerp(s))), /* can't happen 
> unless simp : false ? */
>    l : sort(l, lambda([a,b], orderlessp(b,a))), /* try to guess which 
> sub gives simplest result */
>    subst(map(lambda([s], gamma(s)*gamma(1-s)=%pi/sin(%pi*s)),l),e))$
>
> (%i3) reduce_product_gamma([12+gamma(a), gamma(a)*gamma(b), 
> 2*gamma(1/3)*gamma(-2/3)]);
> (%o3) [gamma(a)+12,gamma(a)*gamma(b),-3*gamma(1/3)^2]
>
> --Barton
> ------------------------------------------------------------------------
I should have mentioned
http://www.cs.berkeley.edu/~fateman/papers/partition.pdf
which suggests how to do things like partition terms in a sum or product
for easier handling (at least potentially). This can be used for building
some programs for simplification.

It looks like gatherargs does something similar.

RJF