Binary cross Entropy derivative?
Here is the definition of cross-entropy for Bernoulli random variables $\operatorname{Ber}(p),\operatorname{Ber}(q)$, taken from Wikipedia:
$$
H(p,q) = p \log \frac{1}{q} + (1-p) \log \frac{1}{1-q}.
$$
This is exactly what your first function computes.
The partial derivative of this function with respect to $p$ is
$$
\frac{\partial H(p,q)}{\partial p} = \log \frac{1}{q} - \log \frac{1}{1-q} = \log \frac{1-q}{q}.
$$
The partial derivative of this function with respect to $q$ is
$$
\frac{\partial H(p,q)}{\partial q} = -\frac{p}{q} + \frac{1-p}{1-q} = \frac{(1-p)q-p(1-q)}{q(1-q)} = \frac{q-p}{q(1-q)}.
$$
This is exactly what your third function computes.
I'm not sure what your second function computes. Also, there is no reason to expect that the partial derivative with respect to one variable will be the same as the partial derivative with respect to another variable.