naginterfaces.library.complex.abs

naginterfaces.library.complex.abs(xr, xi)[source]

abs returns the value of the modulus of the complex number .

For full information please refer to the NAG Library document for a02ab

https://www.nag.com/numeric/nl/nagdoc_28.4/flhtml/a02/a02abf.html

Parameters
xrfloat

, the real part of .

xifloat

, the imaginary part of .

Returns
xafloat

The modulus of the complex number .

Notes

In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

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 .

References

Wilkinson, J H and Reinsch, C, 1971, Handbook for Automatic Computation II, Linear Algebra, Springer–Verlag