#! /bin/sh -x

math << \_EOF_

path="./"

Get[path<>"MB.m"];

Get[path<>"MBnumericsv2.m"];

(*
Kinematics for massive vertices with two massless external legs.
Examples from Fig.1, I.Dubovyk, A.Freitas, J.Gluza, T.Riemann and J.Usovitsch,
"The two-loop electroweak bosonic corrections to $\sin^2\theta^{b}_{eff}$",
Phys. Lett. B762 (2016), 184
doi:10.1016/j.physletb.2016.09.012, 
https://inspirehep.net/literature/1478370
*)

Clear[s1];
s1 = OpenWrite["res_zbb_fig1a_eucl"];

result = {};  

(*
invariants = {p1^2 -> 0, p2^2 -> 0, p1*p2 -> s/2};
invEucl = {MW -> Sqrt[0.78], MZ -> 1, s -> -1, MH -> Sqrt[1.88], 
   MT -> Sqrt[3.6]};
invMink = {MW -> Sqrt[0.78], MZ -> 1, s -> 1, MH -> Sqrt[1.88], 
   MT -> Sqrt[3.6]};
*)

(* some initial kinematic point in Euclidean region *)   
       kinRule2 = {s -> -1/100, MZ-> 1};
(* calculated kinematics *)
       kinRule = {MZ -> 1, s->-1};
       

MBanalytic={MBint[((MZ^2)^z1*Gamma[-z1]^3*Gamma[1 + z1]*Gamma[-z1 - z2]^3*Gamma[-z2]*Gamma[1 + z2]*Gamma[1 + z1 + z2])/
   ((-s)^z1*s*Gamma[1 - z1]^2*Gamma[1 - z2]*Gamma[-2*z1 - z2]), {{eps -> 0}, {z1 -> -0.5635754983749762, z2 -> -0.23729313220480758}}]};


<< MBsplits.m; 

       Do[restemp=RLstart[todo[[i]], kinRule, kinRule2, AccuracyGoal->3];
         
AppendTo[result, {{kinRule[[1]], kinRule[[2]]}, (Plus @@ (#[[1]] & /@ restemp[[1]])), Sqrt[Plus @@ (#[[2]]^2 & /@ restemp[[1]])]}];

,{i,Length[todo]}];
   

Write[s1,result];
Close[s1];

Exit[];

_EOF_

