import torch


def gmof(x: torch.Tensor, sigma: float) -> torch.Tensor:
    """
    Geman-McClure error function.
    Args:
        x (torch.Tensor): Raw error signal.
        sigma (float): Robustness hyperparameter
    Returns:
        torch.Tensor: Robust error signal
    """
    x_squared =  x ** 2
    sigma_squared = sigma ** 2
    return (sigma_squared * x_squared) / (sigma_squared + x_squared)