LAPACK  3.9.1 LAPACK: Linear Algebra PACKage

## ◆ drotg()

 subroutine drotg ( double precision DA, double precision DB, double precision C, double precision S )

DROTG

Purpose:
`    DROTG construct givens plane rotation.`
Parameters
 [in,out] DA ` DA is DOUBLE PRECISION` [in,out] DB ` DB is DOUBLE PRECISION` [out] C ` C is DOUBLE PRECISION` [out] S ` S is DOUBLE PRECISION`
Further Details:
`     jack dongarra, linpack, 3/11/78.`

Definition at line 68 of file drotg.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  DOUBLE PRECISION C,DA,DB,S
76 * ..
77 *
78 * =====================================================================
79 *
80 * .. Local Scalars ..
81  DOUBLE PRECISION R,ROE,SCALE,Z
82 * ..
83 * .. Intrinsic Functions ..
84  INTRINSIC dabs,dsign,dsqrt
85 * ..
86  scale = dabs(da) + dabs(db)
87  IF (scale.EQ.0.0d0) THEN
88  c = 1.0d0
89  s = 0.0d0
90  r = 0.0d0
91  z = 0.0d0
92  ELSE
93  roe = db
94  IF (dabs(da).GT.dabs(db)) roe = da
95  r = scale*dsqrt((da/scale)**2+ (db/scale)**2)
96  r = dsign(1.0d0,roe)*r
97  c = da/r
98  s = db/r
99  z = 1.0d0
100  IF (dabs(da).GT.dabs(db)) z = s
101  IF (dabs(db).GE.dabs(da) .AND. c.NE.0.0d0) z = 1.0d0/c
102  END IF
103  da = r
104  db = z
105  RETURN
Here is the caller graph for this function: