LAPACK  3.9.1
LAPACK: Linear Algebra PACKage

◆ srotg()

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

SROTG

Purpose:
    SROTG construct givens plane rotation.
Parameters
[in,out]SA
          SA is REAL
[in,out]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.
Further Details:
     jack dongarra, linpack, 3/11/78.

Definition at line 68 of file srotg.f.

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