NAG Library Routine Document
A02ABF
1 Purpose
A02ABF returns the value of the modulus of the complex number .
2 Specification
FUNCTION A02ABF ( |
XR, XI) |
REAL (KIND=nag_wp) A02ABF |
REAL (KIND=nag_wp) |
XR, XI |
|
3 Description
The function evaluates by using where is the larger of and , and is the smaller of and . This ensures against unnecessary overflow and loss of accuracy when calculating .
4 References
Wilkinson J H and Reinsch C (1971) Handbook for Automatic Computation II, Linear Algebra Springer–Verlag
5 Parameters
- 1: XR – REAL (KIND=nag_wp)Input
- 2: XI – REAL (KIND=nag_wp)Input
On entry: and , the real and imaginary parts of , respectively.
6 Error Indicators and Warnings
None.
7 Accuracy
The result should be correct to machine precision.
None.
9 Example
This example finds the modulus of .
9.1 Program Text
Program Text (a02abfe.f90)
9.2 Program Data
Program Data (a02abfe.d)
9.3 Program Results
Program Results (a02abfe.r)