I didn't understand what you said cuz I am not familiar with the language but still I see an equation which can be solved.
x = (4x-12)/x-4
(x-4)(x) = (4x-12)
x²-4x = 4x-12
x²+12 = 8x
(x²+4²-2.x.4)-4=0
(x-4)²=4
x-4 = 2
x = 2
If it was what was supposed to do then Please Thank it.