2 * (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
5 * Author: Ceriel J.H. Jacobs
14 _PROTOTYPE(double hypot
, (double x
, double y
));
15 _PROTOTYPE(double cabs
, (struct complex p_compl
));
23 /* Computes sqrt(x*x+y*y), avoiding overflow */
32 /* sqrt(x*x+y*y) = sqrt(y*y*(x*x/(y*y)+1.0)) = y*sqrt(x*x/(y*y)+1.0) */
33 if (y
== 0.0) return 0.0;
35 return y
*sqrt(x
*x
+1.0);
40 struct complex p_compl
;
42 return hypot(p_compl
.r
, p_compl
.i
);