Contact solver: normal mass formula

In the Box2D source code I found this formula in the contact solver code: (I changed it to fit my own engine)
Code:
rn1 = contacts[ci].xx1*contacts[ci].nx+contacts[ci].yy1*contacts[ci].ny;
rn2 = contacts[ci].xx2*contacts[ci].nx+contacts[ci].yy2*contacts[ci].ny;
normalmass = 1.0/(
contacts[ci].obj1->mass_inverted+
contacts[ci].obj2->mass_inverted+
(contacts[ci].xx1*contacts[ci].xx1+contacts[ci].yy1*contacts[ci].yy1-sqr(rn1))*contacts[ci].obj1->inertia_inverted+
(contacts[ci].xx2*contacts[ci].xx2+contacts[ci].yy2*contacts[ci].yy2-sqr(rn2))*contacts[ci].obj2->inertia_inverted);

sqr(x) is a macro for ((x)*(x)).
But here (3rd article) I found this formula:
Code:
rxn1 = contacts[ci].yy1*contacts[ci].nx-contacts[ci].xx1*contacts[ci].ny;
rxn2 = contacts[ci].yy2*contacts[ci].nx-contacts[ci].xx2*contacts[ci].ny;
normalmass = 1.0/(
contacts[ci].obj1->mass_inverted+
contacts[ci].obj2->mass_inverted+
sqr(rxn1)*contacts[ci].obj1->inertia_inverted+
sqr(rxn2)*contacts[ci].obj2->inertia_inverted);

What is the difference between these formulas? I have tested both and I don't see any difference.
Theres no difference, they are just expressed differently using the 2d identity:
a.a = (a.n)^2 + (a x n)^2
Ah, thanks. But in that case, isn't the second formula more efficient?
Quite possibly, though it depends if the terms are re-used later in the code.

Original thread: https://box2d.org/forum/viewtopic.php?t=3028