Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
@becko before posting, I tested both formulas for various values and are both ok. In particular for $a=1$ and $h=1$, the det. should in fact be $1/8$ and the last formula gives $2/(4 \cdot1) \cdot 4/(8 \cdot 2) = 1/8)$.