In a paper, the rotation matrix that maps a vector $g$ to another vector $e$ (assuming unit vectors) is written very neatly as (without any skew symmetric matrix operation):
$R = I_{3\times3} + 2eg^T - \frac{1}{1 + e^Tg}(e + g)(e + g)^T$
Using $g \times e$ as the rotation axis, this looks very similar to Calculate Rotation Matrix to align Vector $A$ to Vector $B$ in $3D$?, written as:
$R = I_{3\times3} + [g\times e]_\times + \frac{1}{1 + e^Tg}[g\times e]_\times^2$
with $[a]_\times$ is the $3\times3$ skew symmetric matrix form of vector $a$.
I tried these two formulas with Python and they gave the same answer. However, I'm struggling to derive one from another theoretically.