Assume
\begin{array}{l}
A = ay + x,\\
B = cy + x,\\
\therefore x\log \left( {\frac{{ay + x}}{{cy + x}}} \right) = \left( {\frac{{A - \frac{a}{c}B}}{{1 - \frac{a}{c}}}} \right)\log \left( {\frac{A}{B}} \right)
\end{array}
then you have terms like B\log \left( {\frac{A}{B}} \right) and A\log \left( {\frac{A}{B}} \right), those two can be expressed by -rel_entr(B,A)
and rel_entr(A,B)
respectively, then replace A and B back with the equations above. It might work.