1 /* { dg-do compile } */
2 /*
3  * ====================================================
4  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
5  *
6  * Developed at SunPro, a Sun Microsystems, Inc. business.
7  * Permission to use, copy, modify, and distribute this
8  * software is freely granted, provided that this notice
9  * is preserved.
10  * ====================================================
11  */
12 typedef union
13 {
14   double value;
15   struct
16   {
17     unsigned int msw;
18   } parts;
19 } ieee_double_shape_type;
__ieee754_hypot(double x,double y)20 double __ieee754_hypot(double x, double y)
21 {
22  double a=x,b=y,t1,t2,y1,y2,w;
23  int j,k,ha,hb;
24  do { ieee_double_shape_type gh_u; gh_u.value = (x); (ha) = gh_u.parts.msw; } while (0);;
25  if(hb > ha) {a=y;b=x;j=ha; ha=hb;hb=j;} else {a=x;b=y;}
26  if(ha > 0x5f300000) {
27     do { ieee_double_shape_type sh_u; sh_u.value = (a); sh_u.parts.msw = (ha); (a) = sh_u.value; } while (0);;
28  }
29  w = a-b;
30  if (w <= b)
31  {
32      t2 = a - t1;
33      w = t1*y1-(w*(-w)-(t1*y2+t2*b));
34  }
35  if(k!=0) {
36  } else return w;
37 }
38