code: def log_cdf_robust(x: Tensor) -> Tensor:
      r"""Computes the logarithm of the normal cumulative density robustly. This uses
      the approximation log(1-z) ~ -z when z is small:
  
      if x > 5:
          log(cdf(x)) = log(1-cdf(-x)) approx -cdf(-x)
      else:
          log(cdf(x)).
  
      Args:
          x: a `x_shape`-dim Tensor.
  
      Returns
          A `x_shape`-dim Tensor.
      """
      CLAMP_LB = torch.finfo(x.dtype).eps
      NEG_INF = torch.finfo(x.dtype).min
      normal = Normal(torch.zeros_like(x), torch.ones_like(x))
      cdf_x = normal.cdf(x)
      neg_cdf_neg_x = -normal.cdf(-x)
      log_cdf_x = torch.where(x < 5, torch.log(cdf_x), neg_cdf_neg_x)
  
      return log_cdf_x.clamp(NEG_INF, -CLAMP_LB)
  
imports: from __future__ import annotations
  from typing import Any, Optional, Tuple
  import torch
  from botorch.acquisition.acquisition import AcquisitionFunction
  from botorch.exceptions import InputDataError
  from botorch.exceptions.errors import UnsupportedError
  from botorch.models.model import Model
  from botorch.models.model_list_gp_regression import ModelListGP
  from botorch.models.utils import check_no_nans
  from botorch.utils.transforms import concatenate_pending_points, t_batch_mode_transform
  from torch import Tensor
  from torch.distributions import Normal
label_desc: Use image node_id 1 for calling a global function with example usage: log_cdf_robust(x) and returns: log_cdf_x