(* ::Package:: *)

Print["Package TMDmatching contains the set of functions related to the TMD small-bT matching"];
Print["Uses package AlphaStrong"];
Print["REQUARES MSTW package and preloaded grids! They are used as input for the convoluitons."]
Print["Contains the following functions: CxF, CxFexp, CxFrenormalon, CxFrenormalonExp"];
Print["Copyright: Alexey Vladimirov, Regensburg University. Version 1.201 (8 Sep. 2016)"];
Print["___________________________________________________________________________"];

BeginPackage["TMDmatching`",{"AlphaStrong`","mstwpdf`"}];
CxF::usage="CxF[n_,f_,type_,x_,bt_,\[Mu]_] is the leading order of the small-bT expansion for unpolirized TMD PDF.
It is defined as \!\(\*SubscriptBox[\(C\), \(q \[LeftArrow] f\)]\)(bt,\[Mu])\[CircleTimes]\!\(\*SubscriptBox[\(q\), \(f\)]\))[x,\[Mu]].
The function uses MSTW2008 PDF as input.
n -- pertrubative order of coefficient function,
f -- parton flavour, defined as in MSTW2008, i.e. (-3,-2,-1,0,1,2,3)\[Rule] (sbar,ubar,dbar,gluon,d,u,s)
type -- defines inclusion or exclusion of parton mixture, \"direct\" no parton mixture terms, \"withMIX\" all terms, \"onlyMIX\" only mixture terms.
x, bt, \[Mu] -- usual TMD variables.
Function CxF[n_,f_,x_,bt_,\[Mu]_] evaluates matching without mixing. 
NOTE: parameter \[Zeta] is set to \[Zeta]b (i.e. the \[Zeta]-logarithms exponentiated out), NF=3 for all coefficeints, for \!\(\*SubscriptBox[\(\[Alpha]\), \(s\)]\) we take 2-loop definition irrespective pertrubtive order.
ANOTHER NOTE: we use PrecisionGoal\[Rule]5, since it speeds up the calculation, but far within errorband.
";
CxFexp::usage="CxFexp[n_,f_,type_,x_,bt_,\[Mu]_,g_] is the leading order of the small-bT expansion for unpolirized TMD PDF with exponential factor.
It is defined as \!\(\*SubscriptBox[\(C\), \(q \[LeftArrow] f\)]\)(bt,\[Mu])Exp[-x g \!\(\*SuperscriptBox[\(bt\), \(2\)]\)]\[CircleTimes]\!\(\*SubscriptBox[\(q\), \(f\)]\))[x,\[Mu]].
The function uses MSTW2008 PDF as input.
n -- pertrubative order of coefficient function,
f -- parton flavour, defined as in MSTW2008, i.e. (-3,-2,-1,0,1,2,3)\[Rule] (sbar,ubar,dbar,gluon,d,u,s)
type -- defines inclusion or exclusion of parton mixture, \"direct\" no parton mixture terms, \"withMIX\" all terms, \"onlyMIX\" only mixture terms.
x, bt, \[Mu] -- usual TMD variables.
g is the parameter of the exponent.
Function CxFexp[n_,f_,x_,bt_,\[Mu]_,g_] evaluates matching without mixing. 
NOTE: parameter \[Zeta] is set to \[Zeta]b (i.e. the \[Zeta]-logarithms exponentiated out), NF=3 for all coefficeints, for \!\(\*SubscriptBox[\(\[Alpha]\), \(s\)]\) we take 2-loop definition irrespective pertrubtive order.
ANOTHER NOTE: we use PrecisionGoal\[Rule]5, since it speeds up the calculation, but far within errorband.
";
CxFrenormalon::usage="CxFrenormalon[f_,x_,bt_,\[Mu]_,\[CapitalLambda]_] is the leading renormalon contribution to the quark TMD, without NUMERIC prefactor
It is defined as \!\(\*SuperscriptBox[\(bt\), \(2\)]\)\!\(\*SuperscriptBox[\(\[CapitalLambda]\), \(2\)]\) \!\(\*SubscriptBox[\(C\), \(renormalon\)]\)\[CircleTimes] q.
The function uses MSTW2008 PDF as input.
f -- parton flavour (can be only quark, or anti quark), defined as in MSTW2008, i.e. (-3,-2,-1,0,1,2,3)\[Rule] (sbar,ubar,dbar,gluon,d,u,s)
x, bt, \[Mu] -- usual TMD variables.
\[CapitalLambda] is the position of Landau pole, to which the divergent series summed. If not specified the 2-loop \[CapitalLambda]QCD from the package AlphaStrong is used.";
CxFrenormalonExp::usage="CxFrenormalonExp[f_,x_,bt_,\[Mu]_,\[CapitalLambda]_,g1_,g2_] is the leading renormalon contribution to the quark TMD, without NUMERIC prefactor, with the extra expoenential
It is defined as \!\(\*SuperscriptBox[\(bt\), \(2\)]\)g1(\*SubscriptBox[\(C\), \(renormalon\)]\)Exp[-x g2 \!\(\*SuperscriptBox[\(bt\), \(2\)]\)] \[CircleTimes] q.
The discripancy of parameters is taken into account within the renormalon mathing.
The function uses MSTW2008 PDF as input.
f -- parton flavour (can be only quark, or anti quark), defined as in MSTW2008, i.e. (-3,-2,-1,0,1,2,3)\[Rule] (sbar,ubar,dbar,gluon,d,u,s)
x, bt, \[Mu] -- usual TMD variables.
\[CapitalLambda] is the position of Landau pole, to which the divergent series summed. If not specified the 2-loop \[CapitalLambda]QCD from the package AlphaStrong is used.";


Begin["`Private`"];


(*quark convolutions*)
(*LO q<-q*)
Fqq[0,f_,x_,bt_,\[Mu]_]:=xf[0,x,\[Mu],f]/x
(*NLO q<-q*)
Fqq[1,f_,x_,bt_,\[Mu]_]:=1/x Module[{L\[Mu]=2Log[\[Mu] bt]-0.23186303131682484`},
NIntegrate[(16 L\[Mu])/(3 (-1+z)) (xf[0,x/z,\[Mu],f]-xf[0,x,\[Mu],f])+(8/3 (1+L\[Mu]-z+L\[Mu] z))xf[0,x/z,\[Mu],f],{z,x,1},PrecisionGoal->5]
-xf[0,x,\[Mu],f] 16/3 L\[Mu] Log[1-x]
+(-(2/9) (-6 L\[Mu]^2+\[Pi]^2))xf[0,x,\[Mu],f]]
(*NLO q<-!q*)
FqqMIX[1,f_,x_,bt_,\[Mu]_]:=1/x Module[{L\[Mu]=2Log[\[Mu] bt]-0.23186303131682484`},
NIntegrate[(-2 (-1+z) z+L\[Mu] (-1+2 z-2 z^2))xf[0,x/z,\[Mu],0],{z,x,1},PrecisionGoal->5]]
(*NNLO q<-q*)
Fqq[2,f_,x_,bt_,\[Mu]_]:=1/x Module[{L\[Mu]=2Log[\[Mu] bt]-0.23186303131682484`},
NIntegrate[1/(-1.`+z) 0.07407407407407407` (-4.` (-106.37750939432664`+ 124.86870317603413` L\[Mu]+81.` L\[Mu]^2+24.` L\[Mu]^3-96.` L\[Mu]^2 Log[1.`\[VeryThinSpace]-1.` z]) xf[0,x,\[Mu],f]+(-202.36561810763305`+ 549.7374063520683` L\[Mu]+210.` L\[Mu]^2+48.` L\[Mu]^3-136.17626406536147` z-600.` L\[Mu] z-96.` L\[Mu]^2 z-202.36561810763305` z^2+549.7374063520683` L\[Mu] z^2+210.` L\[Mu]^2 z^2+48.` L\[Mu]^3 z^2-197.39208802178717` Log[1.`\[VeryThinSpace]-1.` z]+192.` L\[Mu] Log[1.`\[VeryThinSpace]-1.` z]-192.` L\[Mu]^2 Log[1.`\[VeryThinSpace]-1.` z]-60.` z Log[1.`\[VeryThinSpace]-1.` z]-384.` L\[Mu] z Log[1.`\[VeryThinSpace]-1.` z]-137.39208802178717` z^2 Log[1.`\[VeryThinSpace]-1.` z]+192.` L\[Mu] z^2 Log[1.`\[VeryThinSpace]-1.` z]-192.` L\[Mu]^2 z^2 Log[1.`\[VeryThinSpace]-1.` z]+48.` Log[z]+156.` L\[Mu] Log[z]+48.` L\[Mu]^2 Log[z]+192.` z Log[z]+168.` z^2 Log[z]+204.` L\[Mu] z^2 Log[z]+144.` L\[Mu]^2 z^2 Log[z]+72.` Log[1.`\[VeryThinSpace]-1.` z] Log[z]-192.` L\[Mu] Log[1.`\[VeryThinSpace]-1.` z] Log[z]-144.` z Log[1.`\[VeryThinSpace]-1.` z] Log[z]+72.` z^2 Log[1.`\[VeryThinSpace]-1.` z] Log[z]-192.` L\[Mu] z^2 Log[1.`\[VeryThinSpace]-1.` z] Log[z]+72.` Log[1.`\[VeryThinSpace]-1.` z]^2 Log[z]+72.` z^2 Log[1.`\[VeryThinSpace]-1.` z]^2 Log[z]+9.` Log[z]^2+60.` L\[Mu] Log[z]^2+60.` z Log[z]^2+21.` z^2 Log[z]^2+156.` L\[Mu] z^2 Log[z]^2-48.` Log[1.`\[VeryThinSpace]-1.` z] Log[z]^2-48.` z^2 Log[1.`\[VeryThinSpace]-1.` z] Log[z]^2+10.` Log[z]^3+26.` z^2 Log[z]^3+24.` (-1.` (-1.`+z)^2+5.` (1.`\[VeryThinSpace]+z^2) Log[1.`\[VeryThinSpace]-1.` z]-3.` (1.`\[VeryThinSpace]+z^2) Log[z]) PolyLog[2.`,z]+120.` (1.`\[VeryThinSpace]+z^2) PolyLog[3.`,1.`\[VeryThinSpace]-1.` z]+48.` PolyLog[3.`,z]+48.` z^2 PolyLog[3.`,z]) xf[0,x/z,\[Mu],f]),{z,x,1},PrecisionGoal->5]
+8/27 Log[1-x] xf[0,x,\[Mu],f] (-348-L\[Mu] (342+3 L\[Mu] (27+8 L\[Mu])-22 \[Pi]^2)+48 L\[Mu]^2 Log[1-x]+378 Zeta[3])
+(4 L\[Mu]^3+(8 L\[Mu]^4)/9+L\[Mu]^2 (76/3-4 \[Pi]^2)+1/81 (-513 \[Pi]^2+20 \[Pi]^4+84 (50-27 Zeta[3]))+L\[Mu] (464/9-4 \[Pi]^2-56 Zeta[3]))xf[0,x,\[Mu],f]]
(*NNLO q<-!q*)
FqqMIX[2,f_,x_,bt_,\[Mu]_]:=1/x Module[{L\[Mu]=2Log[\[Mu] bt]-0.23186303131682484`},
NIntegrate[(0.05555555555555555` (24.` L\[Mu]^3 (1.`\[VeryThinSpace]+2.` (-1.`+z) z)-30.` z (-3.`+ 4.` z) Log[1.`\[VeryThinSpace]-1.` z]+60.` (-1.`+z) z Log[1.`\[VeryThinSpace]-1.` z]^2+10.` (1.`\[VeryThinSpace]+2.` (-1.`+z) z) Log[1.`\[VeryThinSpace]-1.` z]^3-2.` (-7.`- 22.` z+8.` z^2) Log[z]^3-1/z 6.` L\[Mu]^2 (-12.`+ 5.` z+8.` L\[Mu] z-96.` z^2-16.` L\[Mu] z^2+109.` z^3+16.` L\[Mu] z^3+z (-26.`+ 52.` z-52.` z^2) Log[1.`\[VeryThinSpace]-1.` z]+z (-14.`- 80.` z+16.` z^2) Log[z])-3.` Log[z]^2 (7.`\[VeryThinSpace]-60.` z+148.` z^2+(8.`\[VeryThinSpace]-160.` z+16.` z^2) Log[1.`\[VeryThinSpace]-1.` z]+(-18.`- 36.` z-36.` z^2) Log[1.`\[VeryThinSpace]+z])+4.` Log[z] (106.73920880217872`\[VeryThinSpace]-262.13129682396584` z+219.47841760435745` z^2+z (-24.`+ 24.` z) Log[1.`\[VeryThinSpace]-1.` z]+(6.`\[VeryThinSpace]-12.` z+12.` z^2) Log[1.`\[VeryThinSpace]-1.` z]^2+z (54.`\[VeryThinSpace]+54.` z) Log[1.`\[VeryThinSpace]+z]+(-27.`- 54.` z-54.` z^2) Log[1.`\[VeryThinSpace]+z]^2)+1/z (344.`\[VeryThinSpace]-454.23229472795197` z+1388.5441333514486` z^2-559.5940838297593` z^3+z (-177.65287921960845`- 355.3057584392169` z-355.3057584392169` z^2) Log[1.`\[VeryThinSpace]+z]+z (36.`\[VeryThinSpace]+72.` z+72.` z^2) Log[1.`\[VeryThinSpace]+z]^3)+1/z 12.` (-12.`+ 18.` z-72.` z^2+66.` z^3+z (-5.`+ 10.` z-10.` z^2) Log[1.`\[VeryThinSpace]-1.` z]+z (-4.`+ 44.` z-8.` z^2) Log[z]) PolyLog[2.`,1.`\[VeryThinSpace]-1.` z]+18.` (12.` z (1.`\[VeryThinSpace]+z)-6.` (1.`\[VeryThinSpace]+2.` z (1.`\[VeryThinSpace]+z)) Log[z]) PolyLog[2.`,-1.` z]+1/z 4.` L\[Mu] (-78.`+ 97.3480220054468` z-128.04316479128514` z^2+24.` L\[Mu] z^2+278.6960440108936` z^3-24.` L\[Mu] z^3+z (15.`\[VeryThinSpace]-30.` z+30.` z^2) Log[1.`\[VeryThinSpace]-1.` z]^2-33.` z Log[z]+48.` z^2 Log[z]-444.` z^3 Log[z]+21.` z Log[z]^2+66.` z^2 Log[z]^2-24.` z^3 Log[z]^2+z Log[1.`\[VeryThinSpace]-1.` z] (z (-48.`+ 48.` z)+(24.`\[VeryThinSpace]-48.` z+48.` z^2) Log[z])+54.` z Log[z] Log[1.`\[VeryThinSpace]+z]+108.` z^2 Log[z] Log[1.`\[VeryThinSpace]+z]+108.` z^3 Log[z] Log[1.`\[VeryThinSpace]+z]+z (54.`\[VeryThinSpace]+108.` z+108.` z^2) PolyLog[2.`,-1.` z])+60.` (1.`\[VeryThinSpace]+2.` (-1.`+z) z) PolyLog[3.`,1.`\[VeryThinSpace]-1.` z]+108.` (1.`\[VeryThinSpace]+2.` z (1.`\[VeryThinSpace]+z)) PolyLog[3.`,-1.` z]-48.` (1.`\[VeryThinSpace]-20.` z+2.` z^2) PolyLog[3.`,z]-216.` (1.`\[VeryThinSpace]+2.` z (1.`\[VeryThinSpace]+z)) PolyLog[3.`,z/(1.`\[VeryThinSpace]+z)]))xf[0,x/z,\[Mu],0],{z,x,1},PrecisionGoal->5]
+NIntegrate[(-(1/z)0.024691358024691357` (2.` (-1.`+z) (172.`\[VeryThinSpace]-143.` z+136.` z^2+L\[Mu] (-156.`+ 60.` z-264.` z^2)+L\[Mu]^2 (36.`\[VeryThinSpace]+63.` z+36.` z^2))+12.` z (-21.`+L\[Mu]^2 (-9.`- 9.` z)+30.` z-32.` z^2+L\[Mu] (9.`\[VeryThinSpace]+27.` z+24.` z^2)) Log[z]+9.` z (3.`\[VeryThinSpace]+3.` z+8.` z^2-12.` L\[Mu] (1.`\[VeryThinSpace]+z)) Log[z]^2-18.` z (1.`\[VeryThinSpace]+z) Log[z]^3-72.` (-2.`+ 3.` z-3.` z^2+2.` z^3) PolyLog[2.`,1.`\[VeryThinSpace]-1.` z]))(xf[0,x/z,\[Mu],-3]+xf[0,x/z,\[Mu],-2]+xf[0,x/z,\[Mu],-1]+xf[0,x/z,\[Mu],1]+xf[0,x/z,\[Mu],2]+xf[0,x/z,\[Mu],3]),{z,x,1},PrecisionGoal->5]
+NIntegrate[1/(1.`\[VeryThinSpace]+z) 0.14814814814814814` (-52.212341418957564`+ 37.787658581042436` z^2+9.869604401089358` (1.`\[VeryThinSpace]+z)^2+(1.`\[VeryThinSpace]+z^2) Log[z]^3-6.` (1.`\[VeryThinSpace]+z^2) Log[z]^2 (2.` Log[1.`\[VeryThinSpace]-1.` z]+Log[1.`\[VeryThinSpace]+z])+2.` (1.`\[VeryThinSpace]+z^2) Log[1.`\[VeryThinSpace]+z] (9.869604401089358`\[VeryThinSpace]-2.` Log[1.`\[VeryThinSpace]+z]^2)+Log[z] (10.739208802178716`\[VeryThinSpace]-42.` z-13.260791197821284` z^2+12.` Log[1.`\[VeryThinSpace]+z] ((1.`\[VeryThinSpace]+z)^2+(1.`\[VeryThinSpace]+z^2) Log[1.`\[VeryThinSpace]+z]))-12.` (-1.`+z^2+(1.`\[VeryThinSpace]+z^2) Log[z]) PolyLog[2.`,1.`\[VeryThinSpace]-1.` z]+12.` ((1.`\[VeryThinSpace]+z)^2+(1.`\[VeryThinSpace]+z^2) Log[z]) PolyLog[2.`,-1.` z]-2.` L\[Mu] (-2.130395598910642`+ 21.869604401089358` z^2-3.` (1.`\[VeryThinSpace]+z^2) Log[z]^2+6.` Log[z] (-1.` (1.`\[VeryThinSpace]+z)^2+2.` (1.`\[VeryThinSpace]+z^2) Log[1.`\[VeryThinSpace]+z])+12.` (1.`\[VeryThinSpace]+z^2) PolyLog[2.`,-1.` z])-12.` (1.`\[VeryThinSpace]+z^2) PolyLog[3.`,-1.` z]-24.` (1.`\[VeryThinSpace]+z^2) PolyLog[3.`,z]+24.` (1.`\[VeryThinSpace]+z^2) PolyLog[3.`,z/(1.`\[VeryThinSpace]+z)])xf[0,x/z,\[Mu],-f],{z,x,1},PrecisionGoal->5]]


(*quark convolutions with EXP*)
(*LO q<-q*)
FqqEXP[0,f_,x_,bt_,\[Mu]_,g_]:=Exp[-g bt^2]xf[0,x,\[Mu],f]/x
(*NLO q<-q*)
FqqEXP[1,f_,x_,bt_,\[Mu]_,g_]:=1/x Module[{L\[Mu]=2Log[\[Mu] bt]-0.23186303131682484`},
NIntegrate[(16 L\[Mu])/(3 (-1+z))(Exp[-g bt^2 z]xf[0,x/z,\[Mu],f]-Exp[-g bt^2]xf[0,x,\[Mu],f])+Exp[-g bt^2 z](8/3 (1+L\[Mu]-z+L\[Mu] z))xf[0,x/z,\[Mu],f],{z,x,1},PrecisionGoal->5]
-Exp[-g bt^2]xf[0,x,\[Mu],f] 16/3 L\[Mu] Log[1-x]
+Exp[-g bt^2](-(2/9) (-6 L\[Mu]^2+\[Pi]^2))xf[0,x,\[Mu],f]]
(*NLO q<-!q*)
FqqMIXEXP[1,f_,x_,bt_,\[Mu]_,g_]:=1/x Module[{L\[Mu]=2Log[\[Mu] bt]-0.23186303131682484`},
NIntegrate[Exp[-z g bt^2](-2 (-1+z) z+L\[Mu] (-1+2 z-2 z^2))xf[0,x/z,\[Mu],0],{z,x,1},PrecisionGoal->5]]
(*NNLO q<-q*)
FqqEXP[2,f_,x_,bt_,\[Mu]_,g_]:=1/x Module[{L\[Mu]=2Log[\[Mu] bt]-0.23186303131682484`},
NIntegrate[1/(-1.`+z) 0.07407407407407407` (-4.` (-106.37750939432664`+ 124.86870317603413` L\[Mu]+81.` L\[Mu]^2+24.` L\[Mu]^3-96.` L\[Mu]^2 Log[1.`\[VeryThinSpace]-1.` z])Exp[-g bt^2] xf[0,x,\[Mu],f]+(-202.36561810763305`+ 549.7374063520683` L\[Mu]+210.` L\[Mu]^2+48.` L\[Mu]^3-136.17626406536147` z-600.` L\[Mu] z-96.` L\[Mu]^2 z-202.36561810763305` z^2+549.7374063520683` L\[Mu] z^2+210.` L\[Mu]^2 z^2+48.` L\[Mu]^3 z^2-197.39208802178717` Log[1.`\[VeryThinSpace]-1.` z]+192.` L\[Mu] Log[1.`\[VeryThinSpace]-1.` z]-192.` L\[Mu]^2 Log[1.`\[VeryThinSpace]-1.` z]-60.` z Log[1.`\[VeryThinSpace]-1.` z]-384.` L\[Mu] z Log[1.`\[VeryThinSpace]-1.` z]-137.39208802178717` z^2 Log[1.`\[VeryThinSpace]-1.` z]+192.` L\[Mu] z^2 Log[1.`\[VeryThinSpace]-1.` z]-192.` L\[Mu]^2 z^2 Log[1.`\[VeryThinSpace]-1.` z]+48.` Log[z]+156.` L\[Mu] Log[z]+48.` L\[Mu]^2 Log[z]+192.` z Log[z]+168.` z^2 Log[z]+204.` L\[Mu] z^2 Log[z]+144.` L\[Mu]^2 z^2 Log[z]+72.` Log[1.`\[VeryThinSpace]-1.` z] Log[z]-192.` L\[Mu] Log[1.`\[VeryThinSpace]-1.` z] Log[z]-144.` z Log[1.`\[VeryThinSpace]-1.` z] Log[z]+72.` z^2 Log[1.`\[VeryThinSpace]-1.` z] Log[z]-192.` L\[Mu] z^2 Log[1.`\[VeryThinSpace]-1.` z] Log[z]+72.` Log[1.`\[VeryThinSpace]-1.` z]^2 Log[z]+72.` z^2 Log[1.`\[VeryThinSpace]-1.` z]^2 Log[z]+9.` Log[z]^2+60.` L\[Mu] Log[z]^2+60.` z Log[z]^2+21.` z^2 Log[z]^2+156.` L\[Mu] z^2 Log[z]^2-48.` Log[1.`\[VeryThinSpace]-1.` z] Log[z]^2-48.` z^2 Log[1.`\[VeryThinSpace]-1.` z] Log[z]^2+10.` Log[z]^3+26.` z^2 Log[z]^3+24.` (-1.` (-1.`+z)^2+5.` (1.`\[VeryThinSpace]+z^2) Log[1.`\[VeryThinSpace]-1.` z]-3.` (1.`\[VeryThinSpace]+z^2) Log[z]) PolyLog[2.`,z]+120.` (1.`\[VeryThinSpace]+z^2) PolyLog[3.`,1.`\[VeryThinSpace]-1.` z]+48.` PolyLog[3.`,z]+48.` z^2 PolyLog[3.`,z])Exp[-z g bt^2] xf[0,x/z,\[Mu],f]),{z,x,1},PrecisionGoal->5]
+8/27 Exp[-g bt^2]Log[1-x] xf[0,x,\[Mu],f] (-348-L\[Mu] (342+3 L\[Mu] (27+8 L\[Mu])-22 \[Pi]^2)+48 L\[Mu]^2 Log[1-x]+378 Zeta[3])
+Exp[-g bt^2](4 L\[Mu]^3+(8 L\[Mu]^4)/9+L\[Mu]^2 (76/3-4 \[Pi]^2)+1/81 (-513 \[Pi]^2+20 \[Pi]^4+84 (50-27 Zeta[3]))+L\[Mu] (464/9-4 \[Pi]^2-56 Zeta[3]))xf[0,x,\[Mu],f]]
(*NNLO q<-!q*)
FqqMIXEXP[2,f_,x_,bt_,\[Mu]_,g_]:=1/x Module[{L\[Mu]=2Log[\[Mu] bt]-0.23186303131682484`},
NIntegrate[(0.05555555555555555` (24.` L\[Mu]^3 (1.`\[VeryThinSpace]+2.` (-1.`+z) z)-30.` z (-3.`+ 4.` z) Log[1.`\[VeryThinSpace]-1.` z]+60.` (-1.`+z) z Log[1.`\[VeryThinSpace]-1.` z]^2+10.` (1.`\[VeryThinSpace]+2.` (-1.`+z) z) Log[1.`\[VeryThinSpace]-1.` z]^3-2.` (-7.`- 22.` z+8.` z^2) Log[z]^3-1/z 6.` L\[Mu]^2 (-12.`+ 5.` z+8.` L\[Mu] z-96.` z^2-16.` L\[Mu] z^2+109.` z^3+16.` L\[Mu] z^3+z (-26.`+ 52.` z-52.` z^2) Log[1.`\[VeryThinSpace]-1.` z]+z (-14.`- 80.` z+16.` z^2) Log[z])-3.` Log[z]^2 (7.`\[VeryThinSpace]-60.` z+148.` z^2+(8.`\[VeryThinSpace]-160.` z+16.` z^2) Log[1.`\[VeryThinSpace]-1.` z]+(-18.`- 36.` z-36.` z^2) Log[1.`\[VeryThinSpace]+z])+4.` Log[z] (106.73920880217872`\[VeryThinSpace]-262.13129682396584` z+219.47841760435745` z^2+z (-24.`+ 24.` z) Log[1.`\[VeryThinSpace]-1.` z]+(6.`\[VeryThinSpace]-12.` z+12.` z^2) Log[1.`\[VeryThinSpace]-1.` z]^2+z (54.`\[VeryThinSpace]+54.` z) Log[1.`\[VeryThinSpace]+z]+(-27.`- 54.` z-54.` z^2) Log[1.`\[VeryThinSpace]+z]^2)+1/z (344.`\[VeryThinSpace]-454.23229472795197` z+1388.5441333514486` z^2-559.5940838297593` z^3+z (-177.65287921960845`- 355.3057584392169` z-355.3057584392169` z^2) Log[1.`\[VeryThinSpace]+z]+z (36.`\[VeryThinSpace]+72.` z+72.` z^2) Log[1.`\[VeryThinSpace]+z]^3)+1/z 12.` (-12.`+ 18.` z-72.` z^2+66.` z^3+z (-5.`+ 10.` z-10.` z^2) Log[1.`\[VeryThinSpace]-1.` z]+z (-4.`+ 44.` z-8.` z^2) Log[z]) PolyLog[2.`,1.`\[VeryThinSpace]-1.` z]+18.` (12.` z (1.`\[VeryThinSpace]+z)-6.` (1.`\[VeryThinSpace]+2.` z (1.`\[VeryThinSpace]+z)) Log[z]) PolyLog[2.`,-1.` z]+1/z 4.` L\[Mu] (-78.`+ 97.3480220054468` z-128.04316479128514` z^2+24.` L\[Mu] z^2+278.6960440108936` z^3-24.` L\[Mu] z^3+z (15.`\[VeryThinSpace]-30.` z+30.` z^2) Log[1.`\[VeryThinSpace]-1.` z]^2-33.` z Log[z]+48.` z^2 Log[z]-444.` z^3 Log[z]+21.` z Log[z]^2+66.` z^2 Log[z]^2-24.` z^3 Log[z]^2+z Log[1.`\[VeryThinSpace]-1.` z] (z (-48.`+ 48.` z)+(24.`\[VeryThinSpace]-48.` z+48.` z^2) Log[z])+54.` z Log[z] Log[1.`\[VeryThinSpace]+z]+108.` z^2 Log[z] Log[1.`\[VeryThinSpace]+z]+108.` z^3 Log[z] Log[1.`\[VeryThinSpace]+z]+z (54.`\[VeryThinSpace]+108.` z+108.` z^2) PolyLog[2.`,-1.` z])+60.` (1.`\[VeryThinSpace]+2.` (-1.`+z) z) PolyLog[3.`,1.`\[VeryThinSpace]-1.` z]+108.` (1.`\[VeryThinSpace]+2.` z (1.`\[VeryThinSpace]+z)) PolyLog[3.`,-1.` z]-48.` (1.`\[VeryThinSpace]-20.` z+2.` z^2) PolyLog[3.`,z]-216.` (1.`\[VeryThinSpace]+2.` z (1.`\[VeryThinSpace]+z)) PolyLog[3.`,z/(1.`\[VeryThinSpace]+z)]))Exp[-z g bt^2]xf[0,x/z,\[Mu],0],{z,x,1},PrecisionGoal->5]
+NIntegrate[(-(1/z)0.024691358024691357` (2.` (-1.`+z) (172.`\[VeryThinSpace]-143.` z+136.` z^2+L\[Mu] (-156.`+ 60.` z-264.` z^2)+L\[Mu]^2 (36.`\[VeryThinSpace]+63.` z+36.` z^2))+12.` z (-21.`+L\[Mu]^2 (-9.`- 9.` z)+30.` z-32.` z^2+L\[Mu] (9.`\[VeryThinSpace]+27.` z+24.` z^2)) Log[z]+9.` z (3.`\[VeryThinSpace]+3.` z+8.` z^2-12.` L\[Mu] (1.`\[VeryThinSpace]+z)) Log[z]^2-18.` z (1.`\[VeryThinSpace]+z) Log[z]^3-72.` (-2.`+ 3.` z-3.` z^2+2.` z^3) PolyLog[2.`,1.`\[VeryThinSpace]-1.` z]))(xf[0,x/z,\[Mu],-3]+xf[0,x/z,\[Mu],-2]+xf[0,x/z,\[Mu],-1]+xf[0,x/z,\[Mu],1]+xf[0,x/z,\[Mu],2]+xf[0,x/z,\[Mu],3])Exp[-z g bt^2],{z,x,1},PrecisionGoal->5]
+NIntegrate[1/(1.`\[VeryThinSpace]+z) 0.14814814814814814` (-52.212341418957564`+ 37.787658581042436` z^2+9.869604401089358` (1.`\[VeryThinSpace]+z)^2+(1.`\[VeryThinSpace]+z^2) Log[z]^3-6.` (1.`\[VeryThinSpace]+z^2) Log[z]^2 (2.` Log[1.`\[VeryThinSpace]-1.` z]+Log[1.`\[VeryThinSpace]+z])+2.` (1.`\[VeryThinSpace]+z^2) Log[1.`\[VeryThinSpace]+z] (9.869604401089358`\[VeryThinSpace]-2.` Log[1.`\[VeryThinSpace]+z]^2)+Log[z] (10.739208802178716`\[VeryThinSpace]-42.` z-13.260791197821284` z^2+12.` Log[1.`\[VeryThinSpace]+z] ((1.`\[VeryThinSpace]+z)^2+(1.`\[VeryThinSpace]+z^2) Log[1.`\[VeryThinSpace]+z]))-12.` (-1.`+z^2+(1.`\[VeryThinSpace]+z^2) Log[z]) PolyLog[2.`,1.`\[VeryThinSpace]-1.` z]+12.` ((1.`\[VeryThinSpace]+z)^2+(1.`\[VeryThinSpace]+z^2) Log[z]) PolyLog[2.`,-1.` z]-2.` L\[Mu] (-2.130395598910642`+ 21.869604401089358` z^2-3.` (1.`\[VeryThinSpace]+z^2) Log[z]^2+6.` Log[z] (-1.` (1.`\[VeryThinSpace]+z)^2+2.` (1.`\[VeryThinSpace]+z^2) Log[1.`\[VeryThinSpace]+z])+12.` (1.`\[VeryThinSpace]+z^2) PolyLog[2.`,-1.` z])-12.` (1.`\[VeryThinSpace]+z^2) PolyLog[3.`,-1.` z]-24.` (1.`\[VeryThinSpace]+z^2) PolyLog[3.`,z]+24.` (1.`\[VeryThinSpace]+z^2) PolyLog[3.`,z/(1.`\[VeryThinSpace]+z)])xf[0,x/z,\[Mu],-f]Exp[-z g bt^2],{z,x,1},PrecisionGoal->5]]


(*gluon convolutions*)
(*LO g<-g*)
Fgg[0,x_,bt_,\[Mu]_]:=xf[0,x,\[Mu],0]/x
(*NLO g<-g*)
Fgg[1,x_,bt_,\[Mu]_]:=1/x Module[{L\[Mu]=2Log[\[Mu] bt]-0.23186303131682484`},
NIntegrate[(12 L\[Mu])/(-1+z) (xf[0,x/z,\[Mu],0]-xf[0,x,\[Mu],0])+((12 L\[Mu] (-1+2 z-z^2+z^3))/z)xf[0,x/z,\[Mu],0],{z,x,1},PrecisionGoal->5]
-12 L\[Mu] Log[1-x]xf[0,x,\[Mu],0]
+3 (L\[Mu]^2-\[Pi]^2/6)xf[0,x,\[Mu],0]]
(*NLO g<-!g*)
FggMIX[1,x_,bt_,\[Mu]_]:=1/x Module[{L\[Mu]=2Log[\[Mu] bt]-0.23186303131682484`},
NIntegrate[8/3 (L\[Mu] (2-2/z-z)+z)(xf[0,x/z,\[Mu],-3]+xf[0,x/z,\[Mu],-2]+xf[0,x/z,\[Mu],-1]+xf[0,x/z,\[Mu],1]+xf[0,x/z,\[Mu],2]+xf[0,x/z,\[Mu],3]),{z,x,1},PrecisionGoal->5]]
(*NNLO g<-g*)
Fgg[2,x_,bt_,\[Mu]_]:=1/x Module[{L\[Mu]=2Log[\[Mu] bt]-0.23186303131682484`},
NIntegrate[1/(z (-1.`+z^2)) 0.3333333333333333` (-6.` z (1.`\[VeryThinSpace]+z) (-35.45916979810886`+ 25.173560390195775` L\[Mu]+27.` L\[Mu]^2+18.` L\[Mu]^3-72.` L\[Mu]^2 Log[1.`\[VeryThinSpace]-1.` z]) xf[0,x,\[Mu],0]+(73.34647256137055`\[VeryThinSpace]-421.65287921960845` L\[Mu]+922.` L\[Mu]^2+108.` L\[Mu]^3+178.73307133417416` z+1434.2643960980422` L\[Mu] z-834.` L\[Mu]^2 z-108.` L\[Mu]^3 z-710.3009993079065` z^2+108.34712078039155` L\[Mu] z^2+74.` L\[Mu]^2 z^2+108.` L\[Mu]^3 z^2-1257.945290390379` z^3-410.2643960980422` L\[Mu] z^3+74.` L\[Mu]^2 z^3+108.` L\[Mu]^3 z^3-224.9112197482982` z^4+819.6528792196084` L\[Mu] z^4-834.` L\[Mu]^2 z^4-108.` L\[Mu]^3 z^4-42.29781852110182` z^5-1228.2643960980422` L\[Mu] z^5+922.` L\[Mu]^2 z^5+108.` L\[Mu]^3 z^5-432.` L\[Mu]^2 Log[1.`\[VeryThinSpace]-1.` z]+432.` L\[Mu]^2 z Log[1.`\[VeryThinSpace]-1.` z]-432.` L\[Mu]^2 z^2 Log[1.`\[VeryThinSpace]-1.` z]-432.` L\[Mu]^2 z^3 Log[1.`\[VeryThinSpace]-1.` z]+432.` L\[Mu]^2 z^4 Log[1.`\[VeryThinSpace]-1.` z]-432.` L\[Mu]^2 z^5 Log[1.`\[VeryThinSpace]-1.` z]+216.` L\[Mu]^2 Log[z]+1881.` z Log[z]-1116.` L\[Mu] z Log[z]+168.` L\[Mu]^2 z Log[z]+243.` z^2 Log[z]+180.` L\[Mu] z^2 Log[z]+600.` L\[Mu]^2 z^2 Log[z]-273.` z^3 Log[z]-468.` L\[Mu] z^3 Log[z]-168.` L\[Mu]^2 z^3 Log[z]-243.` z^4 Log[z]-180.` L\[Mu] z^4 Log[z]-600.` L\[Mu]^2 z^4 Log[z]-1608.` z^5 Log[z]+1584.` L\[Mu] z^5 Log[z]+216.` L\[Mu]^2 z^5 Log[z]+792.` Log[1.`\[VeryThinSpace]-1.` z] Log[z]-432.` L\[Mu] Log[1.`\[VeryThinSpace]-1.` z] Log[z]-864.` z Log[1.`\[VeryThinSpace]-1.` z] Log[z]+432.` L\[Mu] z Log[1.`\[VeryThinSpace]-1.` z] Log[z]+72.` z^2 Log[1.`\[VeryThinSpace]-1.` z] Log[z]-432.` L\[Mu] z^2 Log[1.`\[VeryThinSpace]-1.` z] Log[z]+72.` z^3 Log[1.`\[VeryThinSpace]-1.` z] Log[z]-432.` L\[Mu] z^3 Log[1.`\[VeryThinSpace]-1.` z] Log[z]-864.` z^4 Log[1.`\[VeryThinSpace]-1.` z] Log[z]+432.` L\[Mu] z^4 Log[1.`\[VeryThinSpace]-1.` z] Log[z]+792.` z^5 Log[1.`\[VeryThinSpace]-1.` z] Log[z]-432.` L\[Mu] z^5 Log[1.`\[VeryThinSpace]-1.` z] Log[z]-108.` Log[1.`\[VeryThinSpace]-1.` z]^2 Log[z]+108.` z Log[1.`\[VeryThinSpace]-1.` z]^2 Log[z]-108.` z^2 Log[1.`\[VeryThinSpace]-1.` z]^2 Log[z]-108.` z^3 Log[1.`\[VeryThinSpace]-1.` z]^2 Log[z]+108.` z^4 Log[1.`\[VeryThinSpace]-1.` z]^2 Log[z]-108.` z^5 Log[1.`\[VeryThinSpace]-1.` z]^2 Log[z]-279.` z Log[z]^2+168.` L\[Mu] z Log[z]^2+69.` z^2 Log[z]^2+384.` L\[Mu] z^2 Log[z]^2-117.` z^3 Log[z]^2-168.` L\[Mu] z^3 Log[z]^2-69.` z^4 Log[z]^2-384.` L\[Mu] z^4 Log[z]^2+396.` z^5 Log[z]^2+216.` L\[Mu] z^5 Log[z]^2-108.` Log[1.`\[VeryThinSpace]-1.` z] Log[z]^2+108.` z Log[1.`\[VeryThinSpace]-1.` z] Log[z]^2-108.` z^2 Log[1.`\[VeryThinSpace]-1.` z] Log[z]^2-108.` z^3 Log[1.`\[VeryThinSpace]-1.` z] Log[z]^2+108.` z^4 Log[1.`\[VeryThinSpace]-1.` z] Log[z]^2-108.` z^5 Log[1.`\[VeryThinSpace]-1.` z] Log[z]^2+28.` z Log[z]^3+64.` z^2 Log[z]^3-28.` z^3 Log[z]^3-64.` z^4 Log[z]^3+36.` z^5 Log[z]^3-355.3057584392169` Log[1.`\[VeryThinSpace]+z]-355.3057584392169` z Log[1.`\[VeryThinSpace]+z]-355.3057584392169` z^2 Log[1.`\[VeryThinSpace]+z]+355.3057584392169` z^3 Log[1.`\[VeryThinSpace]+z]+355.3057584392169` z^4 Log[1.`\[VeryThinSpace]+z]+355.3057584392169` z^5 Log[1.`\[VeryThinSpace]+z]+432.` L\[Mu] Log[z] Log[1.`\[VeryThinSpace]+z]+432.` L\[Mu] z Log[z] Log[1.`\[VeryThinSpace]+z]+432.` L\[Mu] z^2 Log[z] Log[1.`\[VeryThinSpace]+z]-432.` L\[Mu] z^3 Log[z] Log[1.`\[VeryThinSpace]+z]-432.` L\[Mu] z^4 Log[z] Log[1.`\[VeryThinSpace]+z]-432.` L\[Mu] z^5 Log[z] Log[1.`\[VeryThinSpace]+z]+108.` Log[z]^2 Log[1.`\[VeryThinSpace]+z]+108.` z Log[z]^2 Log[1.`\[VeryThinSpace]+z]+108.` z^2 Log[z]^2 Log[1.`\[VeryThinSpace]+z]-108.` z^3 Log[z]^2 Log[1.`\[VeryThinSpace]+z]-108.` z^4 Log[z]^2 Log[1.`\[VeryThinSpace]+z]-108.` z^5 Log[z]^2 Log[1.`\[VeryThinSpace]+z]-216.` Log[z] Log[1.`\[VeryThinSpace]+z]^2-216.` z Log[z] Log[1.`\[VeryThinSpace]+z]^2-216.` z^2 Log[z] Log[1.`\[VeryThinSpace]+z]^2+216.` z^3 Log[z] Log[1.`\[VeryThinSpace]+z]^2+216.` z^4 Log[z] Log[1.`\[VeryThinSpace]+z]^2+216.` z^5 Log[z] Log[1.`\[VeryThinSpace]+z]^2+72.` Log[1.`\[VeryThinSpace]+z]^3+72.` z Log[1.`\[VeryThinSpace]+z]^3+72.` z^2 Log[1.`\[VeryThinSpace]+z]^3-72.` z^3 Log[1.`\[VeryThinSpace]+z]^3-72.` z^4 Log[1.`\[VeryThinSpace]+z]^3-72.` z^5 Log[1.`\[VeryThinSpace]+z]^3-216.` (-1.`+z) (1.`\[VeryThinSpace]+z+z^2)^2 (2.` L\[Mu]-1.` Log[z]) PolyLog[2.`,-1.` z]-72.` (-1.` (-1.`+z)^2 (11.`\[VeryThinSpace]+10.` z+10.` z^2+11.` z^3)+3.` (3.`\[VeryThinSpace]-1.` z+3.` z^2+z^3-3.` z^4+z^5) Log[z]) PolyLog[2.`,z]+216.` PolyLog[3.`,-1.` z]+216.` z PolyLog[3.`,-1.` z]+216.` z^2 PolyLog[3.`,-1.` z]-216.` z^3 PolyLog[3.`,-1.` z]-216.` z^4 PolyLog[3.`,-1.` z]-216.` z^5 PolyLog[3.`,-1.` z]+1080.` PolyLog[3.`,z]-216.` z PolyLog[3.`,z]+1080.` z^2 PolyLog[3.`,z]+216.` z^3 PolyLog[3.`,z]-1080.` z^4 PolyLog[3.`,z]+216.` z^5 PolyLog[3.`,z]-432.` PolyLog[3.`,z/(1.`\[VeryThinSpace]+z)]-432.` z PolyLog[3.`,z/(1.`\[VeryThinSpace]+z)]-432.` z^2 PolyLog[3.`,z/(1.`\[VeryThinSpace]+z)]+432.` z^3 PolyLog[3.`,z/(1.`\[VeryThinSpace]+z)]+432.` z^4 PolyLog[3.`,z/(1.`\[VeryThinSpace]+z)]+432.` z^5 PolyLog[3.`,z/(1.`\[VeryThinSpace]+z)]) xf[0,x/z,\[Mu],0]),{z,x,1},PrecisionGoal->5]
-2 Log[1-x] xf[0,x,\[Mu],0] (116+3 L\[Mu] (38+9 L\[Mu]+6 L\[Mu]^2-3 \[Pi]^2)-36 L\[Mu]^2 Log[1-x]-126 Zeta[3])
+(-38.8240990516596`- 124.28560940791309` L\[Mu]-105.8484726179744` L\[Mu]^2+9.` L\[Mu]^3+4.5` L\[Mu]^4)xf[0,x,\[Mu],0]]
(*NNLO g<-!g*)
FggMIX[2,x_,bt_,\[Mu]_]:=1/x Module[{L\[Mu]=2Log[\[Mu] bt]-0.23186303131682484`},
NIntegrate[0.012345679012345678` ((648.` L\[Mu]^3 (2.`\[VeryThinSpace]+(-2.`+z) z))/z+(24.` (-204.`+ 204.` z-57.` z^2) Log[1.`\[VeryThinSpace]-1.` z])/z+(36.` (-30.`+ 30.` z-5.` z^2) Log[1.`\[VeryThinSpace]-1.` z]^2)/z-(120.` (2.`\[VeryThinSpace]+(-2.`+z) z) Log[1.`\[VeryThinSpace]-1.` z]^3)/z-24.` (14.`\[VeryThinSpace]+11.` z) Log[z]^3-1/z 72.` L\[Mu]^2 (147.`\[VeryThinSpace]+36.` L\[Mu]-134.` z-36.` L\[Mu] z+29.` z^2+18.` L\[Mu] z^2-12.` z^3+(-52.`+ 52.` z-26.` z^2) Log[1.`\[VeryThinSpace]-1.` z]+(36.`\[VeryThinSpace]+28.` z+40.` z^2) Log[z])+1/z 36.` Log[z]^2 (z (100.`\[VeryThinSpace]+21.` z+24.` z^2)+18.` (2.`\[VeryThinSpace]-2.` z+z^2) Log[1.`\[VeryThinSpace]-1.` z]-18.` (2.`\[VeryThinSpace]+2.` z+z^2) Log[1.`\[VeryThinSpace]+z])+1/z 72.` Log[z] (z (-279.`+ 16.` z-88.` z^2)+(-132.`+ 144.` z-54.` z^2+24.` z^3) Log[1.`\[VeryThinSpace]-1.` z]+(18.`\[VeryThinSpace]-18.` z+9.` z^2) Log[1.`\[VeryThinSpace]-1.` z]^2+18.` z^2 Log[1.`\[VeryThinSpace]+z]+(36.`\[VeryThinSpace]+36.` z+18.` z^2) Log[1.`\[VeryThinSpace]+z]^2)+1/z (-904.1576707364438`- 2144.7968560100926` z+160.94630492195938` z^2+4453.553932486266` z^3+(4263.669101270602`\[VeryThinSpace]+4263.669101270602` z+2131.834550635301` z^2) Log[1.`\[VeryThinSpace]+z]+(-864.`- 864.` z-432.` z^2) Log[1.`\[VeryThinSpace]+z]^3)+81.` (16.` z+(32.`\[VeryThinSpace]+32.`/z+16.` z) Log[z]) PolyLog[2.`,-1.` z]+1/z 12.` L\[Mu] (309.65287921960845`\[VeryThinSpace]-1284.2643960980422` z+304.8264396098042` z^2+108.` L\[Mu] z^2-528.` z^3+(-120.`+ 120.` z-60.` z^2) Log[1.`\[VeryThinSpace]-1.` z]^2+1200.` z Log[z]+420.` z^2 Log[z]+288.` z^3 Log[z]-168.` z Log[z]^2-132.` z^2 Log[z]^2+Log[1.`\[VeryThinSpace]-1.` z] (-360.`+ 360.` z-396.` z^2+(432.`\[VeryThinSpace]-432.` z+216.` z^2) Log[z])-432.` Log[z] Log[1.`\[VeryThinSpace]+z]-432.` z Log[z] Log[1.`\[VeryThinSpace]+z]-216.` z^2 Log[z] Log[1.`\[VeryThinSpace]+z]+(-432.`- 432.` z-216.` z^2) PolyLog[2.`,-1.` z])+(432.` (-22.`+ 24.` z-6.` z^2+4.` z^3+(18.`\[VeryThinSpace]-6.` z+9.` z^2) Log[z]) PolyLog[2.`,z])/z-(1296.` (2.`\[VeryThinSpace]+z (2.`\[VeryThinSpace]+z)) PolyLog[3.`,-1.` z])/z-(1296.` (10.`\[VeryThinSpace]+z (-2.`+ 5.` z)) PolyLog[3.`,z])/z+(2592.` (2.`\[VeryThinSpace]+z (2.`\[VeryThinSpace]+z)) PolyLog[3.`,z/(1.`\[VeryThinSpace]+z)])/z)(xf[0,x/z,\[Mu],-3]+xf[0,x/z,\[Mu],-2]+xf[0,x/z,\[Mu],-1]+xf[0,x/z,\[Mu],1]+xf[0,x/z,\[Mu],2]+xf[0,x/z,\[Mu],3]),{z,x,1},PrecisionGoal->5]]


(*gluon convolutions with EXP*)
(*LO g<-g*)
FggEXP[0,x_,bt_,\[Mu]_,g_]:=Exp[-g bt^2]xf[0,x,\[Mu],0]/x
(*NLO g<-g*)
FggEXP[1,x_,bt_,\[Mu]_,g_]:=1/x Module[{L\[Mu]=2Log[\[Mu] bt]-0.23186303131682484`},
NIntegrate[(12 L\[Mu])/(-1+z) (Exp[-z bt^2 g]xf[0,x/z,\[Mu],0]-Exp[-bt^2 g]xf[0,x,\[Mu],0])+Exp[-bt^2 g]((12 L\[Mu] (-1+2 z-z^2+z^3))/z)xf[0,x/z,\[Mu],0],{z,x,1},PrecisionGoal->5]
-12 L\[Mu] Log[1-x]xf[0,x,\[Mu],0]Exp[-bt^2 g]
+3 (L\[Mu]^2-\[Pi]^2/6)xf[0,x,\[Mu],0]Exp[-bt^2 g]]
(*NLO g<-!g*)
FggMIXEXP[1,x_,bt_,\[Mu]_,g_]:=1/x Module[{L\[Mu]=2Log[\[Mu] bt]-0.23186303131682484`},
NIntegrate[8/3 (L\[Mu] (2-2/z-z)+z)Exp[-z g bt^2](xf[0,x/z,\[Mu],-3]+xf[0,x/z,\[Mu],-2]+xf[0,x/z,\[Mu],-1]+xf[0,x/z,\[Mu],1]+xf[0,x/z,\[Mu],2]+xf[0,x/z,\[Mu],3]),{z,x,1},PrecisionGoal->5]]
(*NNLO g<-g*)
FggEXP[2,x_,bt_,\[Mu]_,g_]:=1/x Module[{L\[Mu]=2Log[\[Mu] bt]-0.23186303131682484`},
NIntegrate[1/(z (-1.`+z^2)) 0.3333333333333333` (-6.` z (1.`\[VeryThinSpace]+z) (-35.45916979810886`+ 25.173560390195775` L\[Mu]+27.` L\[Mu]^2+18.` L\[Mu]^3-72.` L\[Mu]^2 Log[1.`\[VeryThinSpace]-1.` z]) xf[0,x,\[Mu],0]Exp[-bt^2g]+(73.34647256137055`\[VeryThinSpace]-421.65287921960845` L\[Mu]+922.` L\[Mu]^2+108.` L\[Mu]^3+178.73307133417416` z+1434.2643960980422` L\[Mu] z-834.` L\[Mu]^2 z-108.` L\[Mu]^3 z-710.3009993079065` z^2+108.34712078039155` L\[Mu] z^2+74.` L\[Mu]^2 z^2+108.` L\[Mu]^3 z^2-1257.945290390379` z^3-410.2643960980422` L\[Mu] z^3+74.` L\[Mu]^2 z^3+108.` L\[Mu]^3 z^3-224.9112197482982` z^4+819.6528792196084` L\[Mu] z^4-834.` L\[Mu]^2 z^4-108.` L\[Mu]^3 z^4-42.29781852110182` z^5-1228.2643960980422` L\[Mu] z^5+922.` L\[Mu]^2 z^5+108.` L\[Mu]^3 z^5-432.` L\[Mu]^2 Log[1.`\[VeryThinSpace]-1.` z]+432.` L\[Mu]^2 z Log[1.`\[VeryThinSpace]-1.` z]-432.` L\[Mu]^2 z^2 Log[1.`\[VeryThinSpace]-1.` z]-432.` L\[Mu]^2 z^3 Log[1.`\[VeryThinSpace]-1.` z]+432.` L\[Mu]^2 z^4 Log[1.`\[VeryThinSpace]-1.` z]-432.` L\[Mu]^2 z^5 Log[1.`\[VeryThinSpace]-1.` z]+216.` L\[Mu]^2 Log[z]+1881.` z Log[z]-1116.` L\[Mu] z Log[z]+168.` L\[Mu]^2 z Log[z]+243.` z^2 Log[z]+180.` L\[Mu] z^2 Log[z]+600.` L\[Mu]^2 z^2 Log[z]-273.` z^3 Log[z]-468.` L\[Mu] z^3 Log[z]-168.` L\[Mu]^2 z^3 Log[z]-243.` z^4 Log[z]-180.` L\[Mu] z^4 Log[z]-600.` L\[Mu]^2 z^4 Log[z]-1608.` z^5 Log[z]+1584.` L\[Mu] z^5 Log[z]+216.` L\[Mu]^2 z^5 Log[z]+792.` Log[1.`\[VeryThinSpace]-1.` z] Log[z]-432.` L\[Mu] Log[1.`\[VeryThinSpace]-1.` z] Log[z]-864.` z Log[1.`\[VeryThinSpace]-1.` z] Log[z]+432.` L\[Mu] z Log[1.`\[VeryThinSpace]-1.` z] Log[z]+72.` z^2 Log[1.`\[VeryThinSpace]-1.` z] Log[z]-432.` L\[Mu] z^2 Log[1.`\[VeryThinSpace]-1.` z] Log[z]+72.` z^3 Log[1.`\[VeryThinSpace]-1.` z] Log[z]-432.` L\[Mu] z^3 Log[1.`\[VeryThinSpace]-1.` z] Log[z]-864.` z^4 Log[1.`\[VeryThinSpace]-1.` z] Log[z]+432.` L\[Mu] z^4 Log[1.`\[VeryThinSpace]-1.` z] Log[z]+792.` z^5 Log[1.`\[VeryThinSpace]-1.` z] Log[z]-432.` L\[Mu] z^5 Log[1.`\[VeryThinSpace]-1.` z] Log[z]-108.` Log[1.`\[VeryThinSpace]-1.` z]^2 Log[z]+108.` z Log[1.`\[VeryThinSpace]-1.` z]^2 Log[z]-108.` z^2 Log[1.`\[VeryThinSpace]-1.` z]^2 Log[z]-108.` z^3 Log[1.`\[VeryThinSpace]-1.` z]^2 Log[z]+108.` z^4 Log[1.`\[VeryThinSpace]-1.` z]^2 Log[z]-108.` z^5 Log[1.`\[VeryThinSpace]-1.` z]^2 Log[z]-279.` z Log[z]^2+168.` L\[Mu] z Log[z]^2+69.` z^2 Log[z]^2+384.` L\[Mu] z^2 Log[z]^2-117.` z^3 Log[z]^2-168.` L\[Mu] z^3 Log[z]^2-69.` z^4 Log[z]^2-384.` L\[Mu] z^4 Log[z]^2+396.` z^5 Log[z]^2+216.` L\[Mu] z^5 Log[z]^2-108.` Log[1.`\[VeryThinSpace]-1.` z] Log[z]^2+108.` z Log[1.`\[VeryThinSpace]-1.` z] Log[z]^2-108.` z^2 Log[1.`\[VeryThinSpace]-1.` z] Log[z]^2-108.` z^3 Log[1.`\[VeryThinSpace]-1.` z] Log[z]^2+108.` z^4 Log[1.`\[VeryThinSpace]-1.` z] Log[z]^2-108.` z^5 Log[1.`\[VeryThinSpace]-1.` z] Log[z]^2+28.` z Log[z]^3+64.` z^2 Log[z]^3-28.` z^3 Log[z]^3-64.` z^4 Log[z]^3+36.` z^5 Log[z]^3-355.3057584392169` Log[1.`\[VeryThinSpace]+z]-355.3057584392169` z Log[1.`\[VeryThinSpace]+z]-355.3057584392169` z^2 Log[1.`\[VeryThinSpace]+z]+355.3057584392169` z^3 Log[1.`\[VeryThinSpace]+z]+355.3057584392169` z^4 Log[1.`\[VeryThinSpace]+z]+355.3057584392169` z^5 Log[1.`\[VeryThinSpace]+z]+432.` L\[Mu] Log[z] Log[1.`\[VeryThinSpace]+z]+432.` L\[Mu] z Log[z] Log[1.`\[VeryThinSpace]+z]+432.` L\[Mu] z^2 Log[z] Log[1.`\[VeryThinSpace]+z]-432.` L\[Mu] z^3 Log[z] Log[1.`\[VeryThinSpace]+z]-432.` L\[Mu] z^4 Log[z] Log[1.`\[VeryThinSpace]+z]-432.` L\[Mu] z^5 Log[z] Log[1.`\[VeryThinSpace]+z]+108.` Log[z]^2 Log[1.`\[VeryThinSpace]+z]+108.` z Log[z]^2 Log[1.`\[VeryThinSpace]+z]+108.` z^2 Log[z]^2 Log[1.`\[VeryThinSpace]+z]-108.` z^3 Log[z]^2 Log[1.`\[VeryThinSpace]+z]-108.` z^4 Log[z]^2 Log[1.`\[VeryThinSpace]+z]-108.` z^5 Log[z]^2 Log[1.`\[VeryThinSpace]+z]-216.` Log[z] Log[1.`\[VeryThinSpace]+z]^2-216.` z Log[z] Log[1.`\[VeryThinSpace]+z]^2-216.` z^2 Log[z] Log[1.`\[VeryThinSpace]+z]^2+216.` z^3 Log[z] Log[1.`\[VeryThinSpace]+z]^2+216.` z^4 Log[z] Log[1.`\[VeryThinSpace]+z]^2+216.` z^5 Log[z] Log[1.`\[VeryThinSpace]+z]^2+72.` Log[1.`\[VeryThinSpace]+z]^3+72.` z Log[1.`\[VeryThinSpace]+z]^3+72.` z^2 Log[1.`\[VeryThinSpace]+z]^3-72.` z^3 Log[1.`\[VeryThinSpace]+z]^3-72.` z^4 Log[1.`\[VeryThinSpace]+z]^3-72.` z^5 Log[1.`\[VeryThinSpace]+z]^3-216.` (-1.`+z) (1.`\[VeryThinSpace]+z+z^2)^2 (2.` L\[Mu]-1.` Log[z]) PolyLog[2.`,-1.` z]-72.` (-1.` (-1.`+z)^2 (11.`\[VeryThinSpace]+10.` z+10.` z^2+11.` z^3)+3.` (3.`\[VeryThinSpace]-1.` z+3.` z^2+z^3-3.` z^4+z^5) Log[z]) PolyLog[2.`,z]+216.` PolyLog[3.`,-1.` z]+216.` z PolyLog[3.`,-1.` z]+216.` z^2 PolyLog[3.`,-1.` z]-216.` z^3 PolyLog[3.`,-1.` z]-216.` z^4 PolyLog[3.`,-1.` z]-216.` z^5 PolyLog[3.`,-1.` z]+1080.` PolyLog[3.`,z]-216.` z PolyLog[3.`,z]+1080.` z^2 PolyLog[3.`,z]+216.` z^3 PolyLog[3.`,z]-1080.` z^4 PolyLog[3.`,z]+216.` z^5 PolyLog[3.`,z]-432.` PolyLog[3.`,z/(1.`\[VeryThinSpace]+z)]-432.` z PolyLog[3.`,z/(1.`\[VeryThinSpace]+z)]-432.` z^2 PolyLog[3.`,z/(1.`\[VeryThinSpace]+z)]+432.` z^3 PolyLog[3.`,z/(1.`\[VeryThinSpace]+z)]+432.` z^4 PolyLog[3.`,z/(1.`\[VeryThinSpace]+z)]+432.` z^5 PolyLog[3.`,z/(1.`\[VeryThinSpace]+z)]) Exp[-bt^2g z] xf[0,x/z,\[Mu],0]),{z,x,1},PrecisionGoal->5]
-2 Log[1-x] xf[0,x,\[Mu],0] (116+3 L\[Mu] (38+9 L\[Mu]+6 L\[Mu]^2-3 \[Pi]^2)-36 L\[Mu]^2 Log[1-x]-126 Zeta[3])Exp[-bt^2g]
+(-38.8240990516596`- 124.28560940791309` L\[Mu]-105.8484726179744` L\[Mu]^2+9.` L\[Mu]^3+4.5` L\[Mu]^4)xf[0,x,\[Mu],0]Exp[-bt^2g]]
(*NNLO g<-!g*)
FggMIXEXP[2,x_,bt_,\[Mu]_,g_]:=1/x Module[{L\[Mu]=2Log[\[Mu] bt]-0.23186303131682484`},
NIntegrate[0.012345679012345678` ((648.` L\[Mu]^3 (2.`\[VeryThinSpace]+(-2.`+z) z))/z+(24.` (-204.`+ 204.` z-57.` z^2) Log[1.`\[VeryThinSpace]-1.` z])/z+(36.` (-30.`+ 30.` z-5.` z^2) Log[1.`\[VeryThinSpace]-1.` z]^2)/z-(120.` (2.`\[VeryThinSpace]+(-2.`+z) z) Log[1.`\[VeryThinSpace]-1.` z]^3)/z-24.` (14.`\[VeryThinSpace]+11.` z) Log[z]^3-1/z 72.` L\[Mu]^2 (147.`\[VeryThinSpace]+36.` L\[Mu]-134.` z-36.` L\[Mu] z+29.` z^2+18.` L\[Mu] z^2-12.` z^3+(-52.`+ 52.` z-26.` z^2) Log[1.`\[VeryThinSpace]-1.` z]+(36.`\[VeryThinSpace]+28.` z+40.` z^2) Log[z])+1/z 36.` Log[z]^2 (z (100.`\[VeryThinSpace]+21.` z+24.` z^2)+18.` (2.`\[VeryThinSpace]-2.` z+z^2) Log[1.`\[VeryThinSpace]-1.` z]-18.` (2.`\[VeryThinSpace]+2.` z+z^2) Log[1.`\[VeryThinSpace]+z])+1/z 72.` Log[z] (z (-279.`+ 16.` z-88.` z^2)+(-132.`+ 144.` z-54.` z^2+24.` z^3) Log[1.`\[VeryThinSpace]-1.` z]+(18.`\[VeryThinSpace]-18.` z+9.` z^2) Log[1.`\[VeryThinSpace]-1.` z]^2+18.` z^2 Log[1.`\[VeryThinSpace]+z]+(36.`\[VeryThinSpace]+36.` z+18.` z^2) Log[1.`\[VeryThinSpace]+z]^2)+1/z (-904.1576707364438`- 2144.7968560100926` z+160.94630492195938` z^2+4453.553932486266` z^3+(4263.669101270602`\[VeryThinSpace]+4263.669101270602` z+2131.834550635301` z^2) Log[1.`\[VeryThinSpace]+z]+(-864.`- 864.` z-432.` z^2) Log[1.`\[VeryThinSpace]+z]^3)+81.` (16.` z+(32.`\[VeryThinSpace]+32.`/z+16.` z) Log[z]) PolyLog[2.`,-1.` z]+1/z 12.` L\[Mu] (309.65287921960845`\[VeryThinSpace]-1284.2643960980422` z+304.8264396098042` z^2+108.` L\[Mu] z^2-528.` z^3+(-120.`+ 120.` z-60.` z^2) Log[1.`\[VeryThinSpace]-1.` z]^2+1200.` z Log[z]+420.` z^2 Log[z]+288.` z^3 Log[z]-168.` z Log[z]^2-132.` z^2 Log[z]^2+Log[1.`\[VeryThinSpace]-1.` z] (-360.`+ 360.` z-396.` z^2+(432.`\[VeryThinSpace]-432.` z+216.` z^2) Log[z])-432.` Log[z] Log[1.`\[VeryThinSpace]+z]-432.` z Log[z] Log[1.`\[VeryThinSpace]+z]-216.` z^2 Log[z] Log[1.`\[VeryThinSpace]+z]+(-432.`- 432.` z-216.` z^2) PolyLog[2.`,-1.` z])+(432.` (-22.`+ 24.` z-6.` z^2+4.` z^3+(18.`\[VeryThinSpace]-6.` z+9.` z^2) Log[z]) PolyLog[2.`,z])/z-(1296.` (2.`\[VeryThinSpace]+z (2.`\[VeryThinSpace]+z)) PolyLog[3.`,-1.` z])/z-(1296.` (10.`\[VeryThinSpace]+z (-2.`+ 5.` z)) PolyLog[3.`,z])/z+(2592.` (2.`\[VeryThinSpace]+z (2.`\[VeryThinSpace]+z)) PolyLog[3.`,z/(1.`\[VeryThinSpace]+z)])/z)Exp[-z g bt^2](xf[0,x/z,\[Mu],-3]+xf[0,x/z,\[Mu],-2]+xf[0,x/z,\[Mu],-1]+xf[0,x/z,\[Mu],1]+xf[0,x/z,\[Mu],2]+xf[0,x/z,\[Mu],3]),{z,x,1},PrecisionGoal->5]]


CxF::wrongType="Variable type can be only \"direct\",\"withMIX\" or \"onlyMIX\"."
CxF[n_?IntegerQ,f_?IntegerQ,type_,x_?NumberQ,bt_?NumberQ,\[Mu]_?NumberQ]:=(Switch[type,
"direct",If[f==0,Sum[as[2,\[Mu]]^k Fgg[k,x,bt,\[Mu]],{k,0,n}],Sum[as[2,\[Mu]]^k Fqq[k,f,x,bt,\[Mu]],{k,0,n}]],
"withMIX",If[f==0,Sum[as[2,\[Mu]]^k Fgg[k,x,bt,\[Mu]],{k,0,n}]+Sum[as[2,\[Mu]]^k FggMIX[k,x,bt,\[Mu]],{k,1,n}],Sum[as[2,\[Mu]]^k Fqq[k,f,x,bt,\[Mu]],{k,0,n}]+Sum[as[2,\[Mu]]^k FqqMIX[k,f,x,bt,\[Mu]],{k,1,n}]],
"onlyMIX",If[f==0,Sum[as[2,\[Mu]]^k FggMIX[k,x,bt,\[Mu]],{k,1,n}],Sum[as[2,\[Mu]]^k FqqMIX[k,f,x,bt,\[Mu]],{k,1,n}]],
_,Message[CxF::wrongType]])/;((n==0||n==1||n==2)&&(-3<=f<=3))
CxF[n_?IntegerQ,f_?IntegerQ,x_?NumberQ,bt_?NumberQ,\[Mu]_?NumberQ]:=(
If[f==0,Sum[as[2,\[Mu]]^k Fgg[k,x,bt,\[Mu]],{k,0,n}],Sum[as[2,\[Mu]]^k Fqq[k,f,x,bt,\[Mu]],{k,0,n}]])/;((n==0||n==1||n==2)&&(-3<=f<=3))


CxFexp::wrongType="Variable type can be only \"direct\",\"withMIX\" or \"onlyMIX\"."
CxFexp[n_?IntegerQ,f_?IntegerQ,type_,x_?NumberQ,bt_?NumberQ,\[Mu]_?NumberQ,g_?NumberQ]:=(Switch[type,
"direct",If[f==0,Sum[as[2,\[Mu]]^k FggEXP[k,x,bt,\[Mu],g],{k,0,n}],Sum[as[2,\[Mu]]^k FqqEXP[k,f,x,bt,\[Mu],g],{k,0,n}]],
"withMIX",If[f==0,Sum[as[2,\[Mu]]^k FggEXP[k,x,bt,\[Mu],g],{k,0,n}]+Sum[as[2,\[Mu]]^k FggMIXEXP[k,x,bt,\[Mu],g],{k,1,n}],Sum[as[2,\[Mu]]^k FqqEXP[k,f,x,bt,\[Mu],g],{k,0,n}]+Sum[as[2,\[Mu]]^k FqqMIXEXP[k,f,x,bt,\[Mu],g],{k,1,n}]],
"onlyMIX",If[f==0,Sum[as[2,\[Mu]]^k FggMIXEXP[k,x,bt,\[Mu],g],{k,1,n}],Sum[as[2,\[Mu]]^k FqqMIXEXP[k,f,x,bt,\[Mu],g],{k,1,n}]],
_,Message[CxF::wrongType]])/;((n==0||n==1||n==2)&&(-3<=f<=3))
CxFexp[n_?IntegerQ,f_?IntegerQ,x_?NumberQ,bt_?NumberQ,\[Mu]_?NumberQ,g_?NumberQ]:=(
If[f==0,Sum[as[2,\[Mu]]^k FggEXP[k,x,bt,\[Mu],g],{k,0,n}],Sum[as[2,\[Mu]]^k FqqEXP[k,f,x,bt,\[Mu],g],{k,0,n}]])/;((n==0||n==1||n==2)&&(-3<=f<=3))


CxFrenormalon[f_?IntegerQ,x_?NumberQ,bt_?NumberQ,\[Mu]_?NumberQ,\[CapitalLambda]_?NumberQ]:=\[CapitalLambda]^2 bt^2 (1/x (NIntegrate[(2 (xf[0,x,\[Mu],f]+z (-1+z-z^2) xf[0,x/z,\[Mu],f]))/(-1+z),{z,x,1},PrecisionGoal->5]
+2 Log[1-x]xf[0,x,\[Mu],f]
-(2Log[(\[CapitalLambda] bt)/(2Exp[-EulerGamma])]+2/3)xf[0,x,\[Mu],f]))/;(f!=0)
CxFrenormalon[f_?IntegerQ,x_?NumberQ,bt_?NumberQ,\[Mu]_?NumberQ]:=CxFrenormalon[f,x,bt,\[Mu],\[CapitalLambda]QCD[2,1.]]


CxFrenormalonExp[f_?IntegerQ,x_?NumberQ,bt_?NumberQ,\[Mu]_?NumberQ,\[CapitalLambda]_?NumberQ,g1_?NumberQ,g2_?NumberQ]:=g1 bt^2 (1/x (
NIntegrate[(2 (Exp[-g2 bt^2]xf[0,x,\[Mu],f]+Exp[-z g2 bt^2] z (-1+z-z^2) xf[0,x/z,\[Mu],f]))/(-1+z),{z,x,1},PrecisionGoal->5]
+2 Log[1-x]xf[0,x,\[Mu],f]Exp[-g2 bt^2]
-Exp[-g2 bt^2](2Log[(\[CapitalLambda] bt)/(2Exp[-EulerGamma])]+2/3-g2/g1)xf[0,x,\[Mu],f]))/;(f!=0)
CxFrenormalonExp[f_?IntegerQ,x_?NumberQ,bt_?NumberQ,\[Mu]_?NumberQ,g1_?NumberQ,g2_?NumberQ]:=CxFrenormalonExp[f,x,bt,\[Mu],\[CapitalLambda]QCD[2,1.],g1,g2]


End[];
EndPackage[];
