 LAPACK  3.9.0 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] DA ` DA is DOUBLE PRECISION` [in] DB ` DB is DOUBLE PRECISION` [out] C ` C is DOUBLE PRECISION` [out] S ` S is DOUBLE PRECISION`
Date
November 2017
Further Details:
`     jack dongarra, linpack, 3/11/78.`

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