SRC/slartg.f90(3)
π SRC/slartg.f90(3) π
Library Functions Manual β okay bestie, this is the page for SRC/slartg.f90, and it is literally all about generating a plane rotation with real cosine and real sine. Slay. β¨
β¨ NAME β¨
SRC/slartg.f90
π¦ SYNOPSIS π¦
Functions/Subroutines
subroutine slartg (f, g, c, s, r)β SLARTG generates a plane rotation with real cosine and real sine.
π Function/Subroutine Documentation π
π subroutine slartg (real(wp) f, real(wp) g, real(wp) c, real(wp) s, real(wp) r) π
subroutine slartg (real(wp) f, real(wp) g, real(wp) c, real(wp) s, real(wp)
r)
SLARTG generates a plane rotation with real cosine and real sine. Iconic behavior, no cap. π
π Purpose π
SLARTG generates a plane rotation so that
[ C S ] . [ F ] = [ R ]
[ -S C ] [ G ] [ 0 ]
where C**2 + S**2 = 1.
The mathematical formulas used for C and S are
R = sign(F) * sqrt(F**2 + G**2)
C = F / R
S = G / R
Hence C >= 0. The algorithm used to compute these quantities incorporates scaling to avoid overflow or underflow in computing the square root of the sum of squares. Very careful, very demure. π
π¨ Caveat bestie: this version is discontinuous inRatF = 0, but it returns the sameCandSasCLARTGfor complex inputs(F,0)and(G,0).
This is a more accurate version of the BLAS1 routine SROTG, with the following other differences:
FandGare unchanged on return.- If
G=0, thenC=1andS=0. - If
F=0and (G .ne. 0), thenC=0andS=sign(1,G)without doing any floating point operations (saves work inSBDSQRwhen there are zeros on the diagonal). - Below,
wp=>spstands for single precision fromLA_CONSTANTSmodule.
πΈ Parameters πΈ
FβF is REAL(wp). The first component of vector to be rotated.GβG is REAL(wp). The second component of vector to be rotated.CβC is REAL(wp). The cosine of the rotation.SβS is REAL(wp). The sine of the rotation.RβR is REAL(wp). The nonzero component of the rotated vector.
π Author π
Edward Anderson, Lockheed Martin
π Date π
July 2016
π«Ά Contributors: π«Ά
Weslley Pereira, University of Colorado Denver, USA
π§ Further Details: π§
Anderson E. (2017)
Algorithm 978: Safe Scaling in the Level 1 BLAS
ACM Trans Math Softw 44:1--28
https://doi.org/10.1145/3061665
Definition at line 110 of file slartg.f90.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
π«Ά Thatβs the whole page, bestie β LAPACK Version 3.12.0, source SRC/slartg.f90(3), date July 2016. Periodt. π
π¦ 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