SRC/zlaev2.f(3)
π NAME π
SRC/zlaev2.f(3) β bestie, this is the manual page for SRC/zlaev2.f, and it's lowkey one of the cutest little subroutines in LAPACK. That page name is SRC/zlaev2.f too, so likeβ¦ same energy, iykyk π
β¨ SYNOPSIS β¨
π¦ Functions/Subroutines
subroutine zlaev2 (a, b, c, rt1, rt2, cs1, sn1)β okay soZLAEV2computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix. Periodt. That's the whole vibe.
πΈ Function/Subroutine Documentation πΈ
π The subroutine itself
subroutine zlaev2 (complex*16 a, complex*16 b, complex*16 c, double
precision rt1, double precision rt2, double precision cs1, complex*16
sn1)
ZLAEV2 computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix. Literally that's what it does, and it does it slayfully β¨
π Purpose:
!>
!> ZLAEV2 computes the eigendecomposition of a 2-by-2 Hermitian matrix
!> [ A B ]
!> [ CONJG(B) C ].
!> On return, RT1 is the eigenvalue of larger absolute value, RT2 is the
!> eigenvalue of smaller absolute value, and (CS1,SN1) is the unit right
!> eigenvector for RT1, giving the decomposition
!>
!> [ CS1 CONJG(SN1) ] [ A B ] [ CS1 -CONJG(SN1) ] = [ RT1 0 ]
!> [-SN1 CS1 ] [ CONJG(B) C ] [ SN1 CS1 ] [ 0 RT2 ].
!>
So like, RT1 is the eigenvalue with the bigger absolute value, RT2 is the one with the smaller absolute value, and (CS1,SN1) is the unit right eigenvector for RT1. And that whole sandwich of matrices up there? That's the decomposition, and it's giving iconic π
π Parameters
AβAisCOMPLEX*16. It's the (1,1) element of the 2-by-2 matrix. Front row, bestie π«ΆBβBisCOMPLEX*16. It's the (1,2) element and the conjugate of the (2,1) element of the 2-by-2 matrix. Two jobs, one icon πCβCisCOMPLEX*16. It's the (2,2) element of the 2-by-2 matrix.RT1βRT1isDOUBLE PRECISION. The eigenvalue of larger absolute value. Main character eigenvalue fr fr βRT2βRT2isDOUBLE PRECISION. The eigenvalue of smaller absolute value. Still valid, still slaying, just smaller π¦CS1βCS1isDOUBLE PRECISION. (The docs literally just say that, no extra lore, so I'm not gonna invent any π)SN1βSN1isCOMPLEX*16. Together, the vector(CS1, SN1)is a unit right eigenvector forRT1. Cute couple, no cap π
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π₯ Further Details:
!>
!> RT1 is accurate to a few ulps barring over/underflow.
!>
!> RT2 may be inaccurate if there is massive cancellation in the
!> determinant A*C-B*B; higher precision or correctly rounded or
!> correctly truncated arithmetic would be needed to compute RT2
!> accurately in all cases.
!>
!> CS1 and SN1 are accurate to a few ulps barring over/underflow.
!>
!> Overflow is possible only if RT1 is within a factor of 5 of overflow.
!> Underflow is harmless if the input data is 0 or exceeds
!> underflow_threshold / macheps.
!>
π«Ά Real talk though, bestie, read that middle one again:RT2may be inaccurate if there's massive cancellation in the determinantA*C-B*B. To getRT2accurate in all cases you'd need higher precision, or correctly rounded arithmetic, or correctly truncated arithmetic. So likeβ¦ don't come forRT2when it's off, it's doing its best π
π And overflow? Possible only ifRT1is within a factor of 5 of overflow. Underflow is harmless if the input data is 0 or exceedsunderflow_threshold / macheps. Not me being dramatic, that's just the facts.
π Definition
Definition at line 120 of file zlaev2.f.
π§ Author (the meta one)
Generated automatically by Doxygen for LAPACK from the source code. So nobody hand-wrote this one, the machine did it and honestly? It ate β¨
LAPACK β Version 3.12.0 π, and that's the whole page for SRC/zlaev2.f(3) β ily, go decompose a Hermitian matrix, and remember: two-by-two is still a real matrix, you're doing amazing πππ¦
π¦ where this page comes from
- arch rolling: lapack-doc 3.12.1-2 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms