Consider a typical 2x2 table of frequencies (shown in this image):
Notation: The row variable is denoted R and takes on values 0 or 1; the column variable is denoted C and takes on values 0 or 1. The cells of the table indicate the frequency of each combination of R and C; for example, $b$ is the frequency of R=0 and C=1. For purposes of my question, assume that the cell counts are divided by the total, so that the cell values are the joint probabilities of the cells.
I want to express the cell probabilities in terms of the phi coefficient (which is a measure of correlation with formula provided below) and the marginal probabilities: $\mu_R\equiv p(R\!=\!1) = c+d$ and $\mu_C\equiv p(C\!=\!1) = b+d$. That is, I want to invert the following system of four equations: $$\begin{align} \phi &\equiv (ad-bc)/\sqrt{(a+b)(c+d)(a+c)(b+d)} \tag{by defn}\\ \mu_{R} &= c+d \tag{by defn}\\ \mu_{C} &= b+d \tag{by defn}\\ 1 &= a+b+c+d \tag{constraint} \end{align}$$ and, of course, $0 \le a,b,c,d \le 1$. In other words, I would like to solve for $a$, $b$, $c$, and $d$ in terms of $\phi$, $\mu_{R}$, and $\mu_{C}$.
This problem has probably been solved by somebody before, but my searches have not yielded a source, and my feeble attempts at algebra have not produced an answer, and I cannot find online system-of-(nonlinear)-equation inverters that handle this case.