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 β€” F is REAL. it's the (1,1) element of the 2-by-2 matrix. the main character of the diagonal, lowkey.
  • G β€” G is 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 β€” H is REAL. it's the (2,2) element of the 2-by-2 matrix. the other diagonal girly.
  • SSMIN β€” SSMIN is REAL. on return it's the smaller singular value. πŸ“
  • SSMAX β€” SSMAX is 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