F06AAF (DROTG) (PDF version)
F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

F06AAF (DROTG)

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

+ Contents

    1  Purpose
    7  Accuracy
    9  Example

1  Purpose

F06AAF (DROTG) generates a real Givens plane rotation.

2  Specification

SUBROUTINE F06AAF ( A, B, C, S)
REAL (KIND=nag_wp)  A, B, C, S
The routine may be called by its BLAS name drotg.

3  Description

F06AAF (DROTG) generates a real Givens plane rotation with parameters c and s, such that, given real a and b:
c s -s c a b = d 0 .
The routine computes c, s and d as follows:
d = σa2+b2 ;
c = a/d, if ​ d 0, 1, if ​ d= 0, s = b/d, if ​ d 0, 0, if ​ d= 0,
where   σ = signa, if ​a>b, signb, if ​ab.
The routine also computes the value z defined as
z= s, if ​s<c​ or ​c=0, 1/c, if ​0<cs.
This enables c and s to be reconstructed from the single value z as
c= 1-z2, if ​z1, 1/z, if ​z>1, s= z, if ​z1, 1-c2, if ​z>1.
To apply the plane rotation to a pair of real vectors, call F06EPF (DROT); to apply it to a pair of complex vectors, call F06KPF.

4  References

None.

5  Parameters

1:     A – REAL (KIND=nag_wp)Input/Output
On entry: the value a, the first element of the vector which determines the rotation.
On exit: the value d.
2:     B – REAL (KIND=nag_wp)Input/Output
On entry: the value b, the second element of the vector which determines the rotation.
On exit: the value z, from which c and s can be reconstructed.
3:     C – REAL (KIND=nag_wp)Output
On exit: the value c, the cosine of the rotation.
4:     S – REAL (KIND=nag_wp)Output
On exit: the value s, the sine of the rotation.

6  Error Indicators and Warnings

None.

7  Accuracy

Not applicable.

8  Further Comments

None.

9  Example

None.

F06AAF (DROTG) (PDF version)
F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012