def eta_from_q(q):
    """Returns the symmetric mass ratio from the given mass ratio.

    This is given by:

    .. math::
        \\eta = \\frac{q}{(1+q)^2}.

    Note that the mass ratio may be either < 1 or > 1.
    """
    return q / (1.0 + q) ** 2
