anchor.diff:    goto 10
   
   20 continue
  -  call k2coll_scamcs(z,zp,s,radl_mat)
  +  call k2coll_scamcs(z,zp,s)
     s  = s*radl(mat)
     x  = (x*theta)*radl(mat)
     xp = xp*theta
  
positive.code: end subroutine k2coll_soln3
  
  !>
  !! k2coll_scamcs(xx,xxp,s,radl_mat)
  !! ???
  !<
  subroutine k2coll_scamcs(xx,xxp,s,radl_mat)
  
    use mathlib_bouncer
    use mod_ranlux
  
    implicit none
  
    real(kind=fPrec) v1,v2,r2,a,z1,z2,ss,s,xx,xxp,x0,xp0
    real(kind=fPrec) radl_mat
  
    x0=xx
    xp0=xxp
  
  5 v1=2d0*real(rndm4(),fPrec)-1d0
    v2=2d0*real(rndm4(),fPrec)-1d0
    r2=v1**2+v2**2
    if(r2.ge.1.d0) goto 5
  
    a=sqrt((-2.d0*log_mb(r2))/r2)
    z1=v1*a
    z2=v2*a
    ss=sqrt(s)
    xx=x0+s*(xp0+(half*ss)*(one+0.038_fPrec*log_mb(s))*(z2+z1*0.577350269_fPrec)) !Claudia: added logarithmic part in mcs formula
    xxp=xp0+ss*z2*(one+0.038_fPrec*log_mb(s))
  end subroutine k2coll_scamcs
  
  subroutine k2coll_iterat(a,b,dh,s)
  
    implicit none
  
    real(kind=fPrec) ds,s,a,b,dh
  
    ds=s
  10 ds=ds*half
  
    if(s**3.lt.(a+b*s)**2) then
      s=s+ds
    else
      s=s-ds
    end if
  
    if(ds.lt.dh) then
      return
    else
      goto 10
  
negative.code:   call k2coll_soln3(ae,be,dh,rlen,s)
    if(s < h) s = h
  
    call k2coll_scamcs(x,xp,s)
    if(x <= zero) then
      s = (rlen0-rlen)+s
      goto 20
  