GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
BLAS/SRC/srotg.f90(3) LAPACK BLAS/SRC/srotg.f90(3)

BLAS/SRC/srotg.f90


subroutine srotg (a, b, c, s)
SROTG

SROTG

Purpose:


SROTG constructs a plane rotation
[ c s ] [ a ] = [ r ]
[ -s c ] [ b ] [ 0 ]
satisfying c**2 + s**2 = 1.
The computation uses the formulas
sigma = sgn(a) if |a| > |b|
= sgn(b) if |b| >= |a|
r = sigma*sqrt( a**2 + b**2 )
c = 1; s = 0 if r = 0
c = a/r; s = b/r if r != 0
The subroutine also computes
z = s if |a| > |b|,
= 1/c if |b| >= |a| and c != 0
= 1 if c = 0
This allows c and s to be reconstructed from z as follows:
If z = 1, set c = 0, s = 1.
If |z| < 1, set c = sqrt(1 - z**2) and s = z.
If |z| > 1, set c = 1/z and s = sqrt( 1 - c**2).

See also

lartg: generate plane rotation, more accurate than BLAS rot,

lartgp: generate plane rotation, more accurate than BLAS rot

Parameters

A


A is REAL
On entry, the scalar a.
On exit, the scalar r.

B


B is REAL
On entry, the scalar b.
On exit, the scalar z.

C


C is REAL
The scalar c.

S


S is REAL
The scalar s.

Author

Edward Anderson, Lockheed Martin

Contributors:

Weslley Pereira, University of Colorado Denver, USA

Further Details:


Anderson E. (2017)
Algorithm 978: Safe Scaling in the Level 1 BLAS
ACM Trans Math Softw 44:1--28
https://doi.org/10.1145/3061665

Definition at line 91 of file srotg.f90.

Generated automatically by Doxygen for LAPACK from the source code.

Sun Jan 12 2025 15:13:27 Version 3.12.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.