blob: 5d2142e1825c61f8ecfc9a22639efb0244d27b05 [file] [log] [blame]
#undef abs
#include <math.h>
double
f__cabs (double real, double imag)
{
double temp;
if (real < 0)
real = -real;
if (imag < 0)
imag = -imag;
if (imag > real)
{
temp = real;
real = imag;
imag = temp;
}
if ((real + imag) == real)
return (real);
temp = imag / real;
temp = real * sqrt (1.0 + temp * temp); /*overflow!! */
return (temp);
}