def _compute_delta(log_moments, eps):
    'Compute delta for given log_moments and eps.\n\n  Args:\n    log_moments: the log moments of privacy loss, in the form of pairs\n      of (moment_order, log_moment)\n    eps: the target epsilon.\n  Returns:\n    delta\n  '
    min_delta = 1.0
    for (moment_order, log_moment) in log_moments:
        if (moment_order == 0):
            continue
        if (math.isinf(log_moment) or math.isnan(log_moment)):
            sys.stderr.write(('The %d-th order is inf or Nan\n' % moment_order))
            continue
        if (log_moment < (moment_order * eps)):
            min_delta = min(min_delta, math.exp((log_moment - (moment_order * eps))))
    return min_delta
Compute delta for given log_moments and eps.

Args:
  log_moments: the log moments of privacy loss, in the form of pairs
    of (moment_order, log_moment)
  eps: the target epsilon.
Returns:
  delta
def _compute_delta(log_moments, eps):
    'Compute delta for given log_moments and eps.\n\n  Args:\n    log_moments: the log moments of privacy loss, in the form of pairs\n      of (moment_order, log_moment)\n    eps: the target epsilon.\n  Returns:\n    delta\n  '
    min_delta = 1.0
    for (moment_order, log_moment) in log_moments:
        if (moment_order == 0):
            continue
        if (math.isinf(log_moment) or math.isnan(log_moment)):
            sys.stderr.write(('The %d-th order is inf or Nan\n' % moment_order))
            continue
        if (log_moment < (moment_order * eps)):
            min_delta = min(min_delta, math.exp((log_moment - (moment_order * eps))))
    return min_delta