anchor.diff:  
     ! MISCUT fourth step: deflection and length
     a = sqrt(s_F**2+(x-x_F)**2)
  -  tP = acos_mb((2*r**2-a**2)/(2*r**2))
  +  tP = acos_mb((2*(r**2)-a**2)/(2*(r**2)))
     tdefl = asin_mb((s_f-s_P)/r)
     L_chan = r*tP
   !  write(*,*) "Results", tdefl, L_chan
  
positive.code:     if(x < zero) then ! Crystal hit from below
  !      write(*,*) 'Crystal potentially hit from below'
  !      write(*,*) 'CHECK', x
        xp_tangent = sqrt((-(two*x)*c_rcurv + x**2)/c_rcurv**2)
  !      write(*,*) 'tangent', xp_tangent, xp
      else ! Crystal hit from above
  !      write(*,*) 'Crystal potentially hit from above'
  
negative.code: !  A_F = tan_mb(cry_bend)**2 + one
  !  B_F = -two*tan_mb(cry_bend)**2*c_rcurv + two*tan_mb(cry_bend)*s_P -two*x_P
  !  C_F = tan_mb(cry_bend)**2*c_rcurv**2 - two*tan_mb(cry_bend)*s_P*c_rcurv + s_P**2 + x_P**2 - r**2
    A_F = (tan_mb(length/c_rcurv))**2 + one
    B_F = ((-two)*(tan_mb(length/c_rcurv))**2)*c_rcurv + (two*tan_mb(length/c_rcurv))*s_P - two*x_P
    C_F = ((tan_mb(length/c_rcurv))**2)*(c_rcurv**2) - ((two*tan_mb(length/c_rcurv))*s_P)*c_rcurv + s_P**2 + x_P**2 - r**2
  
    x_F = (-B_F-sqrt(B_F**2-four*(A_F*C_F)))/(two*A_F)
  !  s_F = -tan_mb(cry_bend)*(x_F-c_rcurv)
    s_F = (-tan_mb(length/c_rcurv))*(x_F-c_rcurv)
  !  write(*,*) "F", s_F, x_F
  !  write(*,*) "F-K", s_F-s_K, x_F-x_K
  !  write(*,*) "F-M", s_F-s_M, x_F-x_M
  