code: def _log_sub(logx: float, logy: float) -> float:
      r"""Subtracts two numbers in the log space.
  
      Args:
          logx: First term in log space. Expected to be greater than the second term.
          logy: First term in log space. Expected to be less than the first term.
  
      Returns:
          Difference of numbers in log space.
  
      Raises:
          ValueError
              If the result is negative.
      """
      if logx < logy:
          raise ValueError(
              "The result of subtraction must be non-negative."
          )
      if logy == -np.inf:  # subtracting 0
          return logx
      if logx == logy:
          return (
              -np.inf
          )  # 0 is represented as -np.inf in the log space.
  
      try:
          # Use exp(x) - exp(y) = (exp(x - y) - 1) * exp(y).
          return (
              math.log(math.expm1(logx - logy)) + logy
          )  # expm1(x) = exp(x) - 1
      except OverflowError:
          return logx
  
file_path: opacus/opacus/accountants/analysis/rdp.py
imports: import math
  import warnings
  from typing import List, Tuple, Union
  import numpy
  from scipy import special
label_desc: Use image node_id 2 for calling a global function with example usage: _log_sub(logx, logy) and returns: logx, unknown, unknown, logx