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
10 /* $Id: hypot.c,v 1.2 1994/06/24 11:45:27 ceriel Exp $ */
13 hypot(double x,double y)
15 /* Computes sqrt(x*x+y*y), avoiding overflow */
24 /* sqrt(x*x+y*y) = sqrt(y*y*(x*x/(y*y)+1.0)) = y*sqrt(x*x/(y*y)+1.0) */
25 if (y == 0.0) return 0.0;
27 return y*sqrt(x*x+1.0);
35 cabs(struct complex p_compl)
37 return hypot(p_compl.r, p_compl.i);