<<PolylogTools`

I51[x_,y_]:=G[y,0,0,0,0,x,1];
I51p[x_,y_]:=I51[x,y]+I51[x,1/y];
L6[x_]:=-G[0,0,0,0,0,1/x,1];
N6[x_] := G[0, 0, 0, 0, 1, 1, x];

SetAttributes[L6sym,HoldAll];
Options[L6sym]={oneOverY->False,oneMinusOneOverX->False};
L6sym[coeff_,arg_,opts:OptionsPattern[]]:=Module[{oneOverYTF,oneMinusOneOverXTF,coeffs,args},(
oneOverYTF=OptionValue[oneOverY]==True;
oneMinusOneOverXTF=OptionValue[oneMinusOneOverX]==True;

coeffs={Hold[coeff]};
args={Hold[arg]};

If[oneMinusOneOverXTF,
coeffs=Join[coeffs,coeffs, coeffs];
args=Join[args,args/.{x->1-1/x},args/.{x->1/(1-x)}];];

If[oneOverYTF,coeffs=Join[coeffs,coeffs];
args=Join[args,args/.{y->1/y}];];

Return[Plus@@Release[MapThread[#1 L6i[#2]&,{coeffs,args}]]];
)];

L6iinv[arg_]:=If[Sort[Factor[{arg,1/arg}]][[1]]===Factor[arg],L6i[Factor[arg]],-L6i[Factor[1/arg]]];
L6can[expr_]:=expr/.L6i[arg_]:>L6iinv[arg]

(* -------------- *)

i51terms = I51p[x,y]+I51p[1-1/x,y]+I51p[1/(1-x),y];

+ I51[1,x] - (N6[x] - 5L6[x] )//CreateTensor//sh//flatTensor//Expand

li6termsFull = 2N6[y]-L6i[1-x]-L6i[(1/x)]+L6i[((-1+x)/x)]+2 L6i[1-y]+L6i[(1/((-1+x) (-1+y)))]+L6i[((-1+x)/(-1+y))]+L6i[-(1/(x (-1+y)))]+L6i[-((-1+x)/(x (-1+y)))]+L6i[-(x/(-1+y))]+L6i[-(x/((-1+x) (-1+y)))]+(1/9) L6i[-((-1+y)/((-1+x) x (y^2)))]+(1/9) L6i[-(((((-1+x))^2) (-1+y))/(x (y^2)))]+(1/9) L6i[(((x^2) (-1+y))/((-1+x) (y^2)))]+4 L6i[(1/y)]+(5/2) L6i[-(1/((-1+x) y))]-(5/2) L6i[-((-1+x)/y)]-(5/2) L6i[(1/(x y))]+(5/2) L6i[((-1+x)/(x y))]+(5/2) L6i[(x/y)]-(5/2) L6i[(x/((-1+x) y))]-(1/9) L6i[-((-1+x)/((x^2) (-1+y) y))]-(1/9) L6i[(x/((((-1+x))^2) (-1+y) y))]-(1/9) L6i[(((-1+x) x)/((-1+y) y))]+2 L6i[((-1+y)/y)]-L6i[-((-1+y)/((-1+x) y))]-L6i[-(((-1+x) (-1+y))/y)]-L6i[((-1+y)/(x y))]-L6i[(((-1+x) (-1+y))/(x y))]-L6i[((x (-1+y))/y)]-L6i[((x (-1+y))/((-1+x) y))]+(1/18) L6i[-(((-1+x) (((-1+y))^2))/((x^2) y))]+(1/18) L6i[((x (((-1+y))^2))/((((-1+x))^2) y))]+(1/18) L6i[(((-1+x) x (((-1+y))^2))/y)];

li6termsShort =   2 N6[y] + 4 L6i[(1/y)]+
+L6sym[-(1/9),(((-1+x) x)/((-1+y) y)),{oneMinusOneOverX->True,oneOverY->True}]+
+L6sym[1, (1/((-1+x) (-1+y))),{oneMinusOneOverX->True,oneOverY->True}]+
+L6sym[1,((-1+x)/(-1+y)),{oneMinusOneOverX->True,oneOverY->True}]+
+L6sym[(5/2),-(1/((-1+x) y)),{oneMinusOneOverX->True,oneOverY->True}]+
+L6sym[(1/36),(((-1+x) x (((-1+y))^2))/y),{oneMinusOneOverX->True,oneOverY->True}]+
+L6sym[(1/2),((-1+x)/x),{oneMinusOneOverX->True,oneOverY->True}]+
+L6sym[(2/3),1-y,{oneMinusOneOverX->True,oneOverY->True}];

li6termsFull - li6termsShort//L6can//Expand

result = i51terms - li6termsFull/.{L6i->L6,I51i->I51};

tensor=result//CreateTensor//sh//flatTensor//Expand

(* --------- *)

(2 N6[y] + 4 L6[(1/y)]) - (N6[y] + N6[1/y])//CreateTensor//sh//flatTensor//Expand

-2 L6[x] - 2 L6[1/(1-x)] - 2 L6[1-1/x] + N6[x] + N6[1/(1-x)] + N6[1-1/x]//CreateTensor//sh//flatTensor//Expand