SRC/slas2.f(3)
π SRC/slas2.f
okay so this is a page from the LAPACK Library Functions Manual (yes that LAPACK, the linear algebra one, we stan) and it's all about one lil workhorse subroutine, slas2, who is honestly doing the most for a 2-by-2 matrix. bestie, let's get into it π
β¨ SYNOPSIS β¨
Functions/Subroutines
subroutine slas2 (f, g, h, ssmin, ssmax)β SLAS2 computes singular values of a 2-by-2 triangular matrix. that's the whole gig. iconic behavior honestly π
π¦ Function/Subroutine Documentation π¦
subroutine slas2 (real f, real g, real h, real ssmin, real ssmax)
SLAS2 computes singular values of a 2-by-2 triangular matrix. no cap, that's literally what it does π
πΈ Purpose:
!>
!> SLAS2 computes the singular values of the 2-by-2 matrix
!> [ F G ]
!> [ 0 H ].
!> On return, SSMIN is the smaller singular value and SSMAX is the
!> larger singular value.
!>
so you hand it that cute lil upper-triangular 2-by-2 and it hands you back both singular values, smaller one in SSMIN, bigger one in SSMAX. slay β¨
π Parameters
FβFis REAL. it's the (1,1) element of the 2-by-2 matrix. the main character of the diagonal, lowkey.GβGis REAL. it's the (1,2) element of the 2-by-2 matrix. the one and only off-diagonal entry, living its best life up there.HβHis REAL. it's the (2,2) element of the 2-by-2 matrix. the other diagonal girly.SSMINβSSMINis REAL. on return it's the smaller singular value. πSSMAXβSSMAXis REAL. on return it's the larger singular value. π₯
π Author π
these absolute legends:
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
four institutions, one subroutine, we love a collab π
β Further Details: β
the fine print, but make it fashion:
!>
!> Barring over/underflow, all output quantities are correct to within
!> a few units in the last place (ulps), even in the absence of a guard
!> digit in addition/subtraction.
!>
!> In IEEE arithmetic, the code works correctly if one matrix element is
!> infinite.
!>
!> Overflow will not occur unless the largest singular value itself
!> overflows, or is within a few ulps of overflow.
!>
!> Underflow is harmless if underflow is gradual. Otherwise, results
!> may correspond to a matrix modified by perturbations of size near
!> the underflow threshold.
!>
let me translate, bestie π so like β as long as you're not over/underflowing, everything you get back is accurate to within a few ulps, even when there's no guard digit in addition/subtraction. in IEEE arithmetic the code still works correctly if one matrix element is infinite (not me being shocked, but ok). overflow won't happen unless the largest singular value itself overflows or is within a few ulps of overflowing. and underflow? harmless if it's gradual β otherwise your results may correspond to a matrix that got modified by perturbations of size near the underflow threshold. so like... gradual underflow good, abrupt underflow: proceed with caution π
Definition at line 104 of file slas2.f.
π Author π
this page was generated automatically by Doxygen for LAPACK from the source code. no human wrote this one, a robot did it and honestly? it ate π€β¨
ok that's the whole page, thank you for coming to my TED talk π«Ά
π LAPACK β Version 3.12.0 β SRC/slas2.f(3) π
mwah, go compute some singular values, you gorgeous nerd π π
π¦ 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