On 1/1/2011 11:41 PM, Pouya D. Tafti wrote:..
...
> Other than that, would share/trigonometry/trgsmp.mac be a good example
> to follow for what I am trying to do?
>
> Thanks again,
> Pouya
Here's a suggestion.
Look at
http://www.cs.berkeley.edu/~fateman/papers/partition.pdf
Write a program gammasimp(p) which does the following
Given a product p= A*B*C...
collect, in a list L , all of the objects which look like
gamma(argument) for some argument.
for each e=gamma(z) in L, look for
gamma(z+1/2), gamma(z-1/2), gamma(1-z), etc.
if you find one of these, apply the appropriate substitution,
perhaps by ratsubst:
ratsubst(%pi/sin(%pi*z),gamma(z)*gamma(1-z), p);
If p is not a product, or does not contain any gammas,and is not atomic
you can recursively try to apply gammasimp on the subexpressions of p.
A separate program could convert factorials to gammas, or you could do
it all in
the same program, I suppose.
Returning special values for individual gamma functions, e.g.
gamma(1/2) is much
simpler than dealing with products of gammas.
Note that you may also want to look for powers of gamma, e.g.
gamma(z)*gamma(z-1)^(-1),
which would be gamma(z)/gamma(z-1) ...
RJF