anchor.diff:  
     ! A. Mereghetti (CERN, BE-ABP-HSS)
     ! last modified: 02-04-2020
  -  ! apply kick of Chebyshev lenses
  +  ! compute (see FermiLAB-FN-0972-APC) and apply kick of Chebyshev lenses
  +  ! 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, napx, brho
     use mod_common_main
     use mathlib_bouncer
  -  use numerical_constants, only : zero, c180e0, pi, two, c1m15
  +  use numerical_constants, only : zero, one, two, c180e0, pi, c1m15, c1m3, c1e3
     use physical_constants, only: clight
   
     implicit none
  
positive.code:   integer, intent(in) :: ix
    integer, intent(in) :: n
  
    real(kind=fPrec) xx, yy, ax, ay, rr, dxp, dyp
    real(kind=fPrec) theta, angle_rad, epsilon, gteps, lteps, r1lteps, r2gteps
    integer          jj
    logical          lrotate
  
    epsilon=c1m15
    gteps=one+epsilon
    lteps=one-epsilon
  
negative.code:   lrotate = cheby_angle(icheby(ix)).ne.zero
    angle_rad = (cheby_angle(icheby(ix))/c180e0)*pi
  
    do ii=1,napx
  
      ! apply offset
      xx=xv1(ii)-cheby_offset_x(icheby(ix))
      yy=xv2(ii)-cheby_offset_y(icheby(ix))
      if (abs(xx)<epsilon) xx=zero
      if (abs(yy)<epsilon) yy=zero
  
  