The functions U and F for the following formula (alpha-representation of Feynman integrals)
can be generated by the simple Mathematica code:
UF[xx_, yy_, z_] := Module[{degree, coeff, i, t2, t1,
t0, zz},
zz = Map[Rationalize[##,0]&, z, {0, Infinity}];
degree = -Sum[yy[[i]]*x[i], {i, 1, Length[yy]}];
coeff = 1;
For[i = 1, i <= Length[xx], i++,
t2 = Coefficient[degree, xx[[i]], 2];
t1 = Coefficient[degree, xx[[i]], 1];
t0 = Coefficient[degree, xx[[i]], 0];
coeff = coeff*t2;
degree = Together[t0 - ((t1^2)/(4
t2))];
];
degree = Together[-coeff*degree] //. zz;
coeff = Together[coeff] //. zz;
{coeff, Expand[degree], Length[xx]}
]
where xx is the set of loop momenta, yy is the set of propagators and z is the set of replacements.
For example, for the same 2-loop tadpole with 2 massive lines and 1 massless line one can genarate U and F by
UF[{v, q}, {v^2 - mm, q^2 - mm, (v - q)^2}, {mm -> 1}]