1 /* cdiv.f -- translated by f2c (version 19961017).
2    You must link the resulting object file with the libraries:
3 	-lf2c -lm   (in that order)
4 */
5 
6 #include "f2c.h"
7 
cdiv_(doublereal * ar,doublereal * ai,doublereal * br,doublereal * bi,doublereal * cr,doublereal * ci)8 /* Subroutine */ int cdiv_(doublereal *ar, doublereal *ai, doublereal *br,
9 	doublereal *bi, doublereal *cr, doublereal *ci)
10 {
11     /* System generated locals */
12     doublereal d__1, d__2;
13 
14     /* Local variables */
15     doublereal s, ais, bis, ars, brs;
16 
17 
18 /*     COMPLEX DIVISION, (CR,CI) = (AR,AI)/(BR,BI) */
19 
20     s = abs(*br) + abs(*bi);
21     ars = *ar / s;
22     ais = *ai / s;
23     brs = *br / s;
24     bis = *bi / s;
25 /* Computing 2nd power */
26     d__1 = brs;
27 /* Computing 2nd power */
28     d__2 = bis;
29     s = d__1 * d__1 + d__2 * d__2;
30     *cr = (ars * brs + ais * bis) / s;
31     *ci = (ais * brs - ars * bis) / s;
32     return 0;
33 } /* cdiv_ */
34 
35