logdet_spd

std.linalg.logdet_spd · Level L3

The log-determinant of a symmetric positive-definite A, from its Cholesky factor: twice the sum of the logs of L's diagonal. No determinant is ever formed, so nothing overflows.

log det A = 2·Σᵢ log Lᵢᵢ

Signature

logdet_spd(A: f64[k, k]) → f64[]

Structure

The function as NOVA stores it: one box per input, operation and output, and arrows that carry values. A double border marks another library function this one runs — called once, or by Scan once per element; select it to open that function.

Af64[k, k]CholeskyLIotaeye_rIotaeye_cEqualeyeMultiplyLdiagReduceSumdLoglogsReduceSumhalf2.0Multiplylogdetlogdetf64[]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size.
  • Agrees with the reference np.sum(np.log(np.linalg.eigvalsh(A))) to 80 digits (100-digit arithmetic), on all 40 test cases.
  • All 40 float64 results inside the running error bound; the closest uses 5% of it.
  • Interpreter and NumPy backend return bit-identical results.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
33%
bit-equal to the NumPy formula in float64
35%
largest error, in units in the last place
1.16

Identity

Calls
—
Called by
—
sha256:508e44cfaa8d23772f94679922efddc33c70f54a33811cb9274464a987bc3c9c

The semantic hash of the graph. It changes when the program changes, and never when only its documentation does.