1 /***************************************************************************
2 JSPICE3 adaptation of Spice3f2 - Copyright (c) Stephen R. Whiteley 1992
3 Copyright 1990 Regents of the University of California.  All rights reserved.
4 Authors: 1988 Jaijeet S Roychowdhury
5          1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <math.h>
10 #define JOB char
11 #include "distodef.h"
12 #include "distoext.h"
13 
14 /*
15  * all subFns are local to this file so they need not be renamed to
16  * the awful 7 letter standard; however, for reasons of uniformity,
17  * they are being renamed, losing all readability in the process.
18  * the renaming convention is as follows:
19  *   example: 3v3F1m2
20  * 3v => 3 variable term xyz
21  * 2F1m2 => Two F1 minus F2
22  * therefore the old name would be : S3v3F1minusF2
23  * for the imaginary sub functions, the v is replaced by an i
24  *
25  */
26 
27 
28 double
S2v2F1(cxy,r1h1x,i1h1x,r1h1y,i1h1y)29 S2v2F1(cxy, r1h1x, i1h1x, r1h1y, i1h1y)
30 
31 double cxy, r1h1x, i1h1x, r1h1y, i1h1y;
32 {
33     return (cxy*(r1h1x*r1h1y - i1h1x*i1h1y));
34 }
35 
36 
37 double
S2i2F1(cxy,r1h1x,i1h1x,r1h1y,i1h1y)38 S2i2F1(cxy, r1h1x, i1h1x, r1h1y, i1h1y)
39 
40 double cxy, r1h1x, i1h1x, r1h1y, i1h1y;
41 {
42     return (cxy*(r1h1x*i1h1y + i1h1x*r1h1y));
43 }
44 
45 
46 double
S2v3F1(cxy,r1h1x,i1h1x,r1h1y,i1h1y,r2h11x,i2h11x,r2h11y,i2h11y)47 S2v3F1(cxy, r1h1x, i1h1x, r1h1y, i1h1y, r2h11x, i2h11x, r2h11y, i2h11y)
48 
49 double cxy, r1h1x, i1h1x, r1h1y, i1h1y;
50 double r2h11x, i2h11x, r2h11y, i2h11y;
51 {
52     return (cxy*(r1h1x*r2h11y - i1h1x*i2h11y + r1h1y*r2h11x - i1h1y*i2h11x));
53 }
54 
55 
56 double
S2i3F1(cxy,r1h1x,i1h1x,r1h1y,i1h1y,r2h11x,i2h11x,r2h11y,i2h11y)57 S2i3F1(cxy, r1h1x, i1h1x, r1h1y, i1h1y, r2h11x, i2h11x, r2h11y, i2h11y)
58 
59 double cxy, r1h1x, i1h1x, r1h1y, i1h1y;
60 double r2h11x, i2h11x, r2h11y, i2h11y;
61 {
62     return (cxy*(r1h1x*i2h11y + i1h1x*r2h11y + r1h1y*i2h11x + i1h1y*r2h11x));
63 }
64 
65 
66 double
S2vF12(cxy,r1h1x,i1h1x,r1h1y,i1h1y,r1h2x,i1h2x,r1h2y,i1h2y)67 S2vF12(cxy, r1h1x, i1h1x, r1h1y, i1h1y, r1h2x, i1h2x, r1h2y, i1h2y)
68 
69 double cxy, r1h1x, i1h1x, r1h1y, i1h1y;
70 double r1h2x, i1h2x, r1h2y, i1h2y;
71 {
72     return (cxy*(r1h1x*r1h2y - i1h1x*i1h2y + r1h1y*r1h2x - i1h1y*i1h2x));
73 }
74 
75 
76 double
S2iF12(cxy,r1h1x,i1h1x,r1h1y,i1h1y,r1h2x,i1h2x,r1h2y,i1h2y)77 S2iF12(cxy, r1h1x, i1h1x, r1h1y, i1h1y, r1h2x, i1h2x, r1h2y, i1h2y)
78 
79 double cxy, r1h1x, i1h1x, r1h1y, i1h1y;
80 double r1h2x, i1h2x, r1h2y, i1h2y;
81 {
82     return (cxy*(r1h1x*i1h2y + i1h1x*r1h2y + r1h1y*i1h2x + i1h1y*r1h2x));
83 }
84 
85 
86 double
S2v2F12(cxy,r1h1x,i1h1x,r1h1y,i1h1y,r1h2x,i1h2x,r1h2y,i1h2y,r2h11x,i2h11x,r2h11y,i2h11y,h2f1f2x,ih2f1f2x,h2f1f2y,ih2f1f2y)87 S2v2F12(cxy, r1h1x, i1h1x, r1h1y, i1h1y, r1h2x, i1h2x, r1h2y, i1h2y,
88     r2h11x, i2h11x, r2h11y, i2h11y, h2f1f2x, ih2f1f2x, h2f1f2y, ih2f1f2y)
89 
90 double cxy, r1h1x, i1h1x, r1h1y, i1h1y;
91 double r1h2x, i1h2x, r1h2y, i1h2y;
92 double r2h11x, i2h11x, r2h11y, i2h11y;
93 double h2f1f2x, ih2f1f2x, h2f1f2y, ih2f1f2y;
94 {
95     return ( cxy * (
96         2*(r1h1x*h2f1f2y - i1h1x*ih2f1f2y
97           +r1h1y*h2f1f2x - i1h1y*ih2f1f2x)
98         + r1h2x*r2h11y - i1h2x*i2h11y
99         + r1h2y*r2h11x - i1h2y*i2h11x
100         ));
101 }
102 
103 
104 double
S2i2F12(cxy,r1h1x,i1h1x,r1h1y,i1h1y,r1h2x,i1h2x,r1h2y,i1h2y,r2h11x,i2h11x,r2h11y,i2h11y,h2f1f2x,ih2f1f2x,h2f1f2y,ih2f1f2y)105 S2i2F12(cxy, r1h1x, i1h1x, r1h1y, i1h1y, r1h2x, i1h2x, r1h2y, i1h2y,
106     r2h11x, i2h11x, r2h11y, i2h11y, h2f1f2x, ih2f1f2x, h2f1f2y, ih2f1f2y)
107 
108 double cxy, r1h1x, i1h1x, r1h1y, i1h1y;
109 double r1h2x, i1h2x, r1h2y, i1h2y;
110 double r2h11x, i2h11x, r2h11y, i2h11y;
111 double h2f1f2x, ih2f1f2x, h2f1f2y, ih2f1f2y;
112 {
113     return ( cxy * (
114         2*(r1h1x*ih2f1f2y + i1h1x*h2f1f2y
115           +r1h1y*ih2f1f2x + i1h1y*h2f1f2x)
116         + r1h2x*i2h11y + i1h2x*r2h11y
117         + r1h2y*i2h11x + i1h2y*r2h11x
118         ));
119 }
120 
121 
122 double
S3v3F1(cxyz,r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z)123 S3v3F1(cxyz, r1h1x, i1h1x, r1h1y, i1h1y, r1h1z, i1h1z)
124 
125 double cxyz, r1h1x, i1h1x, r1h1y;
126 double i1h1y, r1h1z,i1h1z;
127 {
128     return ( cxyz * (
129         (r1h1x*r1h1y - i1h1x*i1h1y)*r1h1z - (i1h1x*r1h1y + r1h1x*i1h1y)*i1h1z
130            ));
131 }
132 
133 
134 double
S3i3F1(cxyz,r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z)135 S3i3F1(cxyz, r1h1x, i1h1x, r1h1y, i1h1y, r1h1z, i1h1z)
136 
137 double cxyz, r1h1x, i1h1x, r1h1y;
138 double i1h1y, r1h1z,i1h1z;
139 {
140     return( cxyz * (
141        (r1h1x*r1h1y - i1h1x*i1h1y)*i1h1z + (i1h1x*r1h1y + r1h1x*i1h1y)*r1h1z
142            ));
143 }
144 
145 
146 double
S3v2F12(cxyz,r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z,r1h2x,i1h2x,r1h2y,i1h2y,r1h2z,i1h2z)147 S3v2F12(cxyz, r1h1x, i1h1x, r1h1y, i1h1y, r1h1z, i1h1z, r1h2x, i1h2x, r1h2y,
148     i1h2y, r1h2z, i1h2z)
149 
150 double cxyz, r1h1x, i1h1x, r1h1y, i1h1y;
151 double r1h1z, i1h1z, r1h2x, i1h2x, r1h2y;
152 double i1h2y, r1h2z, i1h2z;
153 {
154     return ( cxyz * (
155          (r1h1x*r1h1y - i1h1x*i1h1y)*r1h2z - (i1h1x*r1h1y + r1h1x*i1h1y)*i1h2z
156          +
157          (r1h1x*r1h1z - i1h1x*i1h1z)*r1h2y - (i1h1x*r1h1z + r1h1x*i1h1z)*i1h2y
158          +
159          (r1h1z*r1h1y - i1h1z*i1h1y)*r1h2x - (i1h1z*r1h1y + r1h1z*i1h1y)*i1h2x
160          ));
161 }
162 
163 
164 double
S3i2F12(cxyz,r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z,r1h2x,i1h2x,r1h2y,i1h2y,r1h2z,i1h2z)165 S3i2F12(cxyz, r1h1x, i1h1x, r1h1y, i1h1y, r1h1z, i1h1z, r1h2x, i1h2x, r1h2y,
166     i1h2y, r1h2z, i1h2z)
167 
168 double cxyz, r1h1x, i1h1x, r1h1y, i1h1y;
169 double r1h1z, i1h1z, r1h2x, i1h2x, r1h2y;
170 double i1h2y, r1h2z, i1h2z;
171 {
172     return ( cxyz * (
173          (r1h1x*r1h1y - i1h1x*i1h1y)*i1h2z + (i1h1x*r1h1y + r1h1x*i1h1y)*r1h2z
174          +
175          (r1h1x*r1h1z - i1h1x*i1h1z)*i1h2y + (i1h1x*r1h1z + r1h1x*i1h1z)*r1h2y
176          +
177          (r1h1z*r1h1y - i1h1z*i1h1y)*i1h2x + (i1h1z*r1h1y + r1h1z*i1h1y)*r1h2x
178          ));
179 }
180 
181 
182 /* the load functions */
183 /* also renamed... */
184 
185 double
DFn2F1(cxx,cyy,czz,cxy,cyz,cxz,r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z)186 DFn2F1(cxx,cyy,czz,cxy,cyz,cxz, r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z)
187 
188 double cxx,cyy,czz,cxy,cyz,cxz;
189 double r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z;
190 {
191     double temp;
192 
193     temp = S2v2F1(cxx,r1h1x,i1h1x,r1h1x,i1h1x) +
194            S2v2F1(cyy,r1h1y,i1h1y,r1h1y,i1h1y) +
195            S2v2F1(czz,r1h1z,i1h1z,r1h1z,i1h1z) +
196            S2v2F1(cxy,r1h1x,i1h1x,r1h1y,i1h1y) +
197            S2v2F1(cyz,r1h1y,i1h1y,r1h1z,i1h1z) +
198            S2v2F1(cxz,r1h1x,i1h1x,r1h1z,i1h1z);
199 
200      return (temp);
201 }
202 
203 
204 double
DFi2F1(cxx,cyy,czz,cxy,cyz,cxz,r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z)205 DFi2F1(cxx,cyy,czz,cxy,cyz,cxz, r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z)
206 
207 double cxx,cyy,czz,cxy,cyz,cxz;
208 double r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z;
209 {
210     double temp;
211 
212     temp = S2i2F1(cxx,r1h1x,i1h1x,r1h1x,i1h1x) +
213            S2i2F1(cyy,r1h1y,i1h1y,r1h1y,i1h1y) +
214            S2i2F1(czz,r1h1z,i1h1z,r1h1z,i1h1z) +
215            S2i2F1(cxy,r1h1x,i1h1x,r1h1y,i1h1y) +
216            S2i2F1(cyz,r1h1y,i1h1y,r1h1z,i1h1z) +
217            S2i2F1(cxz,r1h1x,i1h1x,r1h1z,i1h1z);
218 
219     return (temp);
220 }
221 
222 
223 double
DFn3F1(cxx,cyy,czz,cxy,cyz,cxz,cxxx,cyyy,czzz,cxxy,cxxz,cxyy,cyyz,cxzz,cyzz,cxyz,r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z,r2h11x,i2h11x,r2h11y,i2h11y,r2h11z,i2h11z)224 DFn3F1(cxx,cyy,czz,cxy,cyz,cxz,cxxx,cyyy,czzz,cxxy,cxxz,cxyy,cyyz,cxzz,cyzz,
225     cxyz, r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z, r2h11x,i2h11x,r2h11y,i2h11y,
226     r2h11z,i2h11z)
227 
228 double cxx,cyy,czz,cxy,cyz,cxz,cxxx,cyyy,czzz,cxxy,cxxz,cxyy,cyyz,cxzz,cyzz;
229 double cxyz;
230 double r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z;
231 double r2h11x,i2h11x,r2h11y,i2h11y,r2h11z,i2h11z;
232 {
233     double temp;
234 
235     temp = S2v3F1(cxx,r1h1x,i1h1x,r1h1x,i1h1x,r2h11x,i2h11x,r2h11x,i2h11x)
236           +S2v3F1(cyy,r1h1y,i1h1y,r1h1y,i1h1y,r2h11y,i2h11y,r2h11y,i2h11y)
237           +S2v3F1(czz,r1h1z,i1h1z,r1h1z,i1h1z,r2h11z,i2h11z,r2h11z,i2h11z);
238     temp +=
239           S2v3F1(cxy,r1h1x,i1h1x,r1h1y,i1h1y,r2h11x,i2h11x,r2h11y,i2h11y)
240           +S2v3F1(cyz,r1h1y,i1h1y,r1h1z,i1h1z,r2h11y,i2h11y,r2h11z,i2h11z)
241           +S2v3F1(cxz,r1h1x,i1h1x,r1h1z,i1h1z,r2h11x,i2h11x,r2h11z,i2h11z)
242           +S3v3F1(cxxx,r1h1x,i1h1x,r1h1x,i1h1x,r1h1x,i1h1x);
243     temp +=
244           S3v3F1(cyyy,r1h1y,i1h1y,r1h1y,i1h1y,r1h1y,i1h1y)
245           +S3v3F1(czzz,r1h1z,i1h1z,r1h1z,i1h1z,r1h1z,i1h1z)
246           +S3v3F1(cxxy,r1h1x,i1h1x,r1h1x,i1h1x,r1h1y,i1h1y)
247           +S3v3F1(cxxz,r1h1x,i1h1x,r1h1x,i1h1x,r1h1z,i1h1z)
248           +S3v3F1(cxyy,r1h1x,i1h1x,r1h1y,i1h1y,r1h1y,i1h1y);
249     temp +=
250           S3v3F1(cyyz,r1h1y,i1h1y,r1h1y,i1h1y,r1h1z,i1h1z)
251           +S3v3F1(cxzz,r1h1x,i1h1x,r1h1z,i1h1z,r1h1z,i1h1z)
252           +S3v3F1(cyzz,r1h1y,i1h1y,r1h1z,i1h1z,r1h1z,i1h1z)
253           +S3v3F1(cxyz,r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z);
254 
255     return (temp);
256 }
257 
258 
259 double
DFi3F1(cxx,cyy,czz,cxy,cyz,cxz,cxxx,cyyy,czzz,cxxy,cxxz,cxyy,cyyz,cxzz,cyzz,cxyz,r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z,r2h11x,i2h11x,r2h11y,i2h11y,r2h11z,i2h11z)260 DFi3F1(cxx,cyy,czz,cxy,cyz,cxz,cxxx,cyyy,czzz,cxxy,cxxz,cxyy,cyyz,cxzz,cyzz,
261     cxyz, r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z, r2h11x,i2h11x,r2h11y,i2h11y,
262     r2h11z,i2h11z)
263 
264 double cxx,cyy,czz,cxy,cyz,cxz,cxxx,cyyy,czzz,cxxy,cxxz,cxyy,cyyz,cxzz,cyzz;
265 double cxyz;
266 double r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z;
267 double r2h11x,i2h11x,r2h11y,i2h11y,r2h11z,i2h11z;
268 {
269     double temp;
270 
271     temp = S2i3F1(cxx,r1h1x,i1h1x,r1h1x,i1h1x,r2h11x,i2h11x,r2h11x,i2h11x)
272           +S2i3F1(cyy,r1h1y,i1h1y,r1h1y,i1h1y,r2h11y,i2h11y,r2h11y,i2h11y)
273           +S2i3F1(czz,r1h1z,i1h1z,r1h1z,i1h1z,r2h11z,i2h11z,r2h11z,i2h11z)
274           +S2i3F1(cxy,r1h1x,i1h1x,r1h1y,i1h1y,r2h11x,i2h11x,r2h11y,i2h11y);
275     temp +=
276           S2i3F1(cyz,r1h1y,i1h1y,r1h1z,i1h1z,r2h11y,i2h11y,r2h11z,i2h11z)
277           +S2i3F1(cxz,r1h1x,i1h1x,r1h1z,i1h1z,r2h11x,i2h11x,r2h11z,i2h11z)
278           +S3i3F1(cxxx,r1h1x,i1h1x,r1h1x,i1h1x,r1h1x,i1h1x)
279           +S3i3F1(cyyy,r1h1y,i1h1y,r1h1y,i1h1y,r1h1y,i1h1y);
280     temp +=
281           S3i3F1(czzz,r1h1z,i1h1z,r1h1z,i1h1z,r1h1z,i1h1z)
282           +S3i3F1(cxxy,r1h1x,i1h1x,r1h1x,i1h1x,r1h1y,i1h1y)
283           +S3i3F1(cxxz,r1h1x,i1h1x,r1h1x,i1h1x,r1h1z,i1h1z)
284           +S3i3F1(cxyy,r1h1x,i1h1x,r1h1y,i1h1y,r1h1y,i1h1y);
285     temp +=
286           S3i3F1(cyyz,r1h1y,i1h1y,r1h1y,i1h1y,r1h1z,i1h1z)
287           +S3i3F1(cxzz,r1h1x,i1h1x,r1h1z,i1h1z,r1h1z,i1h1z)
288           +S3i3F1(cyzz,r1h1y,i1h1y,r1h1z,i1h1z,r1h1z,i1h1z)
289           +S3i3F1(cxyz,r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z);
290 
291     return (temp);
292 }
293 
294 
295 double
DFnF12(cxx,cyy,czz,cxy,cyz,cxz,r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z,r1h2x,i1h2x,r1h2y,i1h2y,r1h2z,i1h2z)296 DFnF12(cxx,cyy,czz,cxy,cyz,cxz,r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z,
297     r1h2x,i1h2x,r1h2y,i1h2y,r1h2z,i1h2z)
298 
299 double cxx,cyy,czz,cxy,cyz,cxz;
300 double r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z;
301 double r1h2x,i1h2x,r1h2y,i1h2y,r1h2z,i1h2z;
302 {
303     double temp;
304 
305     temp = S2vF12(cxx,r1h1x,i1h1x,r1h1x,i1h1x,r1h2x,i1h2x,r1h2x,i1h2x)
306           +S2vF12(cyy,r1h1y,i1h1y,r1h1y,i1h1y,r1h2y,i1h2y,r1h2y,i1h2y)
307           +S2vF12(czz,r1h1z,i1h1z,r1h1z,i1h1z,r1h2z,i1h2z,r1h2z,i1h2z);
308     temp +=
309           S2vF12(cxy,r1h1x,i1h1x,r1h1y,i1h1y,r1h2x,i1h2x,r1h2y,i1h2y)
310           +S2vF12(cyz,r1h1y,i1h1y,r1h1z,i1h1z,r1h2y,i1h2y,r1h2z,i1h2z)
311           +S2vF12(cxz,r1h1x,i1h1x,r1h1z,i1h1z,r1h2x,i1h2x,r1h2z,i1h2z);
312 
313     return (0.5*temp);
314 }
315 
316 
317 double
DFiF12(cxx,cyy,czz,cxy,cyz,cxz,r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z,r1h2x,i1h2x,r1h2y,i1h2y,r1h2z,i1h2z)318 DFiF12(cxx,cyy,czz,cxy,cyz,cxz, r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z,
319     r1h2x,i1h2x,r1h2y,i1h2y,r1h2z,i1h2z)
320 
321 double cxx,cyy,czz,cxy,cyz,cxz;
322 double r1h1x,i1h1x,r1h1y,i1h1y,r1h1z,i1h1z;
323 double r1h2x,i1h2x,r1h2y,i1h2y,r1h2z,i1h2z;
324 {
325     double temp;
326 
327     temp = S2iF12(cxx,r1h1x,i1h1x,r1h1x,i1h1x,r1h2x,i1h2x,r1h2x,i1h2x)
328           +S2iF12(cyy,r1h1y,i1h1y,r1h1y,i1h1y,r1h2y,i1h2y,r1h2y,i1h2y)
329           +S2iF12(czz,r1h1z,i1h1z,r1h1z,i1h1z,r1h2z,i1h2z,r1h2z,i1h2z);
330     temp +=
331           S2iF12(cxy,r1h1x,i1h1x,r1h1y,i1h1y,r1h2x,i1h2x,r1h2y,i1h2y)
332           +S2iF12(cyz,r1h1y,i1h1y,r1h1z,i1h1z,r1h2y,i1h2y,r1h2z,i1h2z)
333           +S2iF12(cxz,r1h1x,i1h1x,r1h1z,i1h1z,r1h2x,i1h2x,r1h2z,i1h2z);
334 
335     return (temp*0.5); /* divided by two to scale down */
336 }
337 
338 
339 double
DFn2F12(p)340 DFn2F12(p)
341 
342 /*
343  * a structure because a standard C compiler can handle only
344  * 32 variables.
345  *
346  */
347 DpassStr* p;
348 {
349 double temp;
350 
351     temp = S2v2F12(p->cxx,p->r1h1x, p->i1h1x,
352         p->r1h1x, p->i1h1x, p->r1h2x, p->i1h2x,
353         p->r1h2x, p->i1h2x, p->r2h11x, p->i2h11x,
354         p->r2h11x, p->i2h11x, p->h2f1f2x, p->ih2f1f2x,
355         p->h2f1f2x, p->ih2f1f2x);
356     temp += S2v2F12(p->cyy, p->r1h1y, p->i1h1y,
357         p->r1h1y, p->i1h1y, p->r1h2y, p->i1h2y,
358         p->r1h2y, p->i1h2y, p->r2h11y, p->i2h11y,
359         p->r2h11y, p->i2h11y, p->h2f1f2y, p->ih2f1f2y,
360         p->h2f1f2y, p->ih2f1f2y);
361     temp += S2v2F12(p->czz, p->r1h1z, p->i1h1z,
362         p->r1h1z, p->i1h1z, p->r1h2z, p->i1h2z,
363         p->r1h2z, p->i1h2z, p->r2h11z, p->i2h11z,
364         p->r2h11z, p->i2h11z, p->h2f1f2z, p->ih2f1f2z,
365         p->h2f1f2z, p->ih2f1f2z);
366     temp += S2v2F12(p->cxy, p->r1h1x, p->i1h1x,
367         p->r1h1y, p->i1h1y, p->r1h2x, p->i1h2x,
368         p->r1h2y, p->i1h2y, p->r2h11x, p->i2h11x,
369         p->r2h11y, p->i2h11y, p->h2f1f2x, p->ih2f1f2x,
370         p->h2f1f2y, p->ih2f1f2y);
371     temp += S2v2F12(p->cyz, p->r1h1y, p->i1h1y,
372         p->r1h1z, p->i1h1z, p->r1h2y, p->i1h2y,
373         p->r1h2z, p->i1h2z, p->r2h11y, p->i2h11y,
374         p->r2h11z, p->i2h11z, p->h2f1f2y, p->ih2f1f2y,
375         p->h2f1f2z, p->ih2f1f2z);
376     temp += S2v2F12(p->cxz, p->r1h1x, p->i1h1x,
377         p->r1h1z, p->i1h1z, p->r1h2x, p->i1h2x,
378         p->r1h2z, p->i1h2z, p->r2h11x, p->i2h11x,
379         p->r2h11z, p->i2h11z, p->h2f1f2x, p->ih2f1f2x,
380         p->h2f1f2z, p->ih2f1f2z);
381     temp += S3v2F12(p->cxxx, p->r1h1x,
382         p->i1h1x, p->r1h1x, p->i1h1x, p->r1h1x, p->i1h1x,
383         p->r1h2x, p->i1h2x, p->r1h2x, p->i1h2x, p->r1h2x, p->i1h2x)
384         + S3v2F12(p->cyyy,p->r1h1y,
385         p->i1h1y, p->r1h1y, p->i1h1y, p->r1h1y, p->i1h1y,
386         p->r1h2y, p->i1h2y, p->r1h2y, p->i1h2y, p->r1h2y, p->i1h2y);
387     temp += S3v2F12(p->czzz, p->r1h1z,
388         p->i1h1z, p->r1h1z, p->i1h1z, p->r1h1z, p->i1h1z,
389         p->r1h2z, p->i1h2z, p->r1h2z, p->i1h2z, p->r1h2z, p->i1h2z)
390         + S3v2F12(p->cxxy,p->r1h1x,
391         p->i1h1x, p->r1h1x, p->i1h1x, p->r1h1y, p->i1h1y,
392         p->r1h2x, p->i1h2x, p->r1h2x, p->i1h2x, p->r1h2y, p->i1h2y);
393     temp += S3v2F12(p->cxxz,p->r1h1x,
394         p->i1h1x, p->r1h1x, p->i1h1x, p->r1h1z, p->i1h1z,
395         p->r1h2x, p->i1h2x, p->r1h2x, p->i1h2x, p->r1h2z, p->i1h2z)
396         + S3v2F12(p->cxyy,p->r1h1x,
397         p->i1h1x, p->r1h1y, p->i1h1y, p->r1h1y, p->i1h1y,
398         p->r1h2x, p->i1h2x, p->r1h2y, p->i1h2y, p->r1h2y, p->i1h2y);
399     temp += S3v2F12(p->cyyz, p->r1h1y,
400         p->i1h1y, p->r1h1y, p->i1h1y, p->r1h1z, p->i1h1z,
401         p->r1h2y, p->i1h2y, p->r1h2y, p->i1h2y, p->r1h2z, p->i1h2z)
402         + S3v2F12(p->cxzz, p->r1h1x,
403         p->i1h1x, p->r1h1z, p->i1h1z, p->r1h1z, p->i1h1z,
404         p->r1h2x, p->i1h2x, p->r1h2z, p->i1h2z, p->r1h2z, p->i1h2z);
405     temp += S3v2F12(p->cyzz, p->r1h1y,
406         p->i1h1y, p->r1h1z, p->i1h1z, p->r1h1z, p->i1h1z,
407         p->r1h2y, p->i1h2y, p->r1h2z, p->i1h2z, p->r1h2z, p->i1h2z)
408         + S3v2F12(p->cxyz, p->r1h1x,
409         p->i1h1x, p->r1h1y, p->i1h1y, p->r1h1z, p->i1h1z,
410         p->r1h2x, p->i1h2x, p->r1h2y, p->i1h2y, p->r1h2z, p->i1h2z);
411 
412     return (temp/3.);
413     /* divided by 3 to get kernel (otherwise we get 3*kernel) */
414 }
415 
416 
417 double
DFi2F12(p)418 DFi2F12(p)
419 DpassStr* p;
420 
421 {
422     double temp;
423 
424     temp = S2i2F12(p->cxx, p->r1h1x, p->i1h1x,
425         p->r1h1x, p->i1h1x, p->r1h2x, p->i1h2x,
426         p->r1h2x, p->i1h2x, p->r2h11x, p->i2h11x,
427         p->r2h11x, p->i2h11x, p->h2f1f2x, p->ih2f1f2x,
428         p->h2f1f2x, p->ih2f1f2x);
429     temp += S2i2F12(p->cyy, p->r1h1y, p->i1h1y,
430         p->r1h1y, p->i1h1y, p->r1h2y, p->i1h2y,
431         p->r1h2y, p->i1h2y, p->r2h11y, p->i2h11y,
432         p->r2h11y, p->i2h11y, p->h2f1f2y, p->ih2f1f2y,
433         p->h2f1f2y, p->ih2f1f2y);
434     temp += S2i2F12(p->czz, p->r1h1z, p->i1h1z,
435         p->r1h1z, p->i1h1z, p->r1h2z, p->i1h2z,
436         p->r1h2z, p->i1h2z, p->r2h11z, p->i2h11z,
437         p->r2h11z, p->i2h11z, p->h2f1f2z, p->ih2f1f2z,
438         p->h2f1f2z, p->ih2f1f2z);
439     temp += S2i2F12(p->cxy, p->r1h1x, p->i1h1x,
440         p->r1h1y, p->i1h1y, p->r1h2x, p->i1h2x,
441         p->r1h2y, p->i1h2y, p->r2h11x, p->i2h11x,
442         p->r2h11y, p->i2h11y, p->h2f1f2x, p->ih2f1f2x,
443         p->h2f1f2y, p->ih2f1f2y);
444     temp += S2i2F12(p->cyz, p->r1h1y, p->i1h1y,
445         p->r1h1z, p->i1h1z, p->r1h2y, p->i1h2y,
446         p->r1h2z, p->i1h2z, p->r2h11y, p->i2h11y,
447         p->r2h11z, p->i2h11z, p->h2f1f2y, p->ih2f1f2y,
448         p->h2f1f2z,p->ih2f1f2z);
449     temp += S2i2F12(p->cxz, p->r1h1x, p->i1h1x,
450         p->r1h1z, p->i1h1z, p->r1h2x, p->i1h2x,
451         p->r1h2z, p->i1h2z, p->r2h11x, p->i2h11x,
452         p->r2h11z, p->i2h11z, p->h2f1f2x, p->ih2f1f2x,
453         p->h2f1f2z, p->ih2f1f2z);
454     temp += S3i2F12(p->cxxx, p->r1h1x,
455         p->i1h1x, p->r1h1x, p->i1h1x, p->r1h1x, p->i1h1x,
456         p->r1h2x, p->i1h2x, p->r1h2x, p->i1h2x, p->r1h2x, p->i1h2x);
457     temp += S3i2F12(p->cyyy, p->r1h1y,
458         p->i1h1y, p->r1h1y, p->i1h1y, p->r1h1y, p->i1h1y,
459         p->r1h2y, p->i1h2y, p->r1h2y, p->i1h2y, p->r1h2y, p->i1h2y)
460         + S3i2F12(p->czzz, p->r1h1z,
461         p->i1h1z, p->r1h1z, p->i1h1z, p->r1h1z, p->i1h1z,
462         p->r1h2z, p->i1h2z, p->r1h2z, p->i1h2z, p->r1h2z, p->i1h2z);
463     temp += S3i2F12(p->cxxy, p->r1h1x,
464         p->i1h1x, p->r1h1x, p->i1h1x, p->r1h1y, p->i1h1y,
465         p->r1h2x, p->i1h2x, p->r1h2x, p->i1h2x, p->r1h2y, p->i1h2y)
466         + S3i2F12(p->cxxz, p->r1h1x,
467         p->i1h1x, p->r1h1x, p->i1h1x, p->r1h1z, p->i1h1z,
468         p->r1h2x, p->i1h2x, p->r1h2x, p->i1h2x, p->r1h2z, p->i1h2z);
469     temp += S3i2F12(p->cxyy, p->r1h1x,
470         p->i1h1x, p->r1h1y, p->i1h1y, p->r1h1y, p->i1h1y,
471         p->r1h2x, p->i1h2x, p->r1h2y, p->i1h2y, p->r1h2y, p->i1h2y)
472         + S3i2F12(p->cyyz, p->r1h1y,
473         p->i1h1y, p->r1h1y, p->i1h1y, p->r1h1z, p->i1h1z,
474         p->r1h2y, p->i1h2y, p->r1h2y, p->i1h2y, p->r1h2z, p->i1h2z);
475     temp += S3i2F12(p->cxzz, p->r1h1x,
476         p->i1h1x, p->r1h1z, p->i1h1z, p->r1h1z, p->i1h1z,
477         p->r1h2x, p->i1h2x, p->r1h2z, p->i1h2z, p->r1h2z, p->i1h2z);
478     temp += S3i2F12(p->cyzz, p->r1h1y,
479         p->i1h1y, p->r1h1z, p->i1h1z, p->r1h1z, p->i1h1z,
480         p->r1h2y, p->i1h2y, p->r1h2z, p->i1h2z, p->r1h2z, p->i1h2z)
481         + S3i2F12(p->cxyz, p->r1h1x,
482         p->i1h1x, p->r1h1y, p->i1h1y, p->r1h1z, p->i1h1z,
483         p->r1h2x, p->i1h2x, p->r1h2y, p->i1h2y, p->r1h2z, p->i1h2z);
484 
485     return (temp/3.);
486     /* divided by 3 to get kernel (otherwise we get 3*kernel) */
487 }
488 
489 
490 double
D1n2F1(cxx,r1h1x,i1h1x)491 D1n2F1(cxx,r1h1x,i1h1x)
492 
493 double cxx;
494 double r1h1x,i1h1x;
495 {
496     double temp;
497 
498     temp = S2v2F1(cxx,r1h1x,i1h1x,r1h1x,i1h1x);
499     return (temp);
500 }
501 
502 
503 double
D1n3F1(cxx,cxxx,r1h1x,i1h1x,r2h11x,i2h11x)504 D1n3F1(cxx,cxxx,r1h1x,i1h1x,r2h11x,i2h11x)
505 
506 double cxx,cxxx;
507 double r1h1x,i1h1x;
508 double r2h11x,i2h11x;
509 {
510     double temp;
511 
512     temp = S2v3F1(cxx,r1h1x,i1h1x,r1h1x,i1h1x,r2h11x,i2h11x,r2h11x,i2h11x)
513           + S3v3F1(cxxx,r1h1x,i1h1x,r1h1x,i1h1x,r1h1x,i1h1x);
514     return (temp);
515 }
516 
517 
518 double
D1nF12(cxx,r1h1x,i1h1x,r1h2x,i1h2x)519 D1nF12(cxx,r1h1x,i1h1x,r1h2x,i1h2x)
520 
521 double cxx;
522 double r1h1x,i1h1x;
523 double r1h2x,i1h2x;
524 {
525     double temp;
526 
527     temp = S2vF12(cxx,r1h1x,i1h1x,r1h1x,i1h1x,r1h2x,i1h2x,r1h2x,i1h2x);
528     return (0.5*temp);
529 }
530 
531 
532 double
D1n2F12(cxx,cxxx,r1h1x,i1h1x,r1h2x,i1h2x,r2h11x,i2h11x,h2f1f2x,ih2f1f2x)533 D1n2F12(cxx,cxxx,r1h1x,i1h1x,r1h2x,i1h2x,r2h11x,i2h11x,h2f1f2x,ih2f1f2x)
534 
535 double cxx,cxxx;
536 double r1h1x,i1h1x;
537 double r1h2x,i1h2x;
538 double r2h11x,i2h11x;
539 double h2f1f2x,ih2f1f2x;
540 {
541     double temp;
542 
543     temp = S2v2F12(cxx,r1h1x,i1h1x,r1h1x,i1h1x,r1h2x,i1h2x,r1h2x,i1h2x,
544         r2h11x,i2h11x,r2h11x,i2h11x,h2f1f2x,ih2f1f2x,h2f1f2x,ih2f1f2x)
545     + S3v2F12(cxxx,r1h1x,i1h1x,r1h1x,i1h1x,r1h1x,i1h1x,
546         r1h2x,i1h2x,r1h2x,i1h2x,r1h2x,i1h2x);
547 
548     return (temp/3.);
549     /* divided by 3 to get kernel (otherwise we get 3*kernel) */
550 }
551 
552 
553 double
D1i2F1(cxx,r1h1x,i1h1x)554 D1i2F1(cxx,r1h1x,i1h1x)
555 
556 double cxx;
557 double r1h1x,i1h1x;
558 {
559     double temp;
560 
561     temp = S2i2F1(cxx,r1h1x,i1h1x,r1h1x,i1h1x);
562     return (temp);
563 }
564 
565 
566 double
D1i3F1(cxx,cxxx,r1h1x,i1h1x,r2h11x,i2h11x)567 D1i3F1(cxx,cxxx,r1h1x,i1h1x,r2h11x,i2h11x)
568 
569 double cxx,cxxx;
570 double r1h1x,i1h1x;
571 double r2h11x,i2h11x;
572 {
573     double temp;
574 
575     temp = S2i3F1(cxx,r1h1x,i1h1x,r1h1x,i1h1x,r2h11x,i2h11x,r2h11x,i2h11x)
576         + S3i3F1(cxxx,r1h1x,i1h1x,r1h1x,i1h1x,r1h1x,i1h1x);
577 
578     return (temp);
579 }
580 
581 
582 double
D1iF12(cxx,r1h1x,i1h1x,r1h2x,i1h2x)583 D1iF12(cxx,r1h1x,i1h1x,r1h2x,i1h2x)
584 
585 double cxx;
586 double r1h1x,i1h1x;
587 double r1h2x,i1h2x;
588 {
589     double temp;
590 
591     temp = S2iF12(cxx,r1h1x,i1h1x,r1h1x,i1h1x,r1h2x,i1h2x,r1h2x,i1h2x);
592     return (0.5*temp);
593 }
594 
595 
596 double
D1i2F12(cxx,cxxx,r1h1x,i1h1x,r1h2x,i1h2x,r2h11x,i2h11x,h2f1f2x,ih2f1f2x)597 D1i2F12(cxx,cxxx,r1h1x,i1h1x,r1h2x,i1h2x,r2h11x,i2h11x,h2f1f2x,ih2f1f2x)
598 
599 double cxx,cxxx;
600 double r1h1x,i1h1x;
601 double r1h2x,i1h2x;
602 double r2h11x,i2h11x;
603 double h2f1f2x,ih2f1f2x;
604 {
605     double temp;
606 
607     temp = S2i2F12(cxx,r1h1x,i1h1x,r1h1x,i1h1x,r1h2x,i1h2x,r1h2x,i1h2x,
608         r2h11x,i2h11x,r2h11x,i2h11x,h2f1f2x,ih2f1f2x,h2f1f2x,ih2f1f2x)
609     + S3i2F12(cxxx,r1h1x,i1h1x,r1h1x,i1h1x,r1h1x,i1h1x,
610         r1h2x,i1h2x,r1h2x,i1h2x,r1h2x,i1h2x);
611 
612     return (temp/3.);
613     /* divided by 3 to get kernel (otherwise we get 3*kernel) */
614 }
615 
616