DROTG(3)

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

🌸 NAME 🌸

okay so this is DROTG(3), from the Library Functions Manual πŸ«ΆπŸ’… and the NAME line is literally this absolute path, no cap:

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

✨ SYNOPSIS ✨

Functions/Subroutines 🧚

the synopsis is giving exactly this:

subroutine DROTG (a, b, c, s)
    DROTG

πŸ’œ Function/Subroutine Documentation πŸ’œ

subroutine DROTG (real(wp) a, real(wp) b, real(wp) c, real(wp) s)

DROTG πŸ’«

DROTG is the main character here.

Purpose: ✨

so DROTG constructs a plane rotation:

[  c  s ] [ a ] = [ r ]
[ -s  c ] [ b ]   [ 0 ]

satisfying c**2 + s**2 = 1.

The computation uses the formulas:

sigma = sgn(a)    if |a| >  |b|
      = sgn(b)    if |b| >= |a|
r = sigma*sqrt( a**2 + b**2 )
c = 1; s = 0      if r = 0
c = a/r; s = b/r  if r != 0

The subroutine also computes:

z = s    if |a| > |b|,
  = 1/c  if |b| >= |a| and c != 0
  = 1    if c = 0

This allows c and s to be reconstructed from z as follows:

If z = 1, set c = 0, s = 1.
If |z| < 1, set c = sqrt(1 - z**2) and s = z.
If |z| > 1, set c = 1/z and s = sqrt( 1 - c**2).

See also πŸ‘€

the cross-reference tea is literally:

lartg:          generate plane rotation, more accurate than BLAS
rot,

lartgp:         generate plane rotation, more accurate than BLAS rot

so yes, lartg, rot, and lartgp are all in the group chat 🫢

Parameters πŸŽ€

  • A β€” A is DOUBLE PRECISION. On entry, the scalar a. On exit, the scalar r.
  • B β€” B is DOUBLE PRECISION. On entry, the scalar b. On exit, the scalar z.
  • C β€” C is DOUBLE PRECISION. The scalar c.
  • S β€” S is DOUBLE PRECISION. The scalar s.

Author πŸŽ€

Edward Anderson, Lockheed Martin

Contributors: πŸ¦‹

Weslley Pereira, University of Colorado Denver, USA

Further Details: πŸ“š

the source says:

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 91 of file drotg.f90.

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for LAPACK from the source code.


Signed off by LAPACK, Version 3.12.0, from /home/abui...C/drotg.f90(3) β€” the footer has no date, so no invented dates here, bestie; catch you on the next page πŸ’–βœ¨

πŸ“¦ where this page comes from