code: def _prf_divide(numerator, denominator):
      
      result = numerator / denominator
      mask = denominator == 0.0
      if not mask.any():
          return result
  
      # remove nan
      result[mask] = 0.0
      return result
docs: Performs division and handles divide-by-zero.
  
      On zero-division, sets the corresponding result elements to zero.