anchor.diff:  110   dhd = dhd + sum * d (i)
         temp = gd / gg
         vv = zero
  -      scale = dsign (rho/sqrt(dd), gd*dhd)
  +      scale = sign (rho/sqrt(dd), gd*dhd)
         Do 120 i = 1, n
            v (i) = d (i) - temp * g (i)
            vv = vv + v (i) ** 2
  
positive.code:       dtg = zero
        Do 200 i = 1, n
  200   dtg = dtg + d (i) * gg (i)
        scale = - dsign (delta/sqrt(dsq), dtg)
        Do 210 i = 1, n
  210   d (i) = scale * d (i)
        Go To 370
  
negative.code:       tempc = halfrt * (abs(dlin)+abs(vlin)) + 0.25_wp * abs &
         (ghg+vhv)
        If (tempa >= tempb .And. tempa >= tempc) Then
           tempd = sign (rho, dlin*(vmu+vhv))
           tempv = zero
        Else If (tempb >= tempc) Then
           tempd = zero
           tempv = sign (rho, vlin*(ghg-vmu))
        Else
           tempd = sign (halfrt*rho, dlin*(ghg+vhv))
           tempv = sign (halfrt*rho, vlin*(ghg+vhv))
        End If
        Do 160 i = 1, n
  160   d (i) = tempd * d (i) + tempv * v (i)
  