LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ srotg()

subroutine srotg ( real  SA,
real  SB,
real  C,
real  S 
)

SROTG

Purpose:
    SROTG construct givens plane rotation.
Parameters
[in]SA
          SA is REAL
[in]SB
          SB is REAL
[out]C
          C is REAL
[out]S
          S is REAL
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2017
Further Details:
     jack dongarra, linpack, 3/11/78.

Definition at line 71 of file srotg.f.

71 *
72 * -- Reference BLAS level1 routine (version 3.8.0) --
73 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
74 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
75 * November 2017
76 *
77 * .. Scalar Arguments ..
78  REAL C,S,SA,SB
79 * ..
80 *
81 * =====================================================================
82 *
83 * .. Local Scalars ..
84  REAL R,ROE,SCALE,Z
85 * ..
86 * .. Intrinsic Functions ..
87  INTRINSIC abs,sign,sqrt
88 * ..
89  roe = sb
90  IF (abs(sa).GT.abs(sb)) roe = sa
91  scale = abs(sa) + abs(sb)
92  IF (scale.EQ.0.0) THEN
93  c = 1.0
94  s = 0.0
95  r = 0.0
96  z = 0.0
97  ELSE
98  r = scale*sqrt((sa/scale)**2+ (sb/scale)**2)
99  r = sign(1.0,roe)*r
100  c = sa/r
101  s = sb/r
102  z = 1.0
103  IF (abs(sa).GT.abs(sb)) z = s
104  IF (abs(sb).GE.abs(sa) .AND. c.NE.0.0) z = 1.0/c
105  END IF
106  sa = r
107  sb = z
108  RETURN
Here is the caller graph for this function: