def probability_of_improvement_sub(mu, std, target):
  """Sub function to compute the probability of improvement acquisition function.

  Args:
    mu: n x 1 posterior mean of n query points.
    std: n x 1 posterior standard deviation of n query points (same order as
      mu).
    target: target value to be improved over.

  Returns:
    Negative of target z-score as an equivalence of probability of improvement.
  """
  gamma = (target - mu) / std
  return -gamma