def symmetric_mass_ratio(m_1, m_2, M=None):
    """
    Compute the symmetric mass ratio, ``eta``, given the component masses,
    ``m_1`` and ``m_2``. Can optionally provide the total mass, ``M``, to save
    re-computing it with ``M = m_1 + m_2``.

    **Parameters**

    m_1: array-like, shape = S
        The mass of the first binary object.

    m_2: array-like, shape = S
        The mass of the second binary object.

    M: array-like, shape = S (optional)
        The total mass of the binary.

    **Returns**

    eta: array-like, shape = S
        The symmetric mass ratio of the binary.
    """
    if M is None:
        M = m_1 + m_2
    return m_1 * m_2 * M ** -2
