def twist_log_constant(mu, cov, A, b):
    """
    compute the auxiliary twisting log constant

    arguments
        mu : jnp.array(Dx)
            mean vector
        cov : jnp.array(Dx)
            covariance vector
        A : jnp.array(Dx)
            A twisting vector
        b : jnp.array(Dx)
            b twisting vector

    returns
        out : float
            twisting log constant
    """
    term1 = -(mu/(2.*cov)).dot(mu)
    l_r_terms = mu/cov - b
    inner = l_r_terms / (2./cov + 4.*A)
    return term1 + inner.dot(l_r_terms)