parameters: (h_abs, h_abs_old, error_norm, error_norm_old)
return_statement: return factor
docstring: Predict by which factor to increase/decrease the step size.
  
      The algorithm is described in [1]_.
  
      Parameters
      ----------
      h_abs, h_abs_old : float
          Current and previous values of the step size, `h_abs_old` can be None
          (see Notes).
      error_norm, error_norm_old : float
          Current and previous values of the error norm, `error_norm_old` can
          be None (see Notes).
  
      Returns
      -------
      factor : float
          Predicted factor.
  
      Notes
      -----
      If `h_abs_old` and `error_norm_old` are both not None then a two-step
      algorithm is used, otherwise a one-step algorithm is used.
  
      References
      ----------
      .. [1] E. Hairer, S. P. Norsett G. Wanner, "Solving Ordinary Differential
             Equations II: Stiff and Differential-Algebraic Problems", Sec. IV.8.
docstring_summary: Predict by which factor to increase/decrease the step size.
docstring_tokens: Predict by which factor to increase / decrease the step size .
function: def predict_factor(h_abs, h_abs_old, error_norm, error_norm_old):
      """Predict by which factor to increase/decrease the step size.
  
      The algorithm is described in [1]_.
  
      Parameters
      ----------
      h_abs, h_abs_old : float
          Current and previous values of the step size, `h_abs_old` can be None
          (see Notes).
      error_norm, error_norm_old : float
          Current and previous values of the error norm, `error_norm_old` can
          be None (see Notes).
  
      Returns
      -------
      factor : float
          Predicted factor.
  
      Notes
      -----
      If `h_abs_old` and `error_norm_old` are both not None then a two-step
      algorithm is used, otherwise a one-step algorithm is used.
  
      References
      ----------
      .. [1] E. Hairer, S. P. Norsett G. Wanner, "Solving Ordinary Differential
             Equations II: Stiff and Differential-Algebraic Problems", Sec. IV.8.
      """
      if error_norm_old is None or h_abs_old is None or error_norm == 0:
          multiplier = 1
      else:
          multiplier = h_abs / h_abs_old * (error_norm_old / error_norm) ** 0.25
  
      with np.errstate(divide='ignore'):
          factor = min(1, multiplier) * error_norm ** -0.25
  
      return factor
function_tokens: def predict_factor ( h_abs , h_abs_old , error_norm , error_norm_old ) : if error_norm_old is None or h_abs_old is None or error_norm == 0 : multiplier = 1 else : multiplier = h_abs / h_abs_old * ( error_norm_old / error_norm ) ** 0.25 with np . errstate ( divide = 'ignore' ) : factor = min ( 1 , multiplier ) * error_norm ** - 0.25 return factor