Purpose
To compute the complex square root YR + i*YI of a complex number XR + i*XI in real arithmetic. The returned result is so that YR >= 0.0 and SIGN(YI) = SIGN(XI).Specification
SUBROUTINE MA01AD( XR, XI, YR, YI )
C .. Scalar Arguments ..
DOUBLE PRECISION XR, XI, YR, YI
Arguments
Input/Output Parameters
XR (input) DOUBLE PRECISION
XI (input) DOUBLE PRECISION
These scalars define the real and imaginary part of the
complex number of which the square root is sought.
YR (output) DOUBLE PRECISION
YI (output) DOUBLE PRECISION
These scalars define the real and imaginary part of the
complex square root.
Method
The complex square root YR + i*YI of the complex number XR + i*XI is computed in real arithmetic, taking care to avoid overflow.References
Adapted from EISPACK subroutine CSROOT.Further Comments
NoneExample
Program Text
NoneProgram Data
NoneProgram Results
None