
* ..File: xpns1e.f  
*
*
* ..The 1- and 2-loop MS(bar) non-singlet splitting functions P_NS^(2) 
*    for the evolution of unpolarized partons densities, mu_r = mu_f.
*    The expansion parameter is alpha_s/(4 pi).
* 
* ..The distributions (in the mathematical sense) are given as in eq.
*    (B.26) of Floratos, Kounnas, Lacaze: Nucl. Phys. B192 (1981) 417.
*    The name-endings A, B, and C of the functions below correspond to 
*    the kernel superscripts [2], [3], and [1] in that equation.
*
* ..The code uses the package of Gehrmann and Remiddi for the harmonic
*    polylogarithms published in hep-ph/0107173 = CPC 141 (2001) 296.
*
*
* =====================================================================
*
*
* ..This is the regular 2-loop piece for P_NS^+. 
*
       FUNCTION X1NSPA (X, NF)
*
       IMPLICIT REAL*8 (A - Z)
       COMPLEX*16 HC1, HC2, HC3, HC4 
       INTEGER NF, NF2, N1, N2, NW, I1, I2, I3, N
       PARAMETER ( N1 = -1, N2 = 1, NW = 4 ) 
       DIMENSION HC1(N1:N2),HC2(N1:N2,N1:N2),HC3(N1:N2,N1:N2,N1:N2), 
     ,           HC4(N1:N2,N1:N2,N1:N2,N1:N2) 
       DIMENSION HR1(N1:N2),HR2(N1:N2,N1:N2),HR3(N1:N2,N1:N2,N1:N2), 
     ,           HR4(N1:N2,N1:N2,N1:N2,N1:N2) 
       DIMENSION HI1(N1:N2),HI2(N1:N2,N1:N2),HI3(N1:N2,N1:N2,N1:N2), 
     ,           HI4(N1:N2,N1:N2,N1:N2,N1:N2) 
       PARAMETER ( Z2 = 1.6449 34066 84822 64365 D0,
     ,             Z3 = 1.2020 56903 15959 42854 D0 )
*
* ..The soft coefficient for use in X2NSPB and X2NSPC
*
       COMMON / P1SOFT / A2
*
* ...Colour factors
*
       CF  = 4./3.D0
       CA  = 3.D0
*
* ...Some abbreviations
*
       DX = 1.D0/X
       DM = 1.D0/(1.D0-X)
       DP = 1.D0/(1.D0+X)
*
* ...The harmonic polylogs up to weight 4 by Gehrmann and Remiddi
*
       CALL HPLOG (X, NW, HC1,HC2,HC3,HC4, HR1,HR2,HR3,HR4,
     ,            HI1,HI2,HI3,HI4, N1, N2) 
*
* ...The splitting function in terms of the harmonic polylogs
*    (without the delta(1-x) part, but with the soft contribution)
*
      gqq1 =
     &  + cf*ca * ( 34.D0/9.D0 - 302.D0/9.D0*x + 268.D0/9.D0*dm + 8.D0*
     &    z2*x + 8.D0*z2*dp - 8.D0*z2*dm - 22.D0/3.D0*Hr1(0) - 22.D0/3.D
     &    0*Hr1(0)*x + 44.D0/3.D0*Hr1(0)*dm - 8.D0*Hr2(-1,0) + 8.D0*
     &    Hr2(-1,0)*x + 16.D0*Hr2(-1,0)*dp - 8.D0*Hr2(0,0)*x - 8.D0*
     &    Hr2(0,0)*dp + 8.D0*Hr2(0,0)*dm )
      gqq1 = gqq1 + cf**2 * (  - 4.D0 + 4.D0*x + 8.D0*z2 - 8.D0*z2*x -
     &    16.D0*z2*dp + 8.D0*Hr1(0) - 12.D0*Hr1(0)*dm + 16.D0*Hr2(-1,0)
     &     - 16.D0*Hr2(-1,0)*x - 32.D0*Hr2(-1,0)*dp - 12.D0*Hr2(0,0) +
     &    4.D0*Hr2(0,0)*x + 16.D0*Hr2(0,0)*dp - 8.D0*Hr2(0,1) - 8.D0*
     &    Hr2(0,1)*x + 16.D0*Hr2(0,1)*dm - 8.D0*Hr2(1,0) - 8.D0*Hr2(1,0
     &    )*x + 16.D0*Hr2(1,0)*dm )
      gqq1 = gqq1 + nf*cf * (  - 4.D0/9.D0 + 44.D0/9.D0*x - 40.D0/9.D0*
     &    dm + 4.D0/3.D0*Hr1(0) + 4.D0/3.D0*Hr1(0)*x - 8.D0/3.D0*Hr1(0)
     &    *dm )
*
* ...The soft (`+'-distribution) part of the splitting function
*
       A2 = - 40.D0/9.D0*cf*nf + 268.D0/9.D0*ca*cf - 8.D0*z2*ca*cf
*
       GQQ1L = DM * A2
*
* ...The regular piece of the coefficient function
*
       X1NSPA = GQQ1 - GQQ1L
*
       RETURN
       END
*
* ---------------------------------------------------------------------
*
*
* ..This is the regular 2-loop piece for P_NS^-. 
*
       FUNCTION X1NSMA (X, NF)
*
       IMPLICIT REAL*8 (A - Z)
       COMPLEX*16 HC1, HC2, HC3, HC4 
       INTEGER NF, NF2, N1, N2, NW, I1, I2, I3, N
       PARAMETER ( N1 = -1, N2 = 1, NW = 4 ) 
       DIMENSION HC1(N1:N2),HC2(N1:N2,N1:N2),HC3(N1:N2,N1:N2,N1:N2), 
     ,           HC4(N1:N2,N1:N2,N1:N2,N1:N2) 
       DIMENSION HR1(N1:N2),HR2(N1:N2,N1:N2),HR3(N1:N2,N1:N2,N1:N2), 
     ,           HR4(N1:N2,N1:N2,N1:N2,N1:N2) 
       DIMENSION HI1(N1:N2),HI2(N1:N2,N1:N2),HI3(N1:N2,N1:N2,N1:N2), 
     ,           HI4(N1:N2,N1:N2,N1:N2,N1:N2) 
       PARAMETER ( Z2 = 1.6449 34066 84822 64365 D0,
     ,             Z3 = 1.2020 56903 15959 42854 D0 )
*
* ..The soft coefficient for use in X2NSPB and X2NSPC
*
       COMMON / P1SOFT / A2
*
* ...Colour factors
*
       CF  = 4./3.D0
       CA  = 3.D0
*
* ...Some abbreviations
*
       DX = 1.D0/X
       DM = 1.D0/(1.D0-X)
       DP = 1.D0/(1.D0+X)
*
* ...The harmonic polylogs up to weight 4 by Gehrmann and Remiddi
*
       CALL HPLOG (X, NW, HC1,HC2,HC3,HC4, HR1,HR2,HR3,HR4,
     ,            HI1,HI2,HI3,HI4, N1, N2) 
*
* ...The splitting function in terms of the harmonic polylogs
*    (without the delta(1-x) part, but with the soft contribution)
*
      gqq1 =
     &  + cf*ca * ( 178.D0/9.D0 - 446.D0/9.D0*x + 268.D0/9.D0*dm + 8.D0
     &    *z2 - 8.D0*z2*dp - 8.D0*z2*dm + 2.D0/3.D0*Hr1(0) + 2.D0/3.D0*
     &    Hr1(0)*x + 44.D0/3.D0*Hr1(0)*dm + 8.D0*Hr2(-1,0) - 8.D0*Hr2(
     &    -1,0)*x - 16.D0*Hr2(-1,0)*dp - 8.D0*Hr2(0,0) + 8.D0*Hr2(0,0)*
     &    dp + 8.D0*Hr2(0,0)*dm )
      gqq1 = gqq1 + cf**2 * (  - 36.D0 + 36.D0*x - 8.D0*z2 + 8.D0*z2*x
     &     + 16.D0*z2*dp - 8.D0*Hr1(0) - 16.D0*Hr1(0)*x - 12.D0*Hr1(0)*
     &    dm - 16.D0*Hr2(-1,0) + 16.D0*Hr2(-1,0)*x + 32.D0*Hr2(-1,0)*dp
     &     + 4.D0*Hr2(0,0) - 12.D0*Hr2(0,0)*x - 16.D0*Hr2(0,0)*dp - 8.D0
     &    *Hr2(0,1) - 8.D0*Hr2(0,1)*x + 16.D0*Hr2(0,1)*dm - 8.D0*Hr2(1,
     &    0) - 8.D0*Hr2(1,0)*x + 16.D0*Hr2(1,0)*dm )
      gqq1 = gqq1 + nf*cf * (  - 4.D0/9.D0 + 44.D0/9.D0*x - 40.D0/9.D0*
     &    dm + 4.D0/3.D0*Hr1(0) + 4.D0/3.D0*Hr1(0)*x - 8.D0/3.D0*Hr1(0)
     &    *dm )
*
* ...The soft (`+'-distribution) part of the splitting function
*
       A2 = - 40.D0/9.D0*cf*nf + 268.D0/9.D0*ca*cf - 8.D0*z2*ca*cf
*
       GQQ1L = DM * A2
*
* ...The regular piece of the coefficient function
*
       X1NSMA = GQQ1 - GQQ1L
*
       RETURN
       END
*
* ---------------------------------------------------------------------
*
*
* ..This is the singular (soft) piece.
*
       FUNCTION X1NSB (Y, NF)
       IMPLICIT REAL*8 (A - Z)
       INTEGER NF
*
       COMMON / P1SOFT / A2
*
       X1NSB  = A2/(1.D0-Y)
*
       RETURN
       END
*
* ---------------------------------------------------------------------
*
*
* ..This is the 'local' piece.
*
       FUNCTION X1NSC (Y, NF)
*
       IMPLICIT REAL*8 (A - Z)
       INTEGER NF, NF2
       PARAMETER ( Z2 = 1.6449 34066 84822 64365 D0,
     ,             Z3 = 1.2020 56903 15959 42854 D0 )
*
       COMMON / P1SOFT / A2
*
* ...Colour factors
*
       CF  = 4./3.D0
       CA  = 3.D0
*
* ...The coefficient of delta(1-x)
*
       P1DELT = 
     &     - 1.D0/3.D0*cf*nf
     &     + 3.D0/2.D0*cf**2
     &     + 17.D0/6.D0*ca*cf
     &     + 24.D0*z3*cf**2
     &     - 12.D0*z3*ca*cf
     &     - 8.D0/3.D0*z2*cf*nf
     &     - 12.D0*z2*cf**2
     &     + 44.D0/3.D0*z2*ca*cf
*
       X1NSC = LOG (1.D0-Y) * A2 + P1DELT
*
       RETURN
       END
*
* =====================================================================
*
*
* ..This is the regular 1-loop piece. 
*
       FUNCTION X0NSA (X)
       IMPLICIT REAL*8 (A - Z)
*
       CF = 4./3.D0
       X0NSA = - 2.*CF * (1.+ X)
*
       RETURN
       END
*
* ---------------------------------------------------------------------
*
*
* ..This is the singular (soft) piece.
*
       FUNCTION X0NSB (Y)
       IMPLICIT REAL*8 (A - Z)
*
       CF = 4./3.D0
       X0NSB = 4.*CF/(1.D0-Y)
*
       RETURN
       END
*
* ---------------------------------------------------------------------
*
*
* ..This is the 'local' piece.
*
       FUNCTION X0NSC (Y)
       IMPLICIT REAL*8 (A - Z)
*
       CF = 4./3.D0
       X0NSC = 4.*CF * LOG (1.D0-Y) + 3.*CF
*
       RETURN
       END
*
* =================================================================av==
