#! /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_fig1c_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[(Gamma[-z2]^2*Gamma[-z3]^2*Gamma[-z1 + z3]^2*Gamma[-1 - z1 - z4]*Gamma[-1 - z1 - z2 - z4]*Gamma[-1 - z1 - z2 + z3 - z4]*
    Gamma[-z4]*Gamma[1 + z4]*Gamma[1 + z2 + z4]*Gamma[2 + z1 + z2 + z4]*Gamma[1 + z1 - z3 + z4])/
   (s^2*(-(s/MZ^2))^z1*Gamma[-z1]^2*Gamma[-z2 - z3]*Gamma[-z1 - z2 + z3]), 
  {{eps -> 0}, {z1 -> -0.970582481818209, z2 -> -0.3947805149837126, z3 -> -0.30380750969543907, z4 -> -0.24334775906002817}}]};

<< MBsplits.m; 

       Do[restemp=RLstart[todo[[i]], kinRule, kinRule2, AccuracyGoal->5];
         
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_

