Update to 2.0.0 tree from current Fremantle build
[opencv] / 3rdparty / lapack / dlapy2.c
1 #include "clapack.h"
2
3 doublereal dlapy2_(doublereal *x, doublereal *y)
4 {
5     /* System generated locals */
6     doublereal ret_val, d__1;
7
8     /* Builtin functions */
9     double sqrt(doublereal);
10
11     /* Local variables */
12     doublereal w, z__, xabs, yabs;
13
14
15 /*  -- LAPACK auxiliary routine (version 3.1) -- */
16 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
17 /*     November 2006 */
18
19 /*     .. Scalar Arguments .. */
20 /*     .. */
21
22 /*  Purpose */
23 /*  ======= */
24
25 /*  DLAPY2 returns sqrt(x**2+y**2), taking care not to cause unnecessary */
26 /*  overflow. */
27
28 /*  Arguments */
29 /*  ========= */
30
31 /*  X       (input) DOUBLE PRECISION */
32 /*  Y       (input) DOUBLE PRECISION */
33 /*          X and Y specify the values x and y. */
34
35 /*  ===================================================================== */
36
37 /*     .. Parameters .. */
38 /*     .. */
39 /*     .. Local Scalars .. */
40 /*     .. */
41 /*     .. Intrinsic Functions .. */
42 /*     .. */
43 /*     .. Executable Statements .. */
44
45     xabs = abs(*x);
46     yabs = abs(*y);
47     w = max(xabs,yabs);
48     z__ = min(xabs,yabs);
49     if (z__ == 0.) {
50         ret_val = w;
51     } else {
52 /* Computing 2nd power */
53         d__1 = z__ / w;
54         ret_val = w * sqrt(d__1 * d__1 + 1.);
55     }
56     return ret_val;
57
58 /*     End of DLAPY2 */
59
60 } /* dlapy2_ */