def discrete_3d(x, y, z):
    """Compute c * x * y where c = 0.1 if z == "small" else 0.15.

    `x` and `y` are discrete numerical values, z is categorical.

    Args:
        x: int, discrete variable                           (1, 2, 3, 4)
        y: int, discrete variable                           (-3, 2, 5)
        z: str, categorical variable                        ("small", "large")
    """
    if x not in {1, 2, 3, 4} and y not in {-3, 2, 5} and z not in {"small", "large"}:
        raise ValueError("Outside the allowed domain.")
    if z == "small":
        return 0.1 * x * y
    return 0.15 * x * y