NAG Library Routine Document
a02abf (abs)
1
Purpose
a02abf returns the value of the modulus of the complex number .
2
Specification
Fortran Interface
Function a02abf ( |
xr, xi) |
Real (Kind=nag_wp) | :: | a02abf | Real (Kind=nag_wp), Intent (In) | :: | xr, xi |
|
C Header Interface
#include <nagmk26.h>
double |
a02abf_ (const double *xr, const double *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
Arguments
- 1: – Real (Kind=nag_wp)Input
- 2: – 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.
8
Parallelism and Performance
a02abf is not threaded in any implementation.
None.
10
Example
This example finds the modulus of .
10.1
Program Text
Program Text (a02abfe.f90)
10.2
Program Data
Program Data (a02abfe.d)
10.3
Program Results
Program Results (a02abfe.r)