LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine srotg ( real  SA,
real  SB,
real  C,
real  S 
)

SROTG

Purpose:
    SROTG construct givens plane rotation.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011
Further Details:
     jack dongarra, linpack, 3/11/78.

Definition at line 48 of file srotg.f.

48 *
49 * -- Reference BLAS level1 routine (version 3.4.0) --
50 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
51 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
52 * November 2011
53 *
54 * .. Scalar Arguments ..
55  REAL c,s,sa,sb
56 * ..
57 *
58 * =====================================================================
59 *
60 * .. Local Scalars ..
61  REAL r,roe,scale,z
62 * ..
63 * .. Intrinsic Functions ..
64  INTRINSIC abs,sign,sqrt
65 * ..
66  roe = sb
67  IF (abs(sa).GT.abs(sb)) roe = sa
68  scale = abs(sa) + abs(sb)
69  IF (scale.EQ.0.0) THEN
70  c = 1.0
71  s = 0.0
72  r = 0.0
73  z = 0.0
74  ELSE
75  r = scale*sqrt((sa/scale)**2+ (sb/scale)**2)
76  r = sign(1.0,roe)*r
77  c = sa/r
78  s = sb/r
79  z = 1.0
80  IF (abs(sa).GT.abs(sb)) z = s
81  IF (abs(sb).GE.abs(sa) .AND. c.NE.0.0) z = 1.0/c
82  END IF
83  sa = r
84  sb = z
85  RETURN

Here is the caller graph for this function: