code: def bvnu(r: Tensor, h: Tensor, k: Tensor) -> Tensor:
      r"""Solves for `P(x > h, y > k)` where `x` and `y` are standard bivariate normal
      random variables with correlation coefficient `r`. In [Genz2004bvnt]_, this is (1)
  
          `L(h, k, r) = P(x < -h, y < -k) \
          = 1/(a 2\pi) \int_{h}^{\infty} \int_{k}^{\infty} f(x, y, r) dy dx,`
  
      where `f(x, y, r) = e^{-1/(2a^2) (x^2 - 2rxy + y^2)}` and `a = (1 - r^2)^{1/2}`.
  
      [Genz2004bvnt]_ report the following integation scheme incurs a maximum of 5e-16
      error when run in double precision: if `|r| >= 0.925`, use a 20-point quadrature
      rule on a 5th order Taylor expansion; else, numerically integrate in polar
      coordinates using no more than 20 quadrature points.
  
      Args:
          r: Tensor of correlation coefficients.
          h: Tensor of negative upper bounds for `x`, same shape as `r`.
          k: Tensor of negative upper bounds for `y`, same shape as `r`.
  
      Returns:
          A tensor of probabilities `P(x > h, y > k)`.
      """
      if not (r.shape == h.shape == k.shape):
          raise UnsupportedError(
              "Arguments to `bvnu` must have the same shape."
          )
      _0, _1, lower, upper = get_constants_like(
          (0, 1) + STANDARDIZED_RANGE, r
      )
      x_free = h < lower
      y_free = k < lower
      return case_dispatcher(
          out=torch.empty_like(r),
          cases=(  # Special cases admitting closed-form solutions
              (lambda: (h > upper) | (k > upper), lambda mask: _0),
              (lambda: x_free & y_free, lambda mask: _1),
              (lambda: x_free, lambda mask: Phi(-k[mask])),
              (lambda: y_free, lambda mask: Phi(-h[mask])),
              (
                  lambda: r == _0,
                  lambda mask: Phi(-h[mask]) * Phi(-k[mask]),
              ),
              (  # For |r| >= 0.925, use a Taylor approximation
                  lambda: r.abs() >= get_constants_like(0.925, r),
                  lambda m: _bvnu_taylor(r[m], h[m], k[m]),
              ),
          ),  # For |r| < 0.925, integrate in polar coordinates.
          default=lambda mask: _bvnu_polar(r[mask], h[mask], k[mask]),
      )
  
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 2 for calling a global function with example usage: bvnu(r, h, k) and returns: case_dispatcher