      SUBROUTINE SMOOTH(Y,MU,X)
************************************************************************
*                                                                      *
*     Uniform smoothing function: PHI=(X+mu/2)^2/2/mu                  *
*                                                                      *
************************************************************************
*
      REAL*8 X,Y,MU,TMP
*
      TMP=2.0*X
      IF(TMP.GT.MU) THEN
        Y=X
        ELSE IF(TMP.LT.(-MU)) THEN
          Y=0.0
        ELSE
          Y=(TMP+MU)/MU
          Y=(TMP+MU)*Y/8.0
      ENDIF
*
      RETURN
      END
*
*
      SUBROUTINE SMOOTHM(Y,MU,X)
************************************************************************
*                                                                      *
*     derivative w.r.t. epsilon                                        *
*                                                                      *
************************************************************************
*
      REAL*8 X,Y,MU,TMP
*
      TMP=2.0*X
      IF(TMP.GT.MU) THEN
        Y=0.0
        ELSE IF(TMP.LT.(-MU)) THEN
          Y=0.0
        ELSE
          Y=(TMP+MU)/MU
          Y=(MU-TMP)/MU/8.0
      ENDIF
*
      RETURN
      END
*
*
      SUBROUTINE SMOOTHX(Y,MU,X)
************************************************************************
*                                                                      *
*     derivative w.r.t. x                                              *
*                                                                      *
************************************************************************
*
      REAL*8 X,Y,MU,TMP
*
      TMP=2.0*X
      IF(TMP.GT.MU) THEN
        Y=1.0
        ELSE IF(TMP.LT.(-MU)) THEN
          Y=0.0
        ELSE
          Y=(MU+TMP)/MU/2.0
      ENDIF
*
      RETURN
      END
*
*
