It might help you to write it correctly: it should be
(a^2+b^2+c^2)/2abc = cos(alpha)/a + cos(beta)/b + cos(gamma)/c
which is rather different from what you wrote. (Notice the first parenthesis pair?)
Since you mention the cosine law in your title, I guess you know that