vermaseren / form

The FORM project for symbolic manipulation of very big expressions
GNU General Public License v3.0
1.13k stars 135 forks source link

Introduce a prod_ function similar to sum_ #201

Open benruijl opened 7 years ago

benruijl commented 7 years ago

It would be nice to have a prod_ function, which behaves similarly to sum_.

prod_(i,1,3,f(i)) -> f(1)*f(2)*f(3)
tueda commented 3 years ago

Here is a FORM implementation with zero-dimensional tables:

* An implementation of prod(n,n1,n2,expr).
S n,n1,n2,x;
Table prod(n?symbol_,n1?int_,n2?int_,x?);
Table ident(x?);  * identity function
Fill prod() =
  + theta_(n2-n1) * prod(n,n1,n2-1,x) * ident(x * replace_(n,n2))
  + thetap_(n1-n2)
;
Fill ident() = x;
.sort

* Examples.

CF f;
S i;

L F1 = prod(i,3,6,i);
L F2 = prod(i,3,6,f(i));

P;
.end
   F1 =
      360;

   F2 =
      f(3)*f(4)*f(5)*f(6);