parameters: (Delta, actual_reduction, predicted_reduction,
                       step_norm, bound_hit)
return_statement: return Delta, ratio
docstring: Update the radius of a trust region based on the cost reduction.
  
      Returns
      -------
      Delta : float
          New radius.
      ratio : float
          Ratio between actual and predicted reductions. Zero if predicted
          reduction is zero.
docstring_summary: Update the radius of a trust region based on the cost reduction.
docstring_tokens: Update the radius of a trust region based on the cost reduction .
function: def update_tr_radius(Delta, actual_reduction, predicted_reduction,
                       step_norm, bound_hit):
      """Update the radius of a trust region based on the cost reduction.
  
      Returns
      -------
      Delta : float
          New radius.
      ratio : float
          Ratio between actual and predicted reductions. Zero if predicted
          reduction is zero.
      """
      if predicted_reduction > 0:
          ratio = actual_reduction / predicted_reduction
      else:
          ratio = 0
  
      if ratio < 0.25:
          Delta = 0.25 * step_norm
      elif ratio > 0.75 and bound_hit:
          Delta *= 2.0
  
      return Delta, ratio
function_tokens: def update_tr_radius ( Delta , actual_reduction , predicted_reduction , step_norm , bound_hit ) : if predicted_reduction > 0 : ratio = actual_reduction / predicted_reduction else : ratio = 0 if ratio < 0.25 : Delta = 0.25 * step_norm elif ratio > 0.75 and bound_hit : Delta *= 2.0 return Delta , ratio