code: def _bvnu_polar(
      r: Tensor, h: Tensor, k: Tensor, num_points: Optional[int] = None
  ) -> Tensor:
      r"""Solves for `P(x > h, y > k)` by integrating in polar coordinates as
  
          `L(h, k, r) = \Phi(-h)\Phi(-k) + 1/(2\pi) \int_{0}^{sin^{-1}(r)} f(t) dt \
          f(t) = e^{-0.5 cos(t)^{-2} (h^2 + k^2 - 2hk sin(t))}`
  
      For details, see Section 2.2 of [Genz2004bvnt]_.
      """
      if num_points is None:
          mar = r.abs().max()
          num_points = 6 if mar < 0.3 else 12 if mar < 0.75 else 20
  
      _0, _1, _i2, _i2pi = get_constants_like(
          values=(0, 1, 0.5, _inv_2pi), ref=r
      )
  
      x, w = leggauss(num_points, dtype=r.dtype, device=r.device)
      x = x + _1
      asin_r = _i2 * torch.asin(r)
      sin_asrx = (asin_r.unsqueeze(-1) * x).sin()
  
      _h = h.unsqueeze(-1)
      _k = k.unsqueeze(-1)
      vals = safe_exp(
          safe_sub(
              safe_mul(sin_asrx, _h * _k),
              _i2 * (_h.square() + _k.square()),
          )
          / (_1 - sin_asrx.square())
      )
      probs = Phi(-h) * Phi(-k) + _i2pi * asin_r * (vals @ w)
      return probs.clip(min=_0, max=_1)
  
file_path: botorch/botorch/utils/probability/bvn.py
imports: from __future__ import annotations
  from math import pi
  from typing import Optional, Tuple
  import torch
  from botorch.exceptions import UnsupportedError
  from botorch.utils.probability.utils import case_dispatcher, get_constants_like, leggauss, ndtr, phi, STANDARDIZED_RANGE
  from botorch.utils.safe_math import div, exp, mul, sub
  from torch import Tensor
label_desc: Use image node_id 3 for calling a global function with example usage: _bvnu_polar(r, h, k, num_points) and returns: probs