![]() |
LAPACK
3.10.0
LAPACK: Linear Algebra PACKage
|
| subroutine zrotg | ( | complex(wp) | a, |
| complex(wp) | b, | ||
| real(wp) | c, | ||
| complex(wp) | s | ||
| ) |
ZROTG
The computation uses the formulas
|x| = sqrt( Re(x)**2 + Im(x)**2 )
sgn(x) = x / |x| if x /= 0
= 1 if x = 0
c = |a| / sqrt(|a|**2 + |b|**2)
s = sgn(a) * conjg(b) / sqrt(|a|**2 + |b|**2)
When a and b are real and r /= 0, the formulas simplify to
r = sgn(a)*sqrt(|a|**2 + |b|**2)
c = a / r
s = b / r
the same as in ZROTG when |a| > |b|. When |b| >= |a|, the
sign of c and s will be different from those computed by ZROTG
if the signs of a and b are not the same. | [in,out] | A | A is DOUBLE COMPLEX
On entry, the scalar a.
On exit, the scalar r. |
| [in] | B | B is DOUBLE COMPLEX
The scalar b. |
| [out] | C | C is DOUBLE PRECISION
The scalar c. |
| [out] | S | S is DOUBLE PRECISION
The scalar s. |
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 90 of file zrotg.f90.