def METHOD_NAME(self, x: torch.Tensor, lower_bound: float, upper_bound: float):
    """
    Test that `acos_linear_extrapolation` returns correct values for
    `x` between/above/below `lower_bound`/`upper_bound`.
    """
    x.requires_grad = True
    x.grad = None
    y = acos_linear_extrapolation(x, [lower_bound, upper_bound])
    # compute the gradient of the acos w.r.t. x
    y.backward(torch.ones_like(y))
    dacos_dx = x.grad
    x_lower = x <= lower_bound
    x_upper = x >= upper_bound
    x_mid = (~x_lower) & (~x_upper)
    # test that between bounds, the function returns plain acos
    self.assertClose(x[x_mid].acos(), y[x_mid])
    # test that outside the bounds, the function is linear with the right
    # slope and continuous around the bound
    self._test_acos_outside_bounds(
        x[x_upper], y[x_upper], dacos_dx[x_upper], upper_bound
    )
    self._test_acos_outside_bounds(
        x[x_lower], y[x_lower], dacos_dx[x_lower], lower_bound
    )