Adelsbach/VSIPL
Core +DP Programming Reference Guide
DD-00017-015
Core +DP

2.1.2 vsip_cmag_p - Compute Magnitude of Complex Scalar

vsip_scalar_f vsip_cmag_f(vsip_cscalar_f x); 
vsip_scalar_d vsip_cmag_d(vsip_cscalar_d x);
Description

This function computes the magnitude (absolute value) of a complex scalar. The magnitude is computed as:

           √︃------2-------2-
magnitude=  real(x) +imag(x)

This function provides a numerically stable implementation that avoids potential overflow and underflow issues.

Parameters
Return Value