parameters: (dF, F, dx_norm, x_norm, ratio, ftol, xtol)
docstring: Check termination condition for nonlinear least squares.
docstring_summary: Check termination condition for nonlinear least squares.
docstring_tokens: Check termination condition for nonlinear least squares .
function: def check_termination(dF, F, dx_norm, x_norm, ratio, ftol, xtol):
      """Check termination condition for nonlinear least squares."""
      ftol_satisfied = dF < ftol * F and ratio > 0.25
      xtol_satisfied = dx_norm < xtol * (xtol + x_norm)
  
      if ftol_satisfied and xtol_satisfied:
          return 4
      elif ftol_satisfied:
          return 2
      elif xtol_satisfied:
          return 3
      else:
          return None
function_tokens: def check_termination ( dF , F , dx_norm , x_norm , ratio , ftol , xtol ) : ftol_satisfied = dF < ftol * F and ratio > 0.25 xtol_satisfied = dx_norm < xtol * ( xtol + x_norm ) if ftol_satisfied and xtol_satisfied : return 4 elif ftol_satisfied : return 2 elif xtol_satisfied : return 3 else : return None