NAG FL Interface
f06aaf (drotg)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

f06aaf generates a real Givens plane rotation.

2 Specification

Fortran Interface
Subroutine f06aaf ( a, b, c, s)
Real (Kind=nag_wp), Intent (Inout) :: a, b
Real (Kind=nag_wp), Intent (Out) :: c, s
C Header Interface
#include <nag.h>
void  f06aaf_ (double *a, double *b, double *c, double *s)
The routine may be called by the names f06aaf, nagf_blas_drotg or its BLAS name drotg.

3 Description

f06aaf 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 ​|a||b|.  
The routine also computes the value z defined as
z={ s, if ​|s|<c​ or ​c=0, 1/c, if ​0<|c|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; to apply it to a pair of complex vectors, call f06kpf.

4 References

None.

5 Arguments

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 Parallelism and Performance

f06aaf is not threaded in any implementation.

9 Further Comments

None.

10 Example

None.