This should be a well known methodology by now, but it seems to not be.
In statistical work, one frequently sees the expression where the absolute value means determinant of covariance matrix . With large covariances, the calculations can easily overflow, but usually the finally value is a reasonable finite number.
The covariance is key, as it allows us to compute a Cholesky decomposition of first, which is quite numerically stable. We will have two triangular matrices whose determinants are the products of their diagonals (proof left as an exercise to the reader). Taking the log of that will transform the product to a sum!
Thus where is the diagonals of the matrices. You’ll find that this will rarely overflow, and possibly (depending on how sophisticated the determinant calculation is) speed up the work!