vermaseren / form

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

SplitArg ((term)) #269

Open jodavies opened 6 years ago

jodavies commented 6 years ago

Hello,

I am using SplitArg ((ep)) f to separate terms which do and do not contain ep. This works fine apart from in one case: f(ep). Here it produces f(ep) rather than f(0,ep).

An example:

#-
Off Statistics;

Symbol x,ep;
CFunction f;

Local test = f(1) + f(ep) + f(2*ep) + f(x*ep) + f(ep^2);

SplitArg ((ep)) f;

Print +s;
.end

prints

   test =
       + f(ep)
       + f(0,2*ep)
       + f(0,ep^2)
       + f(0,x*ep)
       + f(1)
      ;

Thanks, Josh.

tueda commented 6 years ago

This behaviour is described in section 3.11 of the FORM 3 paper:

SplitArg,((j1)),den; take all terms in j1 separately id den(j1) = den1(0,j1); a single term does not get split

jodavies commented 6 years ago

OK, if this is somehow the desired behaviour I can make the same workaround.

Indeed, I use ((ep)) because it can appear with symbols, not just numbers.

Thanks, Josh.

Edit: Now that I think more about it, I have seen this construction a lot in summer, and have even used it myself in the past. Out of interest, in what situations is it desirable to have SplitArg behave like it does?