On the reduction of generalized polylogarithms to Lin and Li2,2 and on the evaluation thereof

We give expressions for all generalized polylogarithms up to weight four in terms of the functions log, Lin, and Li2,2, valid for arbitrary complex variables. Furthermore we provide algorithms for manipulation and numerical evaluation of Lin and Li2,2, and add codes in Mathematica and C++ implementing the results. With these results we calculate a number of previously unknown integrals, which we add in appendix C.


Introduction
In the recent decades, the Standard Model of particle physics has been established as extremely successful, due to its high level of agreement with the data provided by numerous experiments.In order to further test the Standard Model, or possibly discover new physics, we need to both predict and measure the values of many observables with even higher accuracy.
From the theoretical side, which is the focus of this paper, this necessitates the computation of higher order corrections in perturbation theory, and for that purpose new mathematical techniques to compute loop integrals become desirable.A large class of dimensionally regularized Feynman loop-integrals can be expressed in terms of generalized (or Goncharov) polylogarithms (GPLs) (in the mathematical community these are also known as hyperlogarithms).Those special functions were originally introduced by Kummer [1] and Poincaré [2], then further studied by Chen [3], and brought to the attention of the physics community by Goncharov [4,5].
In [28] it was conjectured that all GPLs up to weight four, which includes all GPLs needed for two-loop calculations, can be expressed in terms of logarithms, the classical polylogarithms Li n (x) (n ≤ 4), and one extra special function denoted by Li 2,2 (x, y).In the same reference it was explicitly shown that the conjecture holds true for a subset of GPLs, denoted harmonic polylogarithms (HPLs), up to weight four.A number of physical calculations of two-loop Feynman integrals with several scales, e.g.[29][30][31][32][33] have hinted at the truth of that conjecture, and in this paper we will show it explicitly.Additionally we provide a library of all the GPLs up to weight four, containing the reduction to the previously named functions that is valid for arbitrary complex variables.
Since the logarithm and classical polylogarithm are well-known functions, efficient algorithms for their numerical evaluation have been widely studied and developed.On the other hand, the GiNaC implementation of Vollinga and Weinzierl [34] is the only publicly available program which can efficiently evaluate the special function Li 2,2 (x, y) for any set of complex arguments 1 .In this paper we provide an independent algorithm and a numerical code for the efficient evaluation of Li n (x) and Li 2,2 (x, y).
Thus the tools for the complete reduction and evaluation of any GPL up to weight four are made available with this paper.
The paper is organized as follows: In sect. 2 we define the GPL functions and review some of their main properties.In sect. 3 we provide some relations that are useful for the reduction of GPLs, and in sect.4 we provide some explicit expressions for the reductions.In sect.5 we describe the Crandall [36] algorithm for the evaluation of Li n (x), and propose our modified version.In sect.6 we propose an algorithm to evaluate the Li 2,2 (x, y) function, and in sect.7 we describe the added code containing our implementation of the algorithms and reduction.Finally in sect.8 we discuss our results and propose some directions for further research.
In appendix A we provide some relations for Li 2,2 (x, y), and in app.B we provide details on certain expansions for Li 2,2 (x, y).In app.C we list some integrals that to the best of our knowledge are unknown, and in app.D some further expressions involving hypergeometric functions.In app.E we give explicit expressions for all GPLs at weight 3 and some further relations.

Generalized polylogarithms
GPLs [2,4,5] are defined recursively as with G(0, . . ., and with the integration path being a straight line from 0 to the generally complex x.GPLs satisfy a large number of relations between themselves.Primary is the rescaling relation G(a 1 , . . ., a n ; x) = G(za 1 , . . ., za n ; zx) , (2.3) where z is a general complex number different from zero.The relation is valid whenever a n = 0. From eq. ( 2.3) we see that the full set of arguments of a general G(a 1 , . . ., a n ; x) is redundant, as one, conventionally x, may always be put to one by setting z = x −1 .For the case of complex x, this x → 1 rescaling may be used to ensure that the naive integration path of eq.(2.1) is the correct one.
Additionally there are the shuffle rules [37] G(a 1 , . . ., a m ; x)G(b 1 , . . ., b n ; x) = c∈aXb G(c 1 , . . ., c m+n ; x) , (2.4) where aXb denotes the shuffle product of the lists a and b, which is defined as the set of all lists containing exactly the elements of a and b, for which the ordering of the elements of a and b are preserved.Note that while the rescaling property of eq.(2.3) is not directly valid for a n = 0, we may apply it if we first shuffle the zero away using eq.(2.4).Only if all the a i are zero we cannot rescale x → 1, but in this case we can use the definition of eq.(2.2).In practice we can therefore study G(a 1 , . . ., a n ; 1) without any loss of generality.
GPLs are equivalent to another class of functions, the multiple polylogarithms (MPLs), which are defined 2 by the sum Li m 1 ,...,mn (x 1 , . . ., .5)The relation between the two classes is or correspondingly The MPLs obey a class of relations denoted as the stuffle 3 rules [20,37].Just as the shuffle rules were based on the shuffle product, the stuffle rules are based on the stuffle product defined as where a and b are lists, • is an operator, and where the operator M a,b,• (x) acting on a list x, gives the set of all list which may be obtained by taking two adjacent elements of x and turning them into one element equaling the original two joined by the operator •, under the condition that one of the two elements come from a, and the other from b.We see that the maximal value taken by j equals the length of the shortest of the lists a and b.Additionally we define M of a set of lists (the way it is applied in eq.(2.8)) to be the union of the results of applying M to the individual members of the set, i.e. (2.9) We note that the operator * should be applied at the purely symbolic level, which means that even if some members of a and/or b are numerically identical they should still be treated as different by the operator.With these definitions and considerations in place, the stuffle rules are given as 2 We note that the literature is split rather evenly on how to define MPLs.We are using the same definition as e.g.[34,38], while [28,39] where the first four terms correspond to j = 0 in eq.(2.8), while the last three correspond to j = 1.Note that the stuffle algebra and the shuffle algebra are independent structures [37,40], giving complementary relations among the MPLs and consequently the GPLs.One additional identity between the GPLs is the Hölder relation [37] G(a 1 , . . ., a n ; 1) = which holds when a 1 = 1 and a n = 0, and where q may take values in a subset of C which includes the real numbers.GPLs can be assigned the property of weight corresponding to the number of logarithmic integrations [20] in (2.1), such that G(a 1 , . . ., a n ; x) has weight n.This implies that log(x) has weight 1, Li n (x) has weight n, and Li m 1 ,...,mn (x 1 , . . ., x n ) has weight n i=1 m i .Additionally a product of two functions with respective weights m and n is assigned weight m + n.We see that most of the equations in this paper conserve this quantity explicitly.
Some useful relations can be obtained by integration by parts Note from the last expression that the sum G(z 1 , z 2 , . . ., z n ; 1) + (−1) n G(z n , . . ., z 1 ; 1) can be expressed as a combination of lower weight GPLs.Furthermore, following eq.(2.1) we may evaluate GPLs of weight n by an n-dimensional numerical integration; on the other hand by iterating the expression of eq.(2.14) (and recalling that G(z; t) = log(1 − t/z)) we may reduce the total number of dimensions of the integration from n to n/2.A possible numerical implementation of a weight n GPL is by evaluating the weight n − 1 GPL that appears on the r.h.s. of eq.(2.1) by its series representation as in eqs.(2.5, 2.7) and then numerically performing the last single integration in eq.(2.1).By the use of eq.(2.14) the GPLs only need to be evaluated up to weight n − 2 instead, and then integrated over one dimension in order to evaluate a GPL of weight n.
A further relation can be obtained from eq. (2.14) in case of one or more zero letters As can be seen from eq. (2.1), the GPLs are in general not well defined whenever any of the letters a 1 , . . ., a n lie exactly along the integration path that is the straight line in complex space connecting the origin and the argument x, i.e. if a i /x ∈ (0, 1).There is a discontinuity whenever a i crosses the straight line connecting the origin and the (fixed) argument x and these lines also define exactly all the branch cuts of the GPLs.Therefore, whenever a i /x ∈ (0, 1) an infinitesimal perturbation in x (or equivalently in the letters because of eq. ( 2.3)) is required such as to make the GPL well defined.An example of such a perturbation is to multiply the argument by a factor 1 ± i where afterwards the limit → 0 is taken.The usual adopted convention is to take 1 − i [34,41].
Up to weight three, it is known [28,42] that all GPLs can be expressed as combinations of the functions log(x), Li 2 (x), and Li 3 (x).In [28] a minimal basis of functions at higher weights were proposed, and specifically it was proposed that at weight four the additional basis functions Li 4 (x) and Li 2,2 (x, y) are required, where the latter, in accordance with eq.(2.6), may be expressed as 4Li 2,2 (x, y) = G(0, 1 x , 0, 1 xy ; 1).
Notice that for instance Li 3,1 (or Li 1,3 ) may be chosen as a basis functions instead of Li 2,2 since they are related as given in eq.(E.16).In the following two sections, 3 and 4, we will show that this conjecture is correct and also present some explicit expressions for GPLs up to weight four.The relations presented in this section are not the only ones satisfied by the GPLs.Numerous other structural relations exist which are discussed in detail elsewhere, see for instance [28,34,37,40,43].
For a further reduction of the above basis integrals, we can use relations found by recursively expressing GPLs with argument 1 − x in terms of GPLs with argument x.These and other similar transformation rules were discussed in ref. [34], albeit not in the context of GPL reduction.At weights one and two the relations take the following form The function T(a, b; x) equals one whenever the point x lies inside the triangle spanned by the three points 0, a and b in the complex plane and zero otherwise (see fig. 1).It may be expressed as where x denotes the complex conjugate of x.At weight three the corresponding relation is with see fig. 1 for the geometric meaning of the point P(a, b; x).Finally at weight four the relation reads In the relations (3.2), (3.4) and (3.6) above, the letters a, b, c are assumed to be different from each other and non-zero.The relations follow a pattern and can be extended to these cases and also to higher weights.The crucial point here is that the above formulae are exact for any complex values of the parameters5 .This is achieved by the introduction of the "triangle" function T in (3.3), which appears naturally when performing the integrals recursively while taking into account the pole of the integrand.In particular, the functions T appearing in the expressions above cancel exactly the discontinuities [39] along spurious branch cuts, in the complex plane of the letters a, b, c for any fixed x, that are introduced by the various GPLs in the expression.At the same time they also correctly reproduce the discontinuities along the true branch cuts of the corresponding GPL.The simplest case where this can be seen is the weight two formula (3.2): the branch cuts in the complex plane of a along the two lines connecting the pairs of points (1, 1 − x) and (0, 1) respectively are removed by the last term −2πi sgn(Im(a)) T(1, x; 1 − a) G(0; 1 − a).Simultaneously, this same term correctly reproduces6 the discontinuity along the branch cut connecting the true branch points 0 and 1 − x.Whenever any of the letters a, b, c lie exactly on the lines defining the triangle function T, one encounters an undefined θ(0) and an infinitesimal perturbation of x is required to remove the letter off of the line such that the appearance of θ(0) is avoided 7 .If the letters lie along a spurious branch cut, the result will be independent of the exact value of the in the complex space of a corresponds to three lines connecting the pairs of points (0, x), (0, 1) and (1, x) in the complex space of 1−a which equals exactly the three sides of the triangle defined by T(1, x; 1−a) in fig. 1.Using the fact that the discontinuity of the functions log(x) and Li2(x) along their branch cuts equal 2πi and 2πi log(x) respectively, one may see that the discontinuity of G(1−a, 0; x) = G(1−a; x)G(0; x)−G(0, 1−a; x) and G(1 − a, 0; 1) = −G(0, 1 − a; 1) along the lines connecting the points (1, 1 − x) and (0, 1) respectively is exactly 2πi G(0; 1 − a).It can similarly be shown that 2πi G(0; 1 − a) is the correct discontinuity of G(a, 1; 1 − x) along the true branch cut. 7For the sgn factors in the expression a zero as argument is not an issue, since whenever sgn(0) appears it will multiply a vanishing T function.
perturbation in x, as long as it is small enough and does not result in the crossing of a true branch cut by the letters.However if any of the letters lie along a true branch cut of the GPL, i.e. if for example a/(1 − x) ∈ (0, 1), a perturbation in x is required to make the GPL well defined to begin with (we refer to the discussion below eq.(2.15)), which will then make sure that again a θ(0) in T is avoided.These considerations are for example already required for the stuffle identities (2.10) and similar issues have also been discussed about in the context of GPL identities [28] and Feynman integrals [32].Lastly it is important to note that all the triangle functions T in the relations (3.2), (3.4) and (3.6) vanish whenever the absolute values of the letters a, b, c are larger than one and the absolute value of the argument 1 − x.
The letters appearing in the above 1 − x transformation rules are all of the form one minus the letter in the original GPL.In particular the GPLs of highest weight that appear on the right hand sides of the relations have one letter equal to zero.Therefore if we start with any GPL up to weight four and then rescale for example its rightmost letter to one, assuming it is non-zero, and afterwards apply (3.2), (3.4) and/or (3.6), one may express any GPL of weight n ≤ 4 in terms of a sum of weight n GPLs where at least one letter is set to zero plus a combination of lower weight GPLs.In general when the GPL has n 0 letters that are the same, we may rescale all of them to one and apply similar relations as above to express it in terms of weight n GPLs with all least n 0 zero letters plus a combination of lower weight GPLs.In this way the basis integrals are further reduced to weight 1 : G(a; 1) weight 2 : G(0, a; 1) weight 3 : G(0, a, b; 1), G(0, 0, a; 1) weight 4 : G(0, a, b, c; 1), G(0, a, 0, b; 1), G(0, 0, 0, a; 1). (3.7) Before continuing we will mention one alternative to the 1 − x identities.That is applying the Hölder convolution (2.13), such that any GPL of arbitrary weight n may be expressed in terms of GPLs with weight n with at least one letter equal to zero, plus a combination of lower weight GPLs We have applied (2.13) twice on the term G (z 1 , . . ., z n−1 , 1; 1) in the above equation, namely once for the first equation with q = x and once again with q = 0 resulting in the second equation, both times assuming z 1 = 1.Yet for our reductions we have not used the Hölder convolution but instead the 1−x identities in (3.2), (3.4) and (3.6) as previously mentioned.
In the next section we give expressions for G(0, a, b; 1) and G(0, a, b, c; 1) that can be reduced to classical polylogarithms and Li 2,2 .Therefore the final set of basis functions up to weight four will be shown explicitly to be the logarithm, the classical polylogarithms Li 2 , Li 3 , and Li 4 , and the function Li 2,2 , which can itself not be further reduced to polylogarithms and which therefore may be considered as a candidate for a standard function.

Expressions for GPLs
In this section we list expressions for some GPLs of weight ≤ 4, that are valid for all values of the complex parameters and depend only on rational combinations of the letters.At weight one, two expressions are enough to describe the entire complex domain At weight two we likewise have to have separate expressions depending on whether the letters are zero or non-zero, and also depending on whether or not they are equal The latter of the above expressions is our first example in which a single expression is insufficient to cover all complex values of the function arguments.However, if we admit Heaviside θ functions in our expressions we may use eq.(3.2) to write the latter expression as where the function T is given in the previous section.This approach of writing the GPLs as single expressions with possible θ functions is so general that it extends to weight four as we will show explicitly in the following.For the remainder of this section we will without loss of generality rescale the argument x to one.At weight three we may apply eq.(3.4) to express a GPL in terms of weight three GPLs with at least one letter being zero plus a combination of lower weight GPLs.The remaining function which is required according to eq. (3.7) is therefore The above expression may be obtained by extending the derivations and results in section 8.4 of [42] to the whole complex plane.It is valid whenever a and b are different and non-zero.The function H 1 that appears in eq.(4.4) above is defined as8 The above expressions explicitly reproduce the known result [28,42] that GPLs up to weight three can be expressed in terms of Li 3 , Li 2 and logarithms for any complex values of the parameters.The explicit results for all GPLs at weight 3 are given in app.E.
According to the list (3.7), at weight four we need to compute the function G(0, a, b, c; 1), which is related by shuffle identities to G(a, b, c, 0; 1).Assume henceforth that the arbitrary complex letters a, b, c are different and non-zero.In order to compute G(0, a, b, c; 1), G(a, 0, b, c; 1), G(a, b, 0, c; 1) and G(a, b, c, 0; 1) we consider directly their definition in eq.(2.1) and plug in the analytic expressions of the weight three GPLs found above.By subtracting contributions to the above four GPLs that do not integrate directly to Li 2,2 or Li n≤4 by standard integration techniques, and relating the remainders denoted below as G, by stuffle identities it follows that G(a, b, c, 0; 1) can be expressed as The last function S(a, b, c, 0; 1) in eq.(4.6) is given in app.E and is combination of GPLs up to weight 3, while is the remaining contribution from G(a, 0, b, c; 1) that does integrate directly to Li 2,2 and Li n≤4 by standard integration techniques.Note that all GPLs shown in eq.(4.6) have at least two zero letters and may therefore be expressed in terms of Li 2,2 , polylogarithms and logarithms.What is thus left is to express G(a, 0, b, c; 1) in terms of Li 2,2 and polylogarithms.For this purpose the following observation is useful, namely whenever x ∈ [0, 1] where the function H 2 is defined as The first two terms in eq.(4.8) are exactly the integrand in eq.(4.7) and therefore, by direct integration, we finally get   Lastly, we note that eq.(4.8) may be used to derive an alternative expression for G(0, a, b; 1) that contains the function H 2 , which is itself related to the triangle function T (cf.eq.(4.9)), instead of the function H 1 as in eq.(4.4).Therefore all GPLs up to weight four are in principle fully expressible in terms of the basis functions and only the triangle function T. However, in our ancillary files we kept the expression (4.4) for G(0, a, b; 1) in terms of the function H 1 as it is more compact.
To conclude this section, we have explicitly shown here that the conjecture posed in [28] is correct, namely that all GPLs up to weight four are expressible in terms of Li 2,2 , Li 4 , Li 3 , Li 2 and logarithms.Furthermore, in the ancillary files we give explicitly a replacement rule which can be applied to map any GPL up to weight four to the basis functions for all complex values of the parameters.With these GPLs fully reduced, we will in the remaining sections discuss the algorithms we use to numerically evaluate the basis functions.

Numerical evaluation of classical polylogarithms
The classical (or Euler) polylogarithm Li n (x) is defined recursively as with This implies the relation Additionally Li n may be expressed as the integral which follows from eq. (2.15).From eq. (2.5) we get the summed expression which converges whenever |x|≤ 1.When |x|> 1, Li n (x) may be mapped into the convergent region using the inversion relation [42] Li Close to |x|= 1, the sum of eq.(5.5) converges slowly, making it unsuited for numerical evaluation.An alternative and widely used algorithm was proposed by R. E. Crandall in ref. [36], and is based on an expansion in the logarithm of the argument of the Li n (x), in order to obtain an expression that converges quickly even when |x|≈ 1 and n is a small number.
The algorithm which we propose in the current section is based on similar considerations.The expansion in question is [36,42] Li where α = − log(x), H n denote the harmonic numbers, and ζ(x) the Riemann zeta function.

Specifically this gives
Li Li The factorial decay of the terms in eq.(5.8) makes it converge faster than the defining sum of eq.(5.5), and for that reason eq.(5.8) is desirable for numerical evaluation.Crandall's algorithm evaluates Li n by eq.(5.5) for |x|< x 0 where typically x 0 = 1/2, by eq.(5.6) for |x|> |1/x 0 |, and by eq.(5.8) for |x 0 |≤ x ≤ |1/x 0 |.There is, however, an expression with a similar factorial convergence, that expands Li n (1 − e −α ) instead, and which thus is suitable inside the convergent region of eq.(5.5).That expression [34,44] For n = 2 this simplifies to with no such simplifications for higher n.In any case, the coefficients C n,j in (5.11) can be calculated once and stored in the numerical code, such that recalculating them is not needed when evaluating the Li n in a specific point.In our algorithm, we choose to evaluate Li n (x) using eqs.(5.8) and (5.10) together with the inversion formula eq.(5.6) to map to the convergent regions.We use eq.(5.10) whenever Re(x) ≤ 1 2 and |x|≤ 1, eq. (5.8) whenever Re(x) > 1 2 and |x − 1|≤ 1, and eq.(5.6) combined with eq.(5.10) otherwise.See fig. 2.
For a detailed discussion of the evaluation of classical polylogarithms and the relations between them, see [34,42].
6 Numerical evaluation of Li 2,2 (x, y) Li 2,2 (x, y) is, as can be seen from eq. (2.5), defined as the sum which converges whenever |x|≤ 1 and |xy|≤ 1. Additionally it may be expressed as a GPL through eq.(2.16), and as the one-dimensional integral which follows from eq. (2.15).Outside the region of convergence of eq.(6.1) two relations are needed in order to map to the convergent region.One is the stuffle relation (eq.(2.10)) which for the case of Li and which is seen to effectively swap the two arguments.The other needed relation is which is our generalization of the inversion relation eq.(5.6) for the case of Li n , to Li 2,2 .
As for other similar relations, this inversion relation requires non-zero imaginary parts on x, y, and xy in order to be guaranteed correct.That eqs.(6.3) and (6.4) together can map the whole phase space to the convergent region can be realized from table 1.That algorithm lays the basis for our implementation of Li 2,2 .
Due to the slow convergence of eq.(6.1) for values of |x| or |xy| close to one, it is desirable to use another, faster converging expression for these regions in the spirit of eqs.
(5.10) and (5.8) for Li n .In ref. [34] eq.(5.10) is generalized to a larger class of functions, the harmonic polylogarithms, a class which does not include Li 2,2 .Yet following steps similar to those of section 4.3 of ref. [34] we derive (see appendix B for more details) where and where the Cs denote constants for which the expressions are given in appendix B, but which may be calculated once and stored, an approach which we use for our implementation.Also eq.(5.8) may be generalized to the case of Li 2,2 (x, y) (see appendix B for more details) with the result where where F(α, β, ξ 0 ) is a rather simple function given in appendix B. Expressions for the ξ 0dependent coefficients K are likewise given in appendix B, but note that for a fixed value of ξ 0 , the coefficients may be calculated once and stored as it was the case for eq.(6.5).A larger value of the parameter ξ 0 decreases the convergence rate of the series expansions in α, β in (6.7), while simultaneously increasing the convergence rate of the two MPLs on the last line of eq.(6.7).We have chosen the fixed value ξ 0 = 1 for our implementation.where the latter is taken to be K A ij + K B ij log( β) + K C ij log( β + ξ 0 ) evaluated at β = 2 and ξ 0 = 1.The faster convergence of eq.(6.7) (as a function of the number of terms) is clearly visible.
Unlike the case for Li n , it is not always preferable to use eqs.(6.5) or (6.7) instead of the original defining sum eq.(6.1) for reasons of timing.We realize that a precision corresponding to terminating the sum of eq. ( 6.1) at i = N will include around N 2 /2 terms.But from the factorization property of eq.(6.1), i.e. the fact that it can be written as ij f (i)g(j), one may realize that a proper recursive implementation of the sum will scale10 as only 2N , i.e. linearly rather than quadratically.This property is not (seemingly) shared by the logarithmic expansions of eqs.(6.5) or (6.7), thus while their faster convergence corresponds to a smaller value of N (as shown in fig.3), their timing will still be worse in most cases.
For our implementation we split the evaluation of Li 2,2 (x, y) into a number of regions, as illustrated in fig.defining sum eq.(6.1).In region B we combine it with stuffle (eq.( 6.3)), in region C with inversion (eq.( 6.4)) and in region D with both.In regions E we apply a resummed version of eq. ( 6.1) in which we analytically perform the sum of the 'diagonal' terms with fixed i − j.In the sub-regions it gets combined with E A : nothing, E B : stuffle, E C : inversion, E D : stuffle and inversion.F GH on the left figure denotes an area in which both |x| and |xy| are close to one.In that case we use the regions shown on the right figure.In regions F we apply the Hölder formula eq.(2.13) with q = 2 to map to the convergent region (see [34]), and in the sub-region F B this is combined with the stuffle relation.In regions G we apply eq.(6.5), and finally in region H, when one of the variables are close to (actual) one, we apply eq.(6.7).Additionally we choose (everywhere except in regions A and B) to use the formulae of app.A when applicable.

Considerations on series acceleration
In order to improve the numerical convergence of Li 2,2 (x, y) for (|x|∼ 1, |y|∼ 1) we have tried different strategies.For instance we tried to perform the analytic continuation of the series of eq.(6.1) from x = 0 to x = x 0 , where for example x 0 = −1/2.We also tried to apply some series acceleration techniques that are explained for example in refs.[45][46][47] 11 .Unfortunately, to the best of our knowledge, no transformation that works for our specific problem is known.For any transformation that we attempted the convergence is improved in some specific values of (x, y) but not in others, without any obvious pattern.
For this reason, we decided against using such a procedure, even though it would be interesting to perform more detailed studies in this direction.

The added code
Alongside the paper we publish a number of ancillary files containing our implementation of the results from the previous four sections and from appendix C.These are gtolrules.m,gtolexample.nb,lievaluate.cpp,constants.cpp,lievaluateexample.cpp,lievaluateinterface.tm, MakefileLinux, MakefileMAC, and interfaceexample.nb.

The reductions
The file gtolrules.mcontains the implementation of the relations mapping GPLs to log, Li n , and Li 2,2 as described in sections 3 and 4. It has been implemented such that G(a 1 , . . ., a n ; x) have separate relations for any combinations of a i = a j , a i = x, and a i = 0 (the trivial cases of x = 0 are treated separately).This means that for instance at weight two there are separate relations for G(0, 0; x), G(0, x; x), G(0, a; x), G(x, 0; x), G(a, 0; x) , G(x, x; x), G(a, a; x), G(x, a; x), G(a, x; x), G(a, b; x) . (7.1) Whenever G(a 1 , . . ., a n ; x) has x = a 1 , the result will diverge (unless x = a 1 = 1 and a 2 = • • • = a n = 0), as can be seen from the definition of eq. ( 2.1) and from the specific expressions in section 4. That divergence is made explicit in the replacement rules by isolating it as powers of the divergent G(x; x) which we express in Mathematica as the symbol log0.This is done using the shuffle rules of eq.(2.4) as described in ref. [48].Thus for example the divergent G(x, a; x) is implemented as While this treatment of divergences has been applied systematically, there may still be ambiguities with the divergences since no specification of the way the diverging limit is taken is given.We advise the user to take systematic care of any divergences before applying our reductions.Specifically the reduction is implemented in Mathematica as a set of replacement rules named gtolrules.Applying gtolrules to an expression containing a symbolic function called G of two 12 to five arguments, will apply the mappings to the Gs and express the result in terms of the symbolic functions MyLog, MyLi, and MyLi22, and the symbolic functions denoted by MyT, MyP, MyR, MyH1, and MyH2, which correspond to the various combinations of Heaviside θ-functions described in sections 3 and 4. The Heaviside θ-function and sgnfunction themselves are denoted by MyTH and MyS respectively in the replacements rules.Additionally gtolrules.mcontains the replacement rules logback which substitutes Log and PolyLog for MyLog and MyLi, and the replacement rules thetaback which substitutes the expressions for the θ-functions in.
gtolrules.m also contains our results of the 13 integrals listed in appendix C.They are implemented as the replacement rule itogrules, which replace the symbolic function I1 to I13 as defined in the appendix, with their expressions in terms of GPLs.
The Mathematica notebook gtolexample.nbcontains an example of the use of these replacement rules.

Performance of 'lievaluate'.
The precision of the double format used by C++ allows for 15-17 significant digits.Due to numerical instabilities we do not always attain that level of precision, but of 10000 evaluations of li22(x,y) of random 13 arguments, none had a relative deviation (i.e.2| a−b a+b |) from the true value greater than 10 −13 .We have also performed many tests in extreme cases, such as cases with arguments very close to zero or one, and found similar levels of agreement.

Discussion
In this paper we presented relations expressing any generalized polylogarithm up to weight four in terms of a basis of logarithms, classical polylogarithms, and the function Li 2,2 .Additionally we presented algorithms allowing the evaluation of these functions anywhere in complex phase space.
To express a Feynman integral expressible in terms of GPLs, using such a basis, may be done in general using the symbol map [5,28] and its co-product based generalization [39] in which a minimal basis of functions gets fitted to the 'symbol' of the Feynman integral.The expressions presented in this paper will not in general produce as compact expressions, since the functional basis used in section 4 is calculated at the level of the individual GPL, rather than at the level of the entire expression.Additionally our expressions for the reductions have not been fully simplified or optimized with respect to size or computation time.
Yet from the point of view of numerical evaluation of GPLs of general complex variables, we believe our method to be highly competitive.When faced with this problem one previously had three options.A generally inefficient numerical integration, such as the one described below eq.(2.14), a potentially highly demanding reduction using symbols, and an iterated series of algebraic manipulations of the GPLs as implemented for example in GiNaC [34], which in the end potentially requires the evaluation of a vastly increased number of GPLs.
In conclusion, our expressions should firstly be regarded as a proof of concept that such a reduction is possible in all cases, something which was only conjectured in [28], and additionally as an alternative way to obtain numerical expressions for GPLs using only numerical implementations of Li n and Li 2,2 , such as those described in sections 5 and 6 and added as described in section 7.
We regard our over-all approach to the evaluation of Li 2,2 , as described in table 1, to be solid.But the expressions, eqs.(6.5) and (6.7) that we use for the evaluation in slowly convergent regions have room for improvement.Perhaps it is possible to resum some of the terms, or reexpress them in a way that allows for a quicker evaluation as it is the case for the defining sum of eq.(6.1).Another option could be to continue the investigation of the series acceleration techniques mentioned at the end of section 6.
There is nothing which in principle prevents the approach used in this paper from being extended to higher weights, such as the six which are needed for three-loop calculations.
Extending to weight six is conjectured in ref. [28] to require the extra special functions Li 2,3 , Li 2,4 , Li 3,3 , and Li 2,2,2 , and they may likely be evaluated using an approach similar to that which we propose for Li 2,2 .The reduction to such a set, will require the evaluation of a large number of integrals, similar to higher weight versions of those listed in section 4 and appendix C, and it is that step which we believe to be the biggest obstacle for continuing.
It is occasionally needed to take limits of Li 2,2 (x, y).When one of the arguments goes to zero and the other remains finite, the function vanishes as per eq.(A.1).When one of the two arguments diverge and the other stays non-zero, the function diverges and the divergence may be extracted as powers of logarithms using the inversion relations eqs.(5.6) and (6.4).Finally when one argument diverges and the other vanishes, we have the limits There are also a number of relations for Li 2,2 that are of a general nature.Examples are the stuffle relation eq. ( 6.3) and the inversion relation eq. ( 6.4) mentioned in the main text.Another relation worth mentioning is the duplication relation [40] Li 2,2 (x, y)

B Details of Li 2,2 expressions
In this appendix we sketch the derivations of eqs.(6.5) and (6.7) and list the constants appearing in their expressions.
In order to derive eq (6.5), we start from eq. ( 6.2) and apply variable substitutions where We expand all terms by the following Note the last expression is equivalent to eq. (5.12).After performing all integrations we obtain eq.(6.5).
The constants of eq.(6.5) are To obtain eq. ( 6.7), one splits up the integral (6.2) in two integrals, namely over the two intervals [0, exp(−ξ 0 )] and [exp(−ξ 0 ), 1], where ξ 0 is an arbitrarily chosen positive number. where and In the first integral f 1 one rescales the variable as t → t/exp(−ξ 0 ) and expresses the integral in terms of a sum of an Li 2,2 and Li 1,2 with argument (xe −ξ 0 , y).For ξ 0 large enough, one may then safely use the convergent series expressions (2.5) in this interval.
For the second integral f 2 one applies the following expansion formulas where The first equation in eqs.(B.7) is equivalent to the second equation in eqs.(B.2), while the second equation is the same as the first one in eqs.(5.9).By computing all resulting integrals one finds eq.(6.7).The additive function F(α, β, ξ 0 ) is given as Im(α) 0 otherwise .

(B.10)
For the constants K (which still have dependence on the free parameter ξ 0 ) we use (B.8) and then

C Table of integrals
The importance of GPLs is due to the fact they allow the integration (at least formally) of a large class of functions, by applying algebraic rules starting from the definition of the GPL, given by eq.(2.1).For example can easily be integrated in terms of GPLs by applying the shuffle rule of eq. ( 2.4) on the numerator and partial fractioning on the denominator.Furthermore for both of the following integrals the integration can be performed by integration by parts.In practice any combination of GPLs and rational functions can be formally integrated by the use of GPLs.Here we provide an example, where we can formally integrate a large class of integrals containing logarithms (assuming that the b i are all different) where the tuple T n ({a 1 , . . ., a m }) is the set of all possible vectors of dimension n, made up of all possible combinations and orders of the elements a 1 , . . ., a n .For example T 2 ({a, b, c}) = {{a, a}, {a, b}, {a, c}, {b, a}, {b, b}, {b, c}, {c, a}, {c, b}, {c, c}} .
If the result of the integral is a combinations of GPLs of weights ≤ 4, it is now possible to explicitly express it in terms of the basis functions by using the results of this paper.Here we list some of the most useful integrals, of which some have been known for a long time [42,44].We do however explicitly perform the analytic continuation and extend the integrals to the full complex plane of the variables.Furthermore we extend the list of integrals to more complicated cases, including cases with results involving Li 2,2 , which to the best of our knowledge are generally unknown.In order to obtain expressions in terms of log, Li n , and Li 2,2 , all that is needed it to combine the expressions of this appendix with the reductions described in sections 3 and 4. The expressions in this appendix are included in an auxiliary file, as explained in section 7. From now on, in order to keep the list of integrals relatively short, we will include only the most general cases without considering null letters or letters equaling each other, since they can be easily obtained with a similar strategy.

D Series expansions of hypergeometric functions
GPLs can be used to obtain, in some cases, a series expansion of hypergeometric functions in a purely algebraic way.Alternative methods are already available as explained in [49][50][51][52].
Here we consider an different approach, inspired by the integration technique used in [53], which is in turn inspired by well established integration techniques, see for instance [54,55].
Let us consider as an example the following Euler's expression where B(b, c) is the beta function, 2 F 1 is the Gauss hypergeometric and |z|≤ 1.In practice one may require some expansion in terms of the small parameter of the integral in eq.(D.1).The procedure is as follows.The first step is to perform the following expansions Note that the first expression eq.(D.2) is valid for any complex x, while the second eq.(D.3) is in general valid only for real x (but still allows for a complex parameter a).Generally this is not a problem, since x is the integration variable as in eq.(D.1).
As a second step we can substitute the expansion for each term in the integrand in eq.(D.1) The third step is to truncate the sums at the desired order, work out the products and apply the shuffle algebra.For example we may compute the result up to 2 1 0 At this point the integration is performed term by term via integration by parts and applying the definition eq.(2.1).
In principle this technique can be applied to any integrand involving an arbitrarily complicated product of n terms, and the expansion can be computed up to arbitrary order in .However there are three main issues.First of all the method cannot be generally applied to arbitrary powers.For example a term x 1/2+ will generally lead to non-rational functions and then the result cannot be expressed in terms of GPLs.A second problem can arise in the case of nested integrations over different variables.For example, after integrating eq.(D.5) the resulting GPLs will be dependent on the variable z in their letters as G(. . ., f (z), . . .; 1).At a second integration step we may want to integrate over the variable z.It is possible to rewrite any GPL in standard form G(. . .; z) for any rational functions in z (at least in principle), but it is not always possible for non-rational expressions (see [43]).Actually both these problems are related to the fact that not all hypergeometric functions can be expanded as combinations of GPLs, but require more general functions.
The third problem is related to possible divergences.This problem can be solved by subtracting the main divergent part as follows (see [53]).Let's consider for simplicity an integrand with a divergence in x = 0 as for example x −1+ f (x) where f (x) is regular at x = 0. Then Since f (0) is just a constant, the first integral on the right can be integrated analytically, while the second is regularized since f (x) − f (0) is not only finite, but goes to zero at least linearly in x.For example we can consider the following integration (D.9) Note that the right sum in eq.(D.8) has lower limit one, due to the procedure of subtracting the divergence.
In case the previously explained problems do not appear, the procedure presented in this appendix is suitable for an automatized implementation in a computer code.Furthermore, for expansions including GPLs up to weight 4, we can obtain analytic results as explained in sects.3 and 4.

E Specific expressions for GPLs
This appendix contains the explicit expressions 14 for all GPLs at weight 3.In principle, expressions for these GPLs can be partially obtained for example by the code Mathematica, but once different scales are present the results will not be in a form which is valid everywhere, as the full analytic structure will be absent.The results presented in this appendix are obtained using the methods described in sections 3 and 4. The function S(a, b, c, 0; 1) that appears in eq.(4.6) and which only depends on GPLs up to weight 3 is given at the end of this appendix.For the definitions of the functions T, H 1 and P appearing in the expressions see sects. 3 and 4. (E.16) The function S(a, b, c, 0; 1) that appears in eq.(E.17) use the opposite definition in which the ordering of the indices is reversed, i.e.Lim 1 ,...,mn (x1, . . ., xn) = ∞ 0<k 1 <•••<kn x where the sets of lists u = m * + n and z = x * × y (2.11) are assigned the same ordering.An example of the use of the stuffle rules is the relation Li

Figure 1 .
Figure1.This figure shows the triangle that is spanned by the points 0, a and b in the complex plane.The function T as given by eq.(3.3) evaluates to one whenever the point x is inside the triangle, and to zero otherwise.P(a, b; x) denotes the point where the radial line going through x and the line between a and b cross.

17
).We refer to the ancillary files for the explicit expressions for G(0, a, b, c; 1), G(a, b, c, d; 1) and similarly for the cases where some letters coincide.The functions H 1 and H 2 serve a similar purpose as the "triangle" function T for the 1 − x identities discussed in the previous section.They cancel discontinuities along spurious branch cuts and contribute to the correct discontinuities along true branch cuts in eqs.(4.4) and (4.8) respectively.The way of circumventing the appearance of an undefined θ(0) by small perturbations of the parameters as discussed below eq.(3.6) applies similarly for the eqs.(4.3), (4.4), (4.8) and (4.10).

Figure 2 .
Figure 2.This figure shows which expression for Li n (x) is used for which values of x.In region A we use eq.(5.10), in region B we use eq.(5.8), and in region C we use eq.(5.6) to map into region A with C 1 mapping to A 1 and C 2 to A 2 .

Figure 3 .
Figure 3.This figure shows the values of the coefficients of eq.(6.1) (blue) and eq.(6.7) (red) where the latter is taken to be K A ij + K B ij log( β) + K C ij log( β + ξ 0 ) evaluated at β = 2 and ξ 0 = 1.The faster convergence of eq.(6.7) (as a function of the number of terms) is clearly visible.

4 . 2 πFigure 4 .
Figure 4.This figure is a slightly simplified illustration of the regions into which we split the evaluation of Li 2,2 (x, y) as described in the main text.ϕ z on the right figure refers to the phase of the complex z.Not shown on the figure is the fact that region C is used in place of D whenever |x|> 3.5.