*
* ..file: xpgamp.f
*
* ..The gamma->q and gamma->g splitting functions at order a_em a_s^2
*    [normalized as a_em = alpha_em/(4 pi) and a_s = alpha_s/(4 pi)].
*    KPS2 is exact. KNS2 and KG2 are high-accuracy parametrizations
*    - the longer exact expression have not been published so far.
*
* ..The charge prefactors, delta_ns etc., have to be supplemented by 
*   the calling routine, e.g., KNS2 is delta_ns^-1 P_ns,gamma^(2).
*
* ..Reference: A. Vogt, S. Moch and J. Vermaseren,
*              hep-ph/0511112 = Acta Phys. Polon. B37 (2006) 683
*
* 
* =====================================================================
*

       SUBROUTINE XPGAMP (KNS2, KG2, KPS2, X, NF)
*
       IMPLICIT REAL*8 (A - Z)
       INTEGER NF
*
       LX  = LOG(X)
       L1X = LOG(1.D0-X)
*
       KNS20 = 128./27.D0* L1X**4 + 112./9.D0* L1X**3 + 175.3 * L1X**2 
     1         + 142.3 * L1X + 1353. - 1262.* X + 449.2 * X**2 
     2         - 1445.* X**3 - LX* L1X * (162.7 * LX + 195.4 * L1X)
     3         + 1169.* X* LX + 50.08 * (1.-X)* L1X**3 + 744.6 * LX 
     4         + 201.6 * LX**2 + 80./3.D0* LX**3 + 64./27.D0* LX**4
       KNS21 = - 32./27.D0* L1X**3 - 11.858 * L1X**2 - 18.77 * L1X
     1         - 40.035 + 114.4 * X - 24.86 * X**2 - 53.39 * X**3
     2         + LX* L1X * (8.523 * LX + 269.4 * L1X) - 26.63 * X* LX
     3         + 270.* (1.-X)* L1X**2 - 21.55 * LX - 10.992 * LX**2 
     4         - 32./27.D0* LX**3
       KNS2 = KNS20 + NF * KNS21
*
       KG20 = 32./27.D0 * L1X**3 - 79.13 * L1X**2 + 87.22 * L1X + 1738.
     1        - 1580.* X - 160.* X**2 - 566.7 * X**3 
     2        - LX* L1X * (549.5 + 1230.* LX + 433.2 * L1X) + 2176.* LX
     3        + 1123.7 * LX**2 + (2400. + 448.* LX)/27.D0 * LX**3
     4        - (73.1409 - 128./3.D0 * LX) / X
       KG21 = - 32./9.D0* L1X**2 + 16.38 * L1X + 68.10 - 36.42 * X 
     1        + 56.95 * X**2 - 44.10 * X**3 - LX* L1X * (16.18 
     2        + 38.33 * LX + 9.133 * L1X) - 10.76 * LX + 26.41 * LX**2 
     3        - 64./27.D0* LX**3 - 40.5597 / X
       KG2 = (1.-X) * (kg20 + nf * kg21) 
*
       KPS2 = ( 2464./81.D0/ X -  432. - 72.* X + 38360./81.D0* X**2
     1        - LX * ( 344. + 368.* X + 3584./27.D0* X**2 )
     2        - LX**2 * ( 144. + 104.* X + 224./9.D0* X**2 )
     3        - LX**3 * ( 16. - 16.* X - 128./9.D0* X**2 )
     4        - LX**4 * 8./3.D0* (1. - 2.* X) ) * 4./3.D0* NF
*
       RETURN
       END
*
* =================================================================av==
