anchor.diff:    ! A. Mereghetti (CERN, BE-ABP-HSS)
     ! last modified: 06-04-2020
     ! apply kick of Chebyshev lenses (FOX)
  +  ! NB: for derivatives of polynomials, do not follow what is suggested by
  +  !     G.Stancari, but get d(Tn(u))/du from its definition
   
     use mod_common, only : beta0, mtcda, brho
     use mod_settings, only : st_debug
  
positive.code: !FOX  D V DA INT RADIO NORD NVAR ;
  !FOX  D V DA INT UU    NORD NVAR ;
  !FOX  D V DA INT VV    NORD NVAR ;
  !FOX  D V DA INT FU    NORD NVAR ;
  !FOX  D V DA INT FV    NORD NVAR ;
  !FOX  D V DA INT THETA NORD NVAR ;
  !FOX  D V DA INT TX    NORD NVAR 21 ;
  !FOX  D V DA INT TY    NORD NVAR 21 ;
  
negative.code: !FOX  TPX(2)=ONE ;
  !FOX  TPY(2)=ONE ;
      do NN=3,morder+1
        MM=NN-1
        OO=NN-2
  !FOX  TX(NN)=(TWO*(UU*TX(MM)))-TX(OO) ;
  !FOX  TY(NN)=(TWO*(VV*TY(MM)))-TY(OO) ;
        ! use definition of derivative applied to definition of polynomial:
        ! d/du Tn(u)= d/du[ 2u*T_(n-1)(u)-T_(n-2)(u) ] = 2T_(n-1)(u) +2u*T'_(n-1)(u) -T'_(n-2)(u)
        !           = 2(T_(n-1)(u) +u*T'_(n-1)(u))-T'_(n-2)(u)
  !FOX  TPX(NN)=TWO*(TX(MM)+UU*TPX(MM))-TPX(OO) ;
  !FOX  TPY(NN)=TWO*(TY(MM)+VV*TPY(MM))-TPY(OO) ;
      end do
      
      ! get kicks
  