laev2(3)
β¨ laev2(3) β the 2x2 eig situation π
Okay bestie, sit down, grab a strawberry π, because we're talking about laev2 β the laev2: 2x2 eig of the LAPACK library functions manual. It's the little family of subroutines that computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix. Yes, only 2-by-2. Yes, it's iconic. No cap.
πΈ SYNOPSIS πΈ
π«Ά Functions
subroutine claev2 (a, b, c, rt1, rt2, cs1, sn1)βCLAEV2computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix.subroutine dlaev2 (a, b, c, rt1, rt2, cs1, sn1)βDLAEV2computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix.subroutine slaev2 (a, b, c, rt1, rt2, cs1, sn1)βSLAEV2computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix.subroutine zlaev2 (a, b, c, rt1, rt2, cs1, sn1)βZLAEV2computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix.
π Detailed Description π
Honestly? This section of the original is just vibes β a heading with nothing under it, and then Function Documentation right after. Not me pointing that out. π Either way, the actual content lives in the per-function docs below, and they are so good.
π Function Documentation π
π¦ subroutine claev2 (complex a, complex b, complex c, real rt1, real rt2, real cs1, complex sn1)
CLAEV2 computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix. That's the whole brand. π
β¨ Purpose β¨
!> CLAEV2 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 β you hand it the Hermitian matrix, it hands you back the eigenvalues sorted by absolute value (biggest first, RT1) and the unit right eigenvector for RT1 as (CS1, SN1). The factorization is literally spelled out above, keep it in your notes. π
π Parameters π
AβA is COMPLEX. The (1,1) element of the 2-by-2 matrix.BβB is COMPLEX. The (1,2) element and the conjugate of the (2,1) element of the 2-by-2 matrix.CβC is COMPLEX. The (2,2) element of the 2-by-2 matrix.RT1βRT1 is REAL. The eigenvalue of larger absolute value.RT2βRT2 is REAL. The eigenvalue of smaller absolute value.CS1βCS1 is REAL. (That's the whole description, bestie, it's giving mystery. π΅οΈ)SN1βSN1 is COMPLEX. The vector(CS1, SN1)is a unit right eigenvector for RT1.
π 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.
!>
Lowkey important:RT1is accurate to a few ulps barring over/underflow, butRT2can be inaccurate if there's massive cancellation in the determinantA*C-B*Bβ you'd need higher precision or correctly rounded or correctly truncated arithmetic to getRT2right in all cases. π Don't come forRT2, it's doing its best.
Also: overflow only happens if RT1 is within a factor of 5 of overflow, and underflow is harmless if the input data is 0 or exceeds underflow_threshold / macheps. Slay. π₯
Definition at line 120 of file claev2.f.
π§ subroutine dlaev2 (double precision a, double precision b, double precision c, double precision rt1, double precision rt2, double precision cs1, double precision sn1)
DLAEV2 computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix. Same energy, double precision edition. π
β¨ Purpose β¨
!> DLAEV2 computes the eigendecomposition of a 2-by-2 symmetric matrix
!> [ A B ]
!> [ 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 SN1 ] [ A B ] [ CS1 -SN1 ] = [ RT1 0 ]
!> [-SN1 CS1 ] [ B C ] [ SN1 CS1 ] [ 0 RT2 ].
Note the vibe shift: this one's a plain symmetric matrix, so no CONJG anywhere, just B twice. The math ate, honestly. π½οΈ
π Parameters π
AβA is DOUBLE PRECISION. The (1,1) element of the 2-by-2 matrix.BβB is DOUBLE PRECISION. The (1,2) element and the conjugate of the (2,1) element of the 2-by-2 matrix.CβC is DOUBLE PRECISION. The (2,2) element of the 2-by-2 matrix.RT1βRT1 is DOUBLE PRECISION. The eigenvalue of larger absolute value.RT2βRT2 is DOUBLE PRECISION. The eigenvalue of smaller absolute value.CS1βCS1 is DOUBLE PRECISION. (Again, no elaboration. Mysterious queen. π)SN1βSN1 is DOUBLE PRECISION. The vector(CS1, SN1)is a unit right eigenvector for RT1.
π 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.
!>
Same caveats, same accuracy tea. π΅ RT1 is accurate to a few ulps barring over/underflow; RT2 may be inaccurate if there's massive cancellation in the determinant A*C-B*B; 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.
Definition at line 119 of file dlaev2.f.
πΈ subroutine slaev2 (real a, real b, real c, real rt1, real rt2, real cs1, real sn1)
SLAEV2 computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix. Single precision, real numbers, no complexes invited. π
β¨ Purpose β¨
!> SLAEV2 computes the eigendecomposition of a 2-by-2 symmetric matrix
!> [ A B ]
!> [ 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 SN1 ] [ A B ] [ CS1 -SN1 ] = [ RT1 0 ]
!> [-SN1 CS1 ] [ B C ] [ SN1 CS1 ] [ 0 RT2 ].
π Parameters π
AβA is REAL. The (1,1) element of the 2-by-2 matrix.BβB is REAL. The (1,2) element and the conjugate of the (2,1) element of the 2-by-2 matrix.CβC is REAL. The (2,2) element of the 2-by-2 matrix.RT1βRT1 is REAL. The eigenvalue of larger absolute value.RT2βRT2 is REAL. The eigenvalue of smaller absolute value.CS1βCS1 is REAL. (Yes, the description is just the type. We love a minimalist. π )SN1βSN1 is REAL. The vector(CS1, SN1)is a unit right eigenvector for RT1.
π 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.
!>
Word-for-word the same accuracy lore, because the math doesn't change just because the precision did. β¨
Definition at line 119 of file slaev2.f.
π 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. Double-precision complex, the final boss of the family. π₯
β¨ 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 ].
π Parameters π
AβA is COMPLEX*16. The (1,1) element of the 2-by-2 matrix.BβB is COMPLEX*16. The (1,2) element and the conjugate of the (2,1) element of the 2-by-2 matrix.CβC is COMPLEX*16. The (2,2) element of the 2-by-2 matrix.RT1βRT1 is DOUBLE PRECISION. The eigenvalue of larger absolute value.RT2βRT2 is DOUBLE PRECISION. The eigenvalue of smaller absolute value.CS1βCS1 is DOUBLE PRECISION. (The description is literally just the type and honestly? Respect. π)SN1βSN1 is COMPLEX*16. The vector(CS1, SN1)is a unit right eigenvector for RT1.
π 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.
!>
Definition at line 120 of file zlaev2.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
π Okay that's the whole page, bestie β four subroutines, one 2-by-2 matrix at a time, and a truly iconic amount of !>.
Later, girlypop! This masterpiece is from LAPACK, Version 3.12.0, dated the LAPACK era, and it's the laev2(3) page β go forth and eigendecompose responsibly. πβ¨π¦
π¦ 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