Debian Codegraph @

debian/external_deps/fetk/punc/src/blas/drotg.c

raw
1 /* ./src_f77/drotg.f -- translated by f2c (version 20030320).
2 You must link the resulting object file with the libraries:
3 -lf2c -lm (in that order)
4 */
5
6 #include <punc/vf2c.h>
7
8 /* Table of constant values */
9
10 static doublereal c_b4 = 1.;
11
12 /* Subroutine */ int drotg_(doublereal *da, doublereal *db, doublereal *c__,
13 doublereal *s)
14 {
15 /* System generated locals */
16 doublereal d__1, d__2;
17
18 /* Builtin functions */
19 double sqrt(doublereal), d_sign(doublereal *, doublereal *);
20
21 /* Local variables */
22 static doublereal r__, z__, roe, scale;
23
24
25 /* construct givens plane rotation. */
26 /* jack dongarra, linpack, 3/11/78. */
27
28
29 roe = *db;
30 if (abs(*da) > abs(*db)) {
31 roe = *da;
32 }
33 scale = abs(*da) + abs(*db);
34 if (scale != 0.) {
35 goto L10;
36 }
37 *c__ = 1.;
38 *s = 0.;
39 r__ = 0.;
40 z__ = 0.;
41 goto L20;
42 L10:
43 /* Computing 2nd power */
44 d__1 = *da / scale;
45 /* Computing 2nd power */
46 d__2 = *db / scale;
47 r__ = scale * sqrt(d__1 * d__1 + d__2 * d__2);
48 r__ = d_sign(&c_b4, &roe) * r__;
49 *c__ = *da / r__;
50 *s = *db / r__;
51 z__ = 1.;
52 if (abs(*da) > abs(*db)) {
53 z__ = *s;
54 }
55 if (abs(*db) >= abs(*da) && *c__ != 0.) {
56 z__ = 1. / *c__;
57 }
58 L20:
59 *da = r__;
60 *db = z__;
61 return 0;
62 } /* drotg_ */
63