NAG Library Routine Document

1Purpose

f06aaf (drotg) generates a real Givens plane rotation.

2Specification

Fortran Interface
 Subroutine f06aaf ( a, b, c, s)
 Real (Kind=nag_wp), Intent (Inout) :: a, b Real (Kind=nag_wp), Intent (Out) :: c, s
#include nagmk26.h
 void f06aaf_ ( double *a, double *b, double *c, double *s)
The routine may be called by its BLAS name drotg.

3Description

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 σ = sign⁡a, if ​a>b, sign⁡b, if ​a≤b.$
The routine also computes the value $z$ defined as
 $z= s, if ​s
This enables $c$ and $s$ to be reconstructed from the single value $z$ as
 $c= 1-z2, if ​z≤1, 1/z, if ​z>1, s= z, if ​z≤1, 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 (zdrot).

None.

5Arguments

1:     $\mathbf{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:     $\mathbf{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:     $\mathbf{c}$ – Real (Kind=nag_wp)Output
On exit: the value $c$, the cosine of the rotation.
4:     $\mathbf{s}$ – Real (Kind=nag_wp)Output
On exit: the value $s$, the sine of the rotation.

None.

Not applicable.

8Parallelism and Performance

f06aaf (drotg) is not threaded in any implementation.