import torch


def approx_logC(m: torch.Tensor, k: torch.Tensor) -> torch.Tensor:
    """Approximated log of normalization term for NLLvMF loss.

    Args:
        m (torch.Tensor): m value.
        k (torch.Tensor): k value.

    Returns:
        torch.Tensor: log normalization term.
    """
    t = torch.sqrt(torch.pow(m + 1, 2) + torch.pow(k, 2))
    return t - (m - 1) * torch.log(m - 1 + t)