blob: 8f6bb47d4d651e929136f17495f6ddf4ad14364a [file] [log] [blame]
#include <math.h>
static double xhypot (const double x, const double y);
static double xhypot (const double x, const double y)
{
double xabs = fabs(x) ;
double yabs = fabs(y) ;
double min, max;
if (xabs < yabs) {
min = xabs ;
max = yabs ;
} else {
min = yabs ;
max = xabs ;
}
if (min == 0)
{
return max ;
}
{
double u = min / max ;
return max * sqrt (1 + u * u) ;
}
}