#! /bin/sh -x


math << \_EOF_

path="./"

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

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

(*
Kinematics for massive 1-loop QED vertex, a difficult case, 
see Section 3.1 in 
I.Dubovyk, J.Gluza, T.Riemann and J.Usovitsch,
"Numerical integration of massive two-loop Mellin-Barnes integrals in Minkowskian regions",
PoS LL2016 (2016), 034
doi:10.22323/1.260.0034
https://inspirehep.net/literature/1478053
*)

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

result = {};  

(*
invariants = {p1^2 -> m^2, p2^2 -> m^2, p1*p2 -> -m^2 + s/2};
invEucl = {m->1, s->1};
invMink = {m->1, s->-1};
*)

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

MBanalytic={MBint[((m^2)^z1*(-s)^(-1 - z1)*Gamma[-z1]^3*Gamma[1 + z1])/(2*Gamma[-2*z1]), {{eps -> 0}, {z1 -> -0.8950748276800662}}]};
           
<< 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_

