def convert_speed(speed: float, unit_from: str, unit_to: str) -> float:
    if unit_to not in speed_chart or unit_from not in speed_chart_inverse:
        raise ValueError(
            f"Incorrect 'from_type' or 'to_type' value: {unit_from!r}, {unit_to!r}\n"
            f"Valid values are: {', '.join(speed_chart_inverse)}"
        )
    return round(speed * speed_chart[unit_from] * speed_chart_inverse[unit_to], 3)