SLARTG(3)

πŸ“¦ version 3.12.0, in opensuse-leap 16.0

πŸ’– NAME πŸ’–

okay bestie, quick vibe check: this is the /home/abui.../slartg.f90(3) page from the Library Functions Manual β€” the header literally says the manual name twice because it has main character energy like that. The actual NAME line is the whole path:

/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/slartg.f90

So yeah, that's the file this page is about. πŸ’…


✨ 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)

SLARTG generates a plane rotation with real cosine and real sine.

🌟 Purpose 🌟

okay so, 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.

This version is discontinuous in R at F = 0 but it returns the same C and S as CLARTG for complex inputs (F,0) and (G,0).

This is a more accurate version of the BLAS1 routine SROTG, with the following other differences:

  • F and G are unchanged on return.
  • If G=0, then C=1 and S=0.
  • If F=0 and (G .ne. 0), then C=0 and S=sign(1,G) without doing any floating point operations (saves work in SBDSQR when there are zeros on the diagonal).

Below, wp=>sp stands for single precision from LA_CONSTANTS module.

🧚 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, page /home/abui.../slartg.f90(3), with the July 2016 date up in the Date section and the whole thing generated automatically by Doxygen for LAPACK from the source code. Slay safely, and may your rotations never overflow. πŸ’–βœ¨

πŸ“¦ where this page comes from