1 #include "simint/boys/boys.h"
2 #include "simint/ostei/gen/ostei_generated.h"
3 #include "simint/vectorization/vectorization.h"
4 #include <math.h>
5 #include <string.h>
6
7
ostei_h_d_h_d(struct simint_multi_shellpair const P,struct simint_multi_shellpair const Q,double screen_tol,double * const restrict work,double * const restrict INT__h_d_h_d)8 int ostei_h_d_h_d(struct simint_multi_shellpair const P,
9 struct simint_multi_shellpair const Q,
10 double screen_tol,
11 double * const restrict work,
12 double * const restrict INT__h_d_h_d)
13 {
14
15 SIMINT_ASSUME_ALIGN_DBL(work);
16 SIMINT_ASSUME_ALIGN_DBL(INT__h_d_h_d);
17 int ab, cd, abcd;
18 int istart, jstart;
19 int iprimcd, nprim_icd, icd;
20 const int check_screen = (screen_tol > 0.0);
21 int i, j;
22 int n;
23 int not_screened;
24 int real_abcd;
25 int iket;
26 int ibra;
27
28 // partition workspace
29 double * const INT__h_s_h_s = work + (SIMINT_NSHELL_SIMD * 0);
30 double * const INT__h_s_i_s = work + (SIMINT_NSHELL_SIMD * 441);
31 double * const INT__h_s_k_s = work + (SIMINT_NSHELL_SIMD * 1029);
32 double * const INT__i_s_h_s = work + (SIMINT_NSHELL_SIMD * 1785);
33 double * const INT__i_s_i_s = work + (SIMINT_NSHELL_SIMD * 2373);
34 double * const INT__i_s_k_s = work + (SIMINT_NSHELL_SIMD * 3157);
35 double * const INT__k_s_h_s = work + (SIMINT_NSHELL_SIMD * 4165);
36 double * const INT__k_s_i_s = work + (SIMINT_NSHELL_SIMD * 4921);
37 double * const INT__k_s_k_s = work + (SIMINT_NSHELL_SIMD * 5929);
38 SIMINT_DBLTYPE * const primwork = (SIMINT_DBLTYPE *)(work + SIMINT_NSHELL_SIMD*7225);
39 SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_s_s = primwork + 0;
40 SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_p_s = primwork + 15;
41 SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_d_s = primwork + 36;
42 SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_s_s = primwork + 72;
43 SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_p_s = primwork + 114;
44 SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_d_s = primwork + 177;
45 SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_f_s = primwork + 285;
46 SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_s_s = primwork + 435;
47 SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_p_s = primwork + 513;
48 SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_d_s = primwork + 639;
49 SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_f_s = primwork + 855;
50 SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_g_s = primwork + 1155;
51 SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_s_s = primwork + 1515;
52 SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_p_s = primwork + 1635;
53 SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_d_s = primwork + 1845;
54 SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_f_s = primwork + 2205;
55 SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_g_s = primwork + 2705;
56 SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_h_s = primwork + 3305;
57 SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_s_s = primwork + 3935;
58 SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_p_s = primwork + 4100;
59 SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_d_s = primwork + 4415;
60 SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_f_s = primwork + 4955;
61 SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_g_s = primwork + 5705;
62 SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_h_s = primwork + 6605;
63 SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_i_s = primwork + 7550;
64 SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_s_s = primwork + 8390;
65 SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_p_s = primwork + 8600;
66 SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_d_s = primwork + 9041;
67 SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_f_s = primwork + 9797;
68 SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_g_s = primwork + 10847;
69 SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_h_s = primwork + 12107;
70 SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_i_s = primwork + 13430;
71 SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_k_s = primwork + 14606;
72 SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_s_s = primwork + 15362;
73 SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_p_s = primwork + 15614;
74 SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_d_s = primwork + 16202;
75 SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_f_s = primwork + 17210;
76 SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_g_s = primwork + 18610;
77 SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_h_s = primwork + 20290;
78 SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_i_s = primwork + 22054;
79 SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_k_s = primwork + 23622;
80 SIMINT_DBLTYPE * const restrict PRIM_INT__k_s_s_s = primwork + 24630;
81 SIMINT_DBLTYPE * const restrict PRIM_INT__k_s_p_s = primwork + 24918;
82 SIMINT_DBLTYPE * const restrict PRIM_INT__k_s_d_s = primwork + 25674;
83 SIMINT_DBLTYPE * const restrict PRIM_INT__k_s_f_s = primwork + 26970;
84 SIMINT_DBLTYPE * const restrict PRIM_INT__k_s_g_s = primwork + 28770;
85 SIMINT_DBLTYPE * const restrict PRIM_INT__k_s_h_s = primwork + 30930;
86 SIMINT_DBLTYPE * const restrict PRIM_INT__k_s_i_s = primwork + 33198;
87 SIMINT_DBLTYPE * const restrict PRIM_INT__k_s_k_s = primwork + 35214;
88 double * const hrrwork = (double *)(primwork + 36510);
89 double * const HRR_INT__h_p_h_s = hrrwork + 0;
90 double * const HRR_INT__h_p_i_s = hrrwork + 1323;
91 double * const HRR_INT__h_p_k_s = hrrwork + 3087;
92 double * const HRR_INT__h_d_h_s = hrrwork + 5355;
93 double * const HRR_INT__h_d_h_p = hrrwork + 8001;
94 double * const HRR_INT__h_d_i_s = hrrwork + 15939;
95 double * const HRR_INT__h_d_i_p = hrrwork + 19467;
96 double * const HRR_INT__h_d_k_s = hrrwork + 30051;
97 double * const HRR_INT__i_p_h_s = hrrwork + 34587;
98 double * const HRR_INT__i_p_i_s = hrrwork + 36351;
99 double * const HRR_INT__i_p_k_s = hrrwork + 38703;
100
101
102 // Create constants
103 const SIMINT_DBLTYPE const_1 = SIMINT_DBLSET1(1);
104 const SIMINT_DBLTYPE const_2 = SIMINT_DBLSET1(2);
105 const SIMINT_DBLTYPE const_3 = SIMINT_DBLSET1(3);
106 const SIMINT_DBLTYPE const_4 = SIMINT_DBLSET1(4);
107 const SIMINT_DBLTYPE const_5 = SIMINT_DBLSET1(5);
108 const SIMINT_DBLTYPE const_6 = SIMINT_DBLSET1(6);
109 const SIMINT_DBLTYPE const_7 = SIMINT_DBLSET1(7);
110 const SIMINT_DBLTYPE one_half = SIMINT_DBLSET1(0.5);
111
112
113 ////////////////////////////////////////
114 // Loop over shells and primitives
115 ////////////////////////////////////////
116
117 real_abcd = 0;
118 istart = 0;
119 for(ab = 0; ab < P.nshell12_clip; ++ab)
120 {
121 const int iend = istart + P.nprim12[ab];
122
123 cd = 0;
124 jstart = 0;
125
126 for(cd = 0; cd < Q.nshell12_clip; cd += SIMINT_NSHELL_SIMD)
127 {
128 const int nshellbatch = ((cd + SIMINT_NSHELL_SIMD) > Q.nshell12_clip) ? Q.nshell12_clip - cd : SIMINT_NSHELL_SIMD;
129 int jend = jstart;
130 for(i = 0; i < nshellbatch; i++)
131 jend += Q.nprim12[cd+i];
132
133 // Clear the beginning of the workspace (where we are accumulating integrals)
134 memset(work, 0, SIMINT_NSHELL_SIMD * 7225 * sizeof(double));
135 abcd = 0;
136
137
138 for(i = istart; i < iend; ++i)
139 {
140 SIMINT_DBLTYPE bra_screen_max; // only used if check_screen
141
142 if(check_screen)
143 {
144 // Skip this whole thing if always insignificant
145 if((P.screen[i] * Q.screen_max) < screen_tol)
146 continue;
147 bra_screen_max = SIMINT_DBLSET1(P.screen[i]);
148 }
149
150 icd = 0;
151 iprimcd = 0;
152 nprim_icd = Q.nprim12[cd];
153 double * restrict PRIM_PTR_INT__h_s_h_s = INT__h_s_h_s + abcd * 441;
154 double * restrict PRIM_PTR_INT__h_s_i_s = INT__h_s_i_s + abcd * 588;
155 double * restrict PRIM_PTR_INT__h_s_k_s = INT__h_s_k_s + abcd * 756;
156 double * restrict PRIM_PTR_INT__i_s_h_s = INT__i_s_h_s + abcd * 588;
157 double * restrict PRIM_PTR_INT__i_s_i_s = INT__i_s_i_s + abcd * 784;
158 double * restrict PRIM_PTR_INT__i_s_k_s = INT__i_s_k_s + abcd * 1008;
159 double * restrict PRIM_PTR_INT__k_s_h_s = INT__k_s_h_s + abcd * 756;
160 double * restrict PRIM_PTR_INT__k_s_i_s = INT__k_s_i_s + abcd * 1008;
161 double * restrict PRIM_PTR_INT__k_s_k_s = INT__k_s_k_s + abcd * 1296;
162
163
164
165 // Load these one per loop over i
166 const SIMINT_DBLTYPE P_alpha = SIMINT_DBLSET1(P.alpha[i]);
167 const SIMINT_DBLTYPE P_prefac = SIMINT_DBLSET1(P.prefac[i]);
168 const SIMINT_DBLTYPE Pxyz[3] = { SIMINT_DBLSET1(P.x[i]), SIMINT_DBLSET1(P.y[i]), SIMINT_DBLSET1(P.z[i]) };
169
170 const SIMINT_DBLTYPE P_PA[3] = { SIMINT_DBLSET1(P.PA_x[i]), SIMINT_DBLSET1(P.PA_y[i]), SIMINT_DBLSET1(P.PA_z[i]) };
171
172 for(j = jstart; j < jend; j += SIMINT_SIMD_LEN)
173 {
174 // calculate the shell offsets
175 // these are the offset from the shell pointed to by cd
176 // for each element
177 int shelloffsets[SIMINT_SIMD_LEN] = {0};
178 int lastoffset = 0;
179 const int nlane = ( ((j + SIMINT_SIMD_LEN) < jend) ? SIMINT_SIMD_LEN : (jend - j));
180
181 if((iprimcd + SIMINT_SIMD_LEN) >= nprim_icd)
182 {
183 // Handle if the first element of the vector is a new shell
184 if(iprimcd >= nprim_icd && ((icd+1) < nshellbatch))
185 {
186 nprim_icd += Q.nprim12[cd + (++icd)];
187 PRIM_PTR_INT__h_s_h_s += 441;
188 PRIM_PTR_INT__h_s_i_s += 588;
189 PRIM_PTR_INT__h_s_k_s += 756;
190 PRIM_PTR_INT__i_s_h_s += 588;
191 PRIM_PTR_INT__i_s_i_s += 784;
192 PRIM_PTR_INT__i_s_k_s += 1008;
193 PRIM_PTR_INT__k_s_h_s += 756;
194 PRIM_PTR_INT__k_s_i_s += 1008;
195 PRIM_PTR_INT__k_s_k_s += 1296;
196 }
197 iprimcd++;
198 for(n = 1; n < SIMINT_SIMD_LEN; ++n)
199 {
200 if(iprimcd >= nprim_icd && ((icd+1) < nshellbatch))
201 {
202 shelloffsets[n] = shelloffsets[n-1] + 1;
203 lastoffset++;
204 nprim_icd += Q.nprim12[cd + (++icd)];
205 }
206 else
207 shelloffsets[n] = shelloffsets[n-1];
208 iprimcd++;
209 }
210 }
211 else
212 iprimcd += SIMINT_SIMD_LEN;
213
214 // Do we have to compute this vector (or has it been screened out)?
215 // (not_screened != 0 means we have to do this vector)
216 if(check_screen)
217 {
218 const double vmax = vector_max(SIMINT_MUL(bra_screen_max, SIMINT_DBLLOAD(Q.screen, j)));
219 if(vmax < screen_tol)
220 {
221 PRIM_PTR_INT__h_s_h_s += lastoffset*441;
222 PRIM_PTR_INT__h_s_i_s += lastoffset*588;
223 PRIM_PTR_INT__h_s_k_s += lastoffset*756;
224 PRIM_PTR_INT__i_s_h_s += lastoffset*588;
225 PRIM_PTR_INT__i_s_i_s += lastoffset*784;
226 PRIM_PTR_INT__i_s_k_s += lastoffset*1008;
227 PRIM_PTR_INT__k_s_h_s += lastoffset*756;
228 PRIM_PTR_INT__k_s_i_s += lastoffset*1008;
229 PRIM_PTR_INT__k_s_k_s += lastoffset*1296;
230 continue;
231 }
232 }
233
234 const SIMINT_DBLTYPE Q_alpha = SIMINT_DBLLOAD(Q.alpha, j);
235 const SIMINT_DBLTYPE PQalpha_mul = SIMINT_MUL(P_alpha, Q_alpha);
236 const SIMINT_DBLTYPE PQalpha_sum = SIMINT_ADD(P_alpha, Q_alpha);
237 const SIMINT_DBLTYPE one_over_PQalpha_sum = SIMINT_DIV(const_1, PQalpha_sum);
238
239
240 /* construct R2 = (Px - Qx)**2 + (Py - Qy)**2 + (Pz -Qz)**2 */
241 SIMINT_DBLTYPE PQ[3];
242 PQ[0] = SIMINT_SUB(Pxyz[0], SIMINT_DBLLOAD(Q.x, j));
243 PQ[1] = SIMINT_SUB(Pxyz[1], SIMINT_DBLLOAD(Q.y, j));
244 PQ[2] = SIMINT_SUB(Pxyz[2], SIMINT_DBLLOAD(Q.z, j));
245 SIMINT_DBLTYPE R2 = SIMINT_MUL(PQ[0], PQ[0]);
246 R2 = SIMINT_FMADD(PQ[1], PQ[1], R2);
247 R2 = SIMINT_FMADD(PQ[2], PQ[2], R2);
248
249 const SIMINT_DBLTYPE alpha = SIMINT_MUL(PQalpha_mul, one_over_PQalpha_sum); // alpha from MEST
250 const SIMINT_DBLTYPE one_over_p = SIMINT_DIV(const_1, P_alpha);
251 const SIMINT_DBLTYPE one_over_q = SIMINT_DIV(const_1, Q_alpha);
252 const SIMINT_DBLTYPE one_over_2p = SIMINT_MUL(one_half, one_over_p);
253 const SIMINT_DBLTYPE one_over_2q = SIMINT_MUL(one_half, one_over_q);
254 const SIMINT_DBLTYPE one_over_2pq = SIMINT_MUL(one_half, one_over_PQalpha_sum);
255 const SIMINT_DBLTYPE Q_PA[3] = { SIMINT_DBLLOAD(Q.PA_x, j), SIMINT_DBLLOAD(Q.PA_y, j), SIMINT_DBLLOAD(Q.PA_z, j) };
256
257 // NOTE: Minus sign!
258 const SIMINT_DBLTYPE a_over_p = SIMINT_MUL(SIMINT_NEG(alpha), one_over_p);
259 SIMINT_DBLTYPE aop_PQ[3];
260 aop_PQ[0] = SIMINT_MUL(a_over_p, PQ[0]);
261 aop_PQ[1] = SIMINT_MUL(a_over_p, PQ[1]);
262 aop_PQ[2] = SIMINT_MUL(a_over_p, PQ[2]);
263
264 SIMINT_DBLTYPE a_over_q = SIMINT_MUL(alpha, one_over_q);
265 SIMINT_DBLTYPE aoq_PQ[3];
266 aoq_PQ[0] = SIMINT_MUL(a_over_q, PQ[0]);
267 aoq_PQ[1] = SIMINT_MUL(a_over_q, PQ[1]);
268 aoq_PQ[2] = SIMINT_MUL(a_over_q, PQ[2]);
269 // Put a minus sign here so we don't have to in RR routines
270 a_over_q = SIMINT_NEG(a_over_q);
271
272
273 //////////////////////////////////////////////
274 // Fjt function section
275 // Maximum v value: 14
276 //////////////////////////////////////////////
277 // The parameter to the Fjt function
278 const SIMINT_DBLTYPE F_x = SIMINT_MUL(R2, alpha);
279
280
281 const SIMINT_DBLTYPE Q_prefac = mask_load(nlane, Q.prefac + j);
282
283
284 boys_F_split(PRIM_INT__s_s_s_s, F_x, 14);
285 SIMINT_DBLTYPE prefac = SIMINT_SQRT(one_over_PQalpha_sum);
286 prefac = SIMINT_MUL(SIMINT_MUL(P_prefac, Q_prefac), prefac);
287 for(n = 0; n <= 14; n++)
288 PRIM_INT__s_s_s_s[n] = SIMINT_MUL(PRIM_INT__s_s_s_s[n], prefac);
289
290 //////////////////////////////////////////////
291 // Primitive integrals: Vertical recurrance
292 //////////////////////////////////////////////
293
294 const SIMINT_DBLTYPE vrr_const_1_over_2p = one_over_2p;
295 const SIMINT_DBLTYPE vrr_const_2_over_2p = SIMINT_MUL(const_2, one_over_2p);
296 const SIMINT_DBLTYPE vrr_const_3_over_2p = SIMINT_MUL(const_3, one_over_2p);
297 const SIMINT_DBLTYPE vrr_const_4_over_2p = SIMINT_MUL(const_4, one_over_2p);
298 const SIMINT_DBLTYPE vrr_const_5_over_2p = SIMINT_MUL(const_5, one_over_2p);
299 const SIMINT_DBLTYPE vrr_const_6_over_2p = SIMINT_MUL(const_6, one_over_2p);
300 const SIMINT_DBLTYPE vrr_const_1_over_2q = one_over_2q;
301 const SIMINT_DBLTYPE vrr_const_2_over_2q = SIMINT_MUL(const_2, one_over_2q);
302 const SIMINT_DBLTYPE vrr_const_3_over_2q = SIMINT_MUL(const_3, one_over_2q);
303 const SIMINT_DBLTYPE vrr_const_4_over_2q = SIMINT_MUL(const_4, one_over_2q);
304 const SIMINT_DBLTYPE vrr_const_5_over_2q = SIMINT_MUL(const_5, one_over_2q);
305 const SIMINT_DBLTYPE vrr_const_6_over_2q = SIMINT_MUL(const_6, one_over_2q);
306 const SIMINT_DBLTYPE vrr_const_1_over_2pq = one_over_2pq;
307 const SIMINT_DBLTYPE vrr_const_2_over_2pq = SIMINT_MUL(const_2, one_over_2pq);
308 const SIMINT_DBLTYPE vrr_const_3_over_2pq = SIMINT_MUL(const_3, one_over_2pq);
309 const SIMINT_DBLTYPE vrr_const_4_over_2pq = SIMINT_MUL(const_4, one_over_2pq);
310 const SIMINT_DBLTYPE vrr_const_5_over_2pq = SIMINT_MUL(const_5, one_over_2pq);
311 const SIMINT_DBLTYPE vrr_const_6_over_2pq = SIMINT_MUL(const_6, one_over_2pq);
312 const SIMINT_DBLTYPE vrr_const_7_over_2pq = SIMINT_MUL(const_7, one_over_2pq);
313
314
315
316 // Forming PRIM_INT__p_s_s_s[14 * 3];
317 for(n = 0; n < 14; ++n) // loop over orders of auxiliary function
318 {
319
320 PRIM_INT__p_s_s_s[n * 3 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_s_s[n * 1 + 0]);
321 PRIM_INT__p_s_s_s[n * 3 + 0] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__p_s_s_s[n * 3 + 0]);
322
323 PRIM_INT__p_s_s_s[n * 3 + 1] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_s_s[n * 1 + 0]);
324 PRIM_INT__p_s_s_s[n * 3 + 1] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__p_s_s_s[n * 3 + 1]);
325
326 PRIM_INT__p_s_s_s[n * 3 + 2] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_s_s[n * 1 + 0]);
327 PRIM_INT__p_s_s_s[n * 3 + 2] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__p_s_s_s[n * 3 + 2]);
328
329 }
330
331
332
333 // Forming PRIM_INT__d_s_s_s[13 * 6];
334 for(n = 0; n < 13; ++n) // loop over orders of auxiliary function
335 {
336
337 PRIM_INT__d_s_s_s[n * 6 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__p_s_s_s[n * 3 + 0]);
338 PRIM_INT__d_s_s_s[n * 6 + 0] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__d_s_s_s[n * 6 + 0]);
339 PRIM_INT__d_s_s_s[n * 6 + 0] = SIMINT_FMADD( vrr_const_1_over_2p, SIMINT_FMADD(a_over_p, PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__s_s_s_s[n * 1 + 0]), PRIM_INT__d_s_s_s[n * 6 + 0]);
340
341 PRIM_INT__d_s_s_s[n * 6 + 1] = SIMINT_MUL(P_PA[1], PRIM_INT__p_s_s_s[n * 3 + 0]);
342 PRIM_INT__d_s_s_s[n * 6 + 1] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__d_s_s_s[n * 6 + 1]);
343
344 PRIM_INT__d_s_s_s[n * 6 + 2] = SIMINT_MUL(P_PA[2], PRIM_INT__p_s_s_s[n * 3 + 0]);
345 PRIM_INT__d_s_s_s[n * 6 + 2] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__d_s_s_s[n * 6 + 2]);
346
347 PRIM_INT__d_s_s_s[n * 6 + 3] = SIMINT_MUL(P_PA[1], PRIM_INT__p_s_s_s[n * 3 + 1]);
348 PRIM_INT__d_s_s_s[n * 6 + 3] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__d_s_s_s[n * 6 + 3]);
349 PRIM_INT__d_s_s_s[n * 6 + 3] = SIMINT_FMADD( vrr_const_1_over_2p, SIMINT_FMADD(a_over_p, PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__s_s_s_s[n * 1 + 0]), PRIM_INT__d_s_s_s[n * 6 + 3]);
350
351 PRIM_INT__d_s_s_s[n * 6 + 4] = SIMINT_MUL(P_PA[2], PRIM_INT__p_s_s_s[n * 3 + 1]);
352 PRIM_INT__d_s_s_s[n * 6 + 4] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__d_s_s_s[n * 6 + 4]);
353
354 PRIM_INT__d_s_s_s[n * 6 + 5] = SIMINT_MUL(P_PA[2], PRIM_INT__p_s_s_s[n * 3 + 2]);
355 PRIM_INT__d_s_s_s[n * 6 + 5] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__d_s_s_s[n * 6 + 5]);
356 PRIM_INT__d_s_s_s[n * 6 + 5] = SIMINT_FMADD( vrr_const_1_over_2p, SIMINT_FMADD(a_over_p, PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__s_s_s_s[n * 1 + 0]), PRIM_INT__d_s_s_s[n * 6 + 5]);
357
358 }
359
360
361
362 // Forming PRIM_INT__f_s_s_s[12 * 10];
363 for(n = 0; n < 12; ++n) // loop over orders of auxiliary function
364 {
365
366 PRIM_INT__f_s_s_s[n * 10 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__d_s_s_s[n * 6 + 0]);
367 PRIM_INT__f_s_s_s[n * 10 + 0] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__d_s_s_s[(n+1) * 6 + 0], PRIM_INT__f_s_s_s[n * 10 + 0]);
368 PRIM_INT__f_s_s_s[n * 10 + 0] = SIMINT_FMADD( vrr_const_2_over_2p, SIMINT_FMADD(a_over_p, PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__p_s_s_s[n * 3 + 0]), PRIM_INT__f_s_s_s[n * 10 + 0]);
369
370 PRIM_INT__f_s_s_s[n * 10 + 1] = SIMINT_MUL(P_PA[1], PRIM_INT__d_s_s_s[n * 6 + 0]);
371 PRIM_INT__f_s_s_s[n * 10 + 1] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__d_s_s_s[(n+1) * 6 + 0], PRIM_INT__f_s_s_s[n * 10 + 1]);
372
373 PRIM_INT__f_s_s_s[n * 10 + 2] = SIMINT_MUL(P_PA[2], PRIM_INT__d_s_s_s[n * 6 + 0]);
374 PRIM_INT__f_s_s_s[n * 10 + 2] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 0], PRIM_INT__f_s_s_s[n * 10 + 2]);
375
376 PRIM_INT__f_s_s_s[n * 10 + 3] = SIMINT_MUL(P_PA[0], PRIM_INT__d_s_s_s[n * 6 + 3]);
377 PRIM_INT__f_s_s_s[n * 10 + 3] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__d_s_s_s[(n+1) * 6 + 3], PRIM_INT__f_s_s_s[n * 10 + 3]);
378
379 PRIM_INT__f_s_s_s[n * 10 + 4] = SIMINT_MUL(P_PA[2], PRIM_INT__d_s_s_s[n * 6 + 1]);
380 PRIM_INT__f_s_s_s[n * 10 + 4] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 1], PRIM_INT__f_s_s_s[n * 10 + 4]);
381
382 PRIM_INT__f_s_s_s[n * 10 + 5] = SIMINT_MUL(P_PA[0], PRIM_INT__d_s_s_s[n * 6 + 5]);
383 PRIM_INT__f_s_s_s[n * 10 + 5] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__d_s_s_s[(n+1) * 6 + 5], PRIM_INT__f_s_s_s[n * 10 + 5]);
384
385 PRIM_INT__f_s_s_s[n * 10 + 6] = SIMINT_MUL(P_PA[1], PRIM_INT__d_s_s_s[n * 6 + 3]);
386 PRIM_INT__f_s_s_s[n * 10 + 6] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__d_s_s_s[(n+1) * 6 + 3], PRIM_INT__f_s_s_s[n * 10 + 6]);
387 PRIM_INT__f_s_s_s[n * 10 + 6] = SIMINT_FMADD( vrr_const_2_over_2p, SIMINT_FMADD(a_over_p, PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__p_s_s_s[n * 3 + 1]), PRIM_INT__f_s_s_s[n * 10 + 6]);
388
389 PRIM_INT__f_s_s_s[n * 10 + 7] = SIMINT_MUL(P_PA[2], PRIM_INT__d_s_s_s[n * 6 + 3]);
390 PRIM_INT__f_s_s_s[n * 10 + 7] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 3], PRIM_INT__f_s_s_s[n * 10 + 7]);
391
392 PRIM_INT__f_s_s_s[n * 10 + 8] = SIMINT_MUL(P_PA[1], PRIM_INT__d_s_s_s[n * 6 + 5]);
393 PRIM_INT__f_s_s_s[n * 10 + 8] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__d_s_s_s[(n+1) * 6 + 5], PRIM_INT__f_s_s_s[n * 10 + 8]);
394
395 PRIM_INT__f_s_s_s[n * 10 + 9] = SIMINT_MUL(P_PA[2], PRIM_INT__d_s_s_s[n * 6 + 5]);
396 PRIM_INT__f_s_s_s[n * 10 + 9] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 5], PRIM_INT__f_s_s_s[n * 10 + 9]);
397 PRIM_INT__f_s_s_s[n * 10 + 9] = SIMINT_FMADD( vrr_const_2_over_2p, SIMINT_FMADD(a_over_p, PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__p_s_s_s[n * 3 + 2]), PRIM_INT__f_s_s_s[n * 10 + 9]);
398
399 }
400
401
402 VRR_I_g_s_s_s(
403 PRIM_INT__g_s_s_s,
404 PRIM_INT__f_s_s_s,
405 PRIM_INT__d_s_s_s,
406 P_PA,
407 a_over_p,
408 aop_PQ,
409 one_over_2p,
410 11);
411
412
413 VRR_I_h_s_s_s(
414 PRIM_INT__h_s_s_s,
415 PRIM_INT__g_s_s_s,
416 PRIM_INT__f_s_s_s,
417 P_PA,
418 a_over_p,
419 aop_PQ,
420 one_over_2p,
421 10);
422
423
424 ostei_general_vrr_K(5, 0, 1, 0, 7,
425 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
426 PRIM_INT__h_s_s_s, NULL, NULL, PRIM_INT__g_s_s_s, NULL, PRIM_INT__h_s_p_s);
427
428
429 VRR_K_g_s_p_s(
430 PRIM_INT__g_s_p_s,
431 PRIM_INT__g_s_s_s,
432 PRIM_INT__f_s_s_s,
433 Q_PA,
434 aoq_PQ,
435 one_over_2pq,
436 7);
437
438
439 ostei_general_vrr_K(5, 0, 2, 0, 6,
440 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
441 PRIM_INT__h_s_p_s, PRIM_INT__h_s_s_s, NULL, PRIM_INT__g_s_p_s, NULL, PRIM_INT__h_s_d_s);
442
443
444 VRR_K_f_s_p_s(
445 PRIM_INT__f_s_p_s,
446 PRIM_INT__f_s_s_s,
447 PRIM_INT__d_s_s_s,
448 Q_PA,
449 aoq_PQ,
450 one_over_2pq,
451 7);
452
453
454 ostei_general_vrr_K(4, 0, 2, 0, 6,
455 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
456 PRIM_INT__g_s_p_s, PRIM_INT__g_s_s_s, NULL, PRIM_INT__f_s_p_s, NULL, PRIM_INT__g_s_d_s);
457
458
459 ostei_general_vrr_K(5, 0, 3, 0, 5,
460 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
461 PRIM_INT__h_s_d_s, PRIM_INT__h_s_p_s, NULL, PRIM_INT__g_s_d_s, NULL, PRIM_INT__h_s_f_s);
462
463
464
465 // Forming PRIM_INT__d_s_p_s[7 * 18];
466 for(n = 0; n < 7; ++n) // loop over orders of auxiliary function
467 {
468
469 PRIM_INT__d_s_p_s[n * 18 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__d_s_s_s[n * 6 + 0]);
470 PRIM_INT__d_s_p_s[n * 18 + 0] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__d_s_s_s[(n+1) * 6 + 0], PRIM_INT__d_s_p_s[n * 18 + 0]);
471 PRIM_INT__d_s_p_s[n * 18 + 0] = SIMINT_FMADD( vrr_const_2_over_2pq, PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__d_s_p_s[n * 18 + 0]);
472
473 PRIM_INT__d_s_p_s[n * 18 + 1] = SIMINT_MUL(Q_PA[1], PRIM_INT__d_s_s_s[n * 6 + 0]);
474 PRIM_INT__d_s_p_s[n * 18 + 1] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__d_s_s_s[(n+1) * 6 + 0], PRIM_INT__d_s_p_s[n * 18 + 1]);
475
476 PRIM_INT__d_s_p_s[n * 18 + 2] = SIMINT_MUL(Q_PA[2], PRIM_INT__d_s_s_s[n * 6 + 0]);
477 PRIM_INT__d_s_p_s[n * 18 + 2] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 0], PRIM_INT__d_s_p_s[n * 18 + 2]);
478
479 PRIM_INT__d_s_p_s[n * 18 + 3] = SIMINT_MUL(Q_PA[0], PRIM_INT__d_s_s_s[n * 6 + 1]);
480 PRIM_INT__d_s_p_s[n * 18 + 3] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__d_s_s_s[(n+1) * 6 + 1], PRIM_INT__d_s_p_s[n * 18 + 3]);
481 PRIM_INT__d_s_p_s[n * 18 + 3] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__d_s_p_s[n * 18 + 3]);
482
483 PRIM_INT__d_s_p_s[n * 18 + 4] = SIMINT_MUL(Q_PA[1], PRIM_INT__d_s_s_s[n * 6 + 1]);
484 PRIM_INT__d_s_p_s[n * 18 + 4] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__d_s_s_s[(n+1) * 6 + 1], PRIM_INT__d_s_p_s[n * 18 + 4]);
485 PRIM_INT__d_s_p_s[n * 18 + 4] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__d_s_p_s[n * 18 + 4]);
486
487 PRIM_INT__d_s_p_s[n * 18 + 5] = SIMINT_MUL(Q_PA[2], PRIM_INT__d_s_s_s[n * 6 + 1]);
488 PRIM_INT__d_s_p_s[n * 18 + 5] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 1], PRIM_INT__d_s_p_s[n * 18 + 5]);
489
490 PRIM_INT__d_s_p_s[n * 18 + 6] = SIMINT_MUL(Q_PA[0], PRIM_INT__d_s_s_s[n * 6 + 2]);
491 PRIM_INT__d_s_p_s[n * 18 + 6] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__d_s_s_s[(n+1) * 6 + 2], PRIM_INT__d_s_p_s[n * 18 + 6]);
492 PRIM_INT__d_s_p_s[n * 18 + 6] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__d_s_p_s[n * 18 + 6]);
493
494 PRIM_INT__d_s_p_s[n * 18 + 7] = SIMINT_MUL(Q_PA[1], PRIM_INT__d_s_s_s[n * 6 + 2]);
495 PRIM_INT__d_s_p_s[n * 18 + 7] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__d_s_s_s[(n+1) * 6 + 2], PRIM_INT__d_s_p_s[n * 18 + 7]);
496
497 PRIM_INT__d_s_p_s[n * 18 + 8] = SIMINT_MUL(Q_PA[2], PRIM_INT__d_s_s_s[n * 6 + 2]);
498 PRIM_INT__d_s_p_s[n * 18 + 8] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 2], PRIM_INT__d_s_p_s[n * 18 + 8]);
499 PRIM_INT__d_s_p_s[n * 18 + 8] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__d_s_p_s[n * 18 + 8]);
500
501 PRIM_INT__d_s_p_s[n * 18 + 9] = SIMINT_MUL(Q_PA[0], PRIM_INT__d_s_s_s[n * 6 + 3]);
502 PRIM_INT__d_s_p_s[n * 18 + 9] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__d_s_s_s[(n+1) * 6 + 3], PRIM_INT__d_s_p_s[n * 18 + 9]);
503
504 PRIM_INT__d_s_p_s[n * 18 + 10] = SIMINT_MUL(Q_PA[1], PRIM_INT__d_s_s_s[n * 6 + 3]);
505 PRIM_INT__d_s_p_s[n * 18 + 10] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__d_s_s_s[(n+1) * 6 + 3], PRIM_INT__d_s_p_s[n * 18 + 10]);
506 PRIM_INT__d_s_p_s[n * 18 + 10] = SIMINT_FMADD( vrr_const_2_over_2pq, PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__d_s_p_s[n * 18 + 10]);
507
508 PRIM_INT__d_s_p_s[n * 18 + 11] = SIMINT_MUL(Q_PA[2], PRIM_INT__d_s_s_s[n * 6 + 3]);
509 PRIM_INT__d_s_p_s[n * 18 + 11] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 3], PRIM_INT__d_s_p_s[n * 18 + 11]);
510
511 PRIM_INT__d_s_p_s[n * 18 + 12] = SIMINT_MUL(Q_PA[0], PRIM_INT__d_s_s_s[n * 6 + 4]);
512 PRIM_INT__d_s_p_s[n * 18 + 12] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__d_s_s_s[(n+1) * 6 + 4], PRIM_INT__d_s_p_s[n * 18 + 12]);
513
514 PRIM_INT__d_s_p_s[n * 18 + 13] = SIMINT_MUL(Q_PA[1], PRIM_INT__d_s_s_s[n * 6 + 4]);
515 PRIM_INT__d_s_p_s[n * 18 + 13] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__d_s_s_s[(n+1) * 6 + 4], PRIM_INT__d_s_p_s[n * 18 + 13]);
516 PRIM_INT__d_s_p_s[n * 18 + 13] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__d_s_p_s[n * 18 + 13]);
517
518 PRIM_INT__d_s_p_s[n * 18 + 14] = SIMINT_MUL(Q_PA[2], PRIM_INT__d_s_s_s[n * 6 + 4]);
519 PRIM_INT__d_s_p_s[n * 18 + 14] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 4], PRIM_INT__d_s_p_s[n * 18 + 14]);
520 PRIM_INT__d_s_p_s[n * 18 + 14] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__d_s_p_s[n * 18 + 14]);
521
522 PRIM_INT__d_s_p_s[n * 18 + 15] = SIMINT_MUL(Q_PA[0], PRIM_INT__d_s_s_s[n * 6 + 5]);
523 PRIM_INT__d_s_p_s[n * 18 + 15] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__d_s_s_s[(n+1) * 6 + 5], PRIM_INT__d_s_p_s[n * 18 + 15]);
524
525 PRIM_INT__d_s_p_s[n * 18 + 16] = SIMINT_MUL(Q_PA[1], PRIM_INT__d_s_s_s[n * 6 + 5]);
526 PRIM_INT__d_s_p_s[n * 18 + 16] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__d_s_s_s[(n+1) * 6 + 5], PRIM_INT__d_s_p_s[n * 18 + 16]);
527
528 PRIM_INT__d_s_p_s[n * 18 + 17] = SIMINT_MUL(Q_PA[2], PRIM_INT__d_s_s_s[n * 6 + 5]);
529 PRIM_INT__d_s_p_s[n * 18 + 17] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 5], PRIM_INT__d_s_p_s[n * 18 + 17]);
530 PRIM_INT__d_s_p_s[n * 18 + 17] = SIMINT_FMADD( vrr_const_2_over_2pq, PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__d_s_p_s[n * 18 + 17]);
531
532 }
533
534
535 VRR_K_f_s_d_s(
536 PRIM_INT__f_s_d_s,
537 PRIM_INT__f_s_p_s,
538 PRIM_INT__f_s_s_s,
539 PRIM_INT__d_s_p_s,
540 Q_PA,
541 a_over_q,
542 aoq_PQ,
543 one_over_2pq,
544 one_over_2q,
545 6);
546
547
548 ostei_general_vrr_K(4, 0, 3, 0, 5,
549 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
550 PRIM_INT__g_s_d_s, PRIM_INT__g_s_p_s, NULL, PRIM_INT__f_s_d_s, NULL, PRIM_INT__g_s_f_s);
551
552
553 ostei_general_vrr_K(5, 0, 4, 0, 4,
554 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
555 PRIM_INT__h_s_f_s, PRIM_INT__h_s_d_s, NULL, PRIM_INT__g_s_f_s, NULL, PRIM_INT__h_s_g_s);
556
557
558
559 // Forming PRIM_INT__p_s_p_s[7 * 9];
560 for(n = 0; n < 7; ++n) // loop over orders of auxiliary function
561 {
562
563 PRIM_INT__p_s_p_s[n * 9 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__p_s_s_s[n * 3 + 0]);
564 PRIM_INT__p_s_p_s[n * 9 + 0] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__p_s_p_s[n * 9 + 0]);
565 PRIM_INT__p_s_p_s[n * 9 + 0] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__p_s_p_s[n * 9 + 0]);
566
567 PRIM_INT__p_s_p_s[n * 9 + 1] = SIMINT_MUL(Q_PA[1], PRIM_INT__p_s_s_s[n * 3 + 0]);
568 PRIM_INT__p_s_p_s[n * 9 + 1] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__p_s_p_s[n * 9 + 1]);
569
570 PRIM_INT__p_s_p_s[n * 9 + 2] = SIMINT_MUL(Q_PA[2], PRIM_INT__p_s_s_s[n * 3 + 0]);
571 PRIM_INT__p_s_p_s[n * 9 + 2] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__p_s_p_s[n * 9 + 2]);
572
573 PRIM_INT__p_s_p_s[n * 9 + 3] = SIMINT_MUL(Q_PA[0], PRIM_INT__p_s_s_s[n * 3 + 1]);
574 PRIM_INT__p_s_p_s[n * 9 + 3] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__p_s_p_s[n * 9 + 3]);
575
576 PRIM_INT__p_s_p_s[n * 9 + 4] = SIMINT_MUL(Q_PA[1], PRIM_INT__p_s_s_s[n * 3 + 1]);
577 PRIM_INT__p_s_p_s[n * 9 + 4] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__p_s_p_s[n * 9 + 4]);
578 PRIM_INT__p_s_p_s[n * 9 + 4] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__p_s_p_s[n * 9 + 4]);
579
580 PRIM_INT__p_s_p_s[n * 9 + 5] = SIMINT_MUL(Q_PA[2], PRIM_INT__p_s_s_s[n * 3 + 1]);
581 PRIM_INT__p_s_p_s[n * 9 + 5] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__p_s_p_s[n * 9 + 5]);
582
583 PRIM_INT__p_s_p_s[n * 9 + 6] = SIMINT_MUL(Q_PA[0], PRIM_INT__p_s_s_s[n * 3 + 2]);
584 PRIM_INT__p_s_p_s[n * 9 + 6] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__p_s_p_s[n * 9 + 6]);
585
586 PRIM_INT__p_s_p_s[n * 9 + 7] = SIMINT_MUL(Q_PA[1], PRIM_INT__p_s_s_s[n * 3 + 2]);
587 PRIM_INT__p_s_p_s[n * 9 + 7] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__p_s_p_s[n * 9 + 7]);
588
589 PRIM_INT__p_s_p_s[n * 9 + 8] = SIMINT_MUL(Q_PA[2], PRIM_INT__p_s_s_s[n * 3 + 2]);
590 PRIM_INT__p_s_p_s[n * 9 + 8] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__p_s_p_s[n * 9 + 8]);
591 PRIM_INT__p_s_p_s[n * 9 + 8] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__p_s_p_s[n * 9 + 8]);
592
593 }
594
595
596 VRR_K_d_s_d_s(
597 PRIM_INT__d_s_d_s,
598 PRIM_INT__d_s_p_s,
599 PRIM_INT__d_s_s_s,
600 PRIM_INT__p_s_p_s,
601 Q_PA,
602 a_over_q,
603 aoq_PQ,
604 one_over_2pq,
605 one_over_2q,
606 6);
607
608
609 ostei_general_vrr_K(3, 0, 3, 0, 5,
610 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
611 PRIM_INT__f_s_d_s, PRIM_INT__f_s_p_s, NULL, PRIM_INT__d_s_d_s, NULL, PRIM_INT__f_s_f_s);
612
613
614 ostei_general_vrr_K(4, 0, 4, 0, 4,
615 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
616 PRIM_INT__g_s_f_s, PRIM_INT__g_s_d_s, NULL, PRIM_INT__f_s_f_s, NULL, PRIM_INT__g_s_g_s);
617
618
619 ostei_general_vrr_K(5, 0, 5, 0, 3,
620 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
621 PRIM_INT__h_s_g_s, PRIM_INT__h_s_f_s, NULL, PRIM_INT__g_s_g_s, NULL, PRIM_INT__h_s_h_s);
622
623
624
625 // Forming PRIM_INT__s_s_p_s[7 * 3];
626 for(n = 0; n < 7; ++n) // loop over orders of auxiliary function
627 {
628
629 PRIM_INT__s_s_p_s[n * 3 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__s_s_s_s[n * 1 + 0]);
630 PRIM_INT__s_s_p_s[n * 3 + 0] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__s_s_p_s[n * 3 + 0]);
631
632 PRIM_INT__s_s_p_s[n * 3 + 1] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_s_s[n * 1 + 0]);
633 PRIM_INT__s_s_p_s[n * 3 + 1] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__s_s_p_s[n * 3 + 1]);
634
635 PRIM_INT__s_s_p_s[n * 3 + 2] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_s_s[n * 1 + 0]);
636 PRIM_INT__s_s_p_s[n * 3 + 2] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__s_s_p_s[n * 3 + 2]);
637
638 }
639
640
641
642 // Forming PRIM_INT__p_s_d_s[6 * 18];
643 for(n = 0; n < 6; ++n) // loop over orders of auxiliary function
644 {
645
646 PRIM_INT__p_s_d_s[n * 18 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__p_s_p_s[n * 9 + 0]);
647 PRIM_INT__p_s_d_s[n * 18 + 0] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__p_s_p_s[(n+1) * 9 + 0], PRIM_INT__p_s_d_s[n * 18 + 0]);
648 PRIM_INT__p_s_d_s[n * 18 + 0] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__p_s_s_s[n * 3 + 0]), PRIM_INT__p_s_d_s[n * 18 + 0]);
649 PRIM_INT__p_s_d_s[n * 18 + 0] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__s_s_p_s[(n+1) * 3 + 0], PRIM_INT__p_s_d_s[n * 18 + 0]);
650
651 PRIM_INT__p_s_d_s[n * 18 + 3] = SIMINT_MUL(Q_PA[1], PRIM_INT__p_s_p_s[n * 9 + 1]);
652 PRIM_INT__p_s_d_s[n * 18 + 3] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__p_s_p_s[(n+1) * 9 + 1], PRIM_INT__p_s_d_s[n * 18 + 3]);
653 PRIM_INT__p_s_d_s[n * 18 + 3] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__p_s_s_s[n * 3 + 0]), PRIM_INT__p_s_d_s[n * 18 + 3]);
654
655 PRIM_INT__p_s_d_s[n * 18 + 5] = SIMINT_MUL(Q_PA[2], PRIM_INT__p_s_p_s[n * 9 + 2]);
656 PRIM_INT__p_s_d_s[n * 18 + 5] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__p_s_p_s[(n+1) * 9 + 2], PRIM_INT__p_s_d_s[n * 18 + 5]);
657 PRIM_INT__p_s_d_s[n * 18 + 5] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__p_s_s_s[n * 3 + 0]), PRIM_INT__p_s_d_s[n * 18 + 5]);
658
659 PRIM_INT__p_s_d_s[n * 18 + 6] = SIMINT_MUL(Q_PA[0], PRIM_INT__p_s_p_s[n * 9 + 3]);
660 PRIM_INT__p_s_d_s[n * 18 + 6] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__p_s_p_s[(n+1) * 9 + 3], PRIM_INT__p_s_d_s[n * 18 + 6]);
661 PRIM_INT__p_s_d_s[n * 18 + 6] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__p_s_s_s[n * 3 + 1]), PRIM_INT__p_s_d_s[n * 18 + 6]);
662
663 PRIM_INT__p_s_d_s[n * 18 + 9] = SIMINT_MUL(Q_PA[1], PRIM_INT__p_s_p_s[n * 9 + 4]);
664 PRIM_INT__p_s_d_s[n * 18 + 9] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__p_s_p_s[(n+1) * 9 + 4], PRIM_INT__p_s_d_s[n * 18 + 9]);
665 PRIM_INT__p_s_d_s[n * 18 + 9] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__p_s_s_s[n * 3 + 1]), PRIM_INT__p_s_d_s[n * 18 + 9]);
666 PRIM_INT__p_s_d_s[n * 18 + 9] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__s_s_p_s[(n+1) * 3 + 1], PRIM_INT__p_s_d_s[n * 18 + 9]);
667
668 PRIM_INT__p_s_d_s[n * 18 + 11] = SIMINT_MUL(Q_PA[2], PRIM_INT__p_s_p_s[n * 9 + 5]);
669 PRIM_INT__p_s_d_s[n * 18 + 11] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__p_s_p_s[(n+1) * 9 + 5], PRIM_INT__p_s_d_s[n * 18 + 11]);
670 PRIM_INT__p_s_d_s[n * 18 + 11] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__p_s_s_s[n * 3 + 1]), PRIM_INT__p_s_d_s[n * 18 + 11]);
671
672 PRIM_INT__p_s_d_s[n * 18 + 12] = SIMINT_MUL(Q_PA[0], PRIM_INT__p_s_p_s[n * 9 + 6]);
673 PRIM_INT__p_s_d_s[n * 18 + 12] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__p_s_p_s[(n+1) * 9 + 6], PRIM_INT__p_s_d_s[n * 18 + 12]);
674 PRIM_INT__p_s_d_s[n * 18 + 12] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__p_s_s_s[n * 3 + 2]), PRIM_INT__p_s_d_s[n * 18 + 12]);
675
676 PRIM_INT__p_s_d_s[n * 18 + 15] = SIMINT_MUL(Q_PA[1], PRIM_INT__p_s_p_s[n * 9 + 7]);
677 PRIM_INT__p_s_d_s[n * 18 + 15] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__p_s_p_s[(n+1) * 9 + 7], PRIM_INT__p_s_d_s[n * 18 + 15]);
678 PRIM_INT__p_s_d_s[n * 18 + 15] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__p_s_s_s[n * 3 + 2]), PRIM_INT__p_s_d_s[n * 18 + 15]);
679
680 PRIM_INT__p_s_d_s[n * 18 + 17] = SIMINT_MUL(Q_PA[2], PRIM_INT__p_s_p_s[n * 9 + 8]);
681 PRIM_INT__p_s_d_s[n * 18 + 17] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__p_s_p_s[(n+1) * 9 + 8], PRIM_INT__p_s_d_s[n * 18 + 17]);
682 PRIM_INT__p_s_d_s[n * 18 + 17] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__p_s_s_s[n * 3 + 2]), PRIM_INT__p_s_d_s[n * 18 + 17]);
683 PRIM_INT__p_s_d_s[n * 18 + 17] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__s_s_p_s[(n+1) * 3 + 2], PRIM_INT__p_s_d_s[n * 18 + 17]);
684
685 }
686
687
688 VRR_K_d_s_f_s(
689 PRIM_INT__d_s_f_s,
690 PRIM_INT__d_s_d_s,
691 PRIM_INT__d_s_p_s,
692 PRIM_INT__p_s_d_s,
693 Q_PA,
694 a_over_q,
695 aoq_PQ,
696 one_over_2pq,
697 one_over_2q,
698 5);
699
700
701 ostei_general_vrr_K(3, 0, 4, 0, 4,
702 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
703 PRIM_INT__f_s_f_s, PRIM_INT__f_s_d_s, NULL, PRIM_INT__d_s_f_s, NULL, PRIM_INT__f_s_g_s);
704
705
706 ostei_general_vrr_K(4, 0, 5, 0, 3,
707 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
708 PRIM_INT__g_s_g_s, PRIM_INT__g_s_f_s, NULL, PRIM_INT__f_s_g_s, NULL, PRIM_INT__g_s_h_s);
709
710
711 ostei_general_vrr_K(5, 0, 6, 0, 2,
712 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
713 PRIM_INT__h_s_h_s, PRIM_INT__h_s_g_s, NULL, PRIM_INT__g_s_h_s, NULL, PRIM_INT__h_s_i_s);
714
715
716 ostei_general_vrr1_I(6, 9,
717 one_over_2p, a_over_p, aop_PQ, P_PA,
718 PRIM_INT__h_s_s_s, PRIM_INT__g_s_s_s, PRIM_INT__i_s_s_s);
719
720
721 ostei_general_vrr_K(6, 0, 1, 0, 7,
722 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
723 PRIM_INT__i_s_s_s, NULL, NULL, PRIM_INT__h_s_s_s, NULL, PRIM_INT__i_s_p_s);
724
725
726 ostei_general_vrr_K(6, 0, 2, 0, 6,
727 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
728 PRIM_INT__i_s_p_s, PRIM_INT__i_s_s_s, NULL, PRIM_INT__h_s_p_s, NULL, PRIM_INT__i_s_d_s);
729
730
731 ostei_general_vrr_K(6, 0, 3, 0, 5,
732 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
733 PRIM_INT__i_s_d_s, PRIM_INT__i_s_p_s, NULL, PRIM_INT__h_s_d_s, NULL, PRIM_INT__i_s_f_s);
734
735
736 ostei_general_vrr_K(6, 0, 4, 0, 4,
737 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
738 PRIM_INT__i_s_f_s, PRIM_INT__i_s_d_s, NULL, PRIM_INT__h_s_f_s, NULL, PRIM_INT__i_s_g_s);
739
740
741 ostei_general_vrr_K(6, 0, 5, 0, 3,
742 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
743 PRIM_INT__i_s_g_s, PRIM_INT__i_s_f_s, NULL, PRIM_INT__h_s_g_s, NULL, PRIM_INT__i_s_h_s);
744
745
746
747 // Forming PRIM_INT__s_s_d_s[6 * 6];
748 for(n = 0; n < 6; ++n) // loop over orders of auxiliary function
749 {
750
751 PRIM_INT__s_s_d_s[n * 6 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__s_s_p_s[n * 3 + 0]);
752 PRIM_INT__s_s_d_s[n * 6 + 0] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__s_s_p_s[(n+1) * 3 + 0], PRIM_INT__s_s_d_s[n * 6 + 0]);
753 PRIM_INT__s_s_d_s[n * 6 + 0] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__s_s_s_s[n * 1 + 0]), PRIM_INT__s_s_d_s[n * 6 + 0]);
754
755 PRIM_INT__s_s_d_s[n * 6 + 3] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_p_s[n * 3 + 1]);
756 PRIM_INT__s_s_d_s[n * 6 + 3] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__s_s_p_s[(n+1) * 3 + 1], PRIM_INT__s_s_d_s[n * 6 + 3]);
757 PRIM_INT__s_s_d_s[n * 6 + 3] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__s_s_s_s[n * 1 + 0]), PRIM_INT__s_s_d_s[n * 6 + 3]);
758
759 PRIM_INT__s_s_d_s[n * 6 + 5] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_p_s[n * 3 + 2]);
760 PRIM_INT__s_s_d_s[n * 6 + 5] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__s_s_p_s[(n+1) * 3 + 2], PRIM_INT__s_s_d_s[n * 6 + 5]);
761 PRIM_INT__s_s_d_s[n * 6 + 5] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__s_s_s_s[n * 1 + 0]), PRIM_INT__s_s_d_s[n * 6 + 5]);
762
763 }
764
765
766 VRR_K_p_s_f_s(
767 PRIM_INT__p_s_f_s,
768 PRIM_INT__p_s_d_s,
769 PRIM_INT__p_s_p_s,
770 PRIM_INT__s_s_d_s,
771 Q_PA,
772 a_over_q,
773 aoq_PQ,
774 one_over_2pq,
775 one_over_2q,
776 5);
777
778
779 ostei_general_vrr_K(2, 0, 4, 0, 4,
780 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
781 PRIM_INT__d_s_f_s, PRIM_INT__d_s_d_s, NULL, PRIM_INT__p_s_f_s, NULL, PRIM_INT__d_s_g_s);
782
783
784 ostei_general_vrr_K(3, 0, 5, 0, 3,
785 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
786 PRIM_INT__f_s_g_s, PRIM_INT__f_s_f_s, NULL, PRIM_INT__d_s_g_s, NULL, PRIM_INT__f_s_h_s);
787
788
789 ostei_general_vrr_K(4, 0, 6, 0, 2,
790 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
791 PRIM_INT__g_s_h_s, PRIM_INT__g_s_g_s, NULL, PRIM_INT__f_s_h_s, NULL, PRIM_INT__g_s_i_s);
792
793
794 ostei_general_vrr_K(5, 0, 7, 0, 1,
795 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
796 PRIM_INT__h_s_i_s, PRIM_INT__h_s_h_s, NULL, PRIM_INT__g_s_i_s, NULL, PRIM_INT__h_s_k_s);
797
798
799 ostei_general_vrr_K(6, 0, 6, 0, 2,
800 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
801 PRIM_INT__i_s_h_s, PRIM_INT__i_s_g_s, NULL, PRIM_INT__h_s_h_s, NULL, PRIM_INT__i_s_i_s);
802
803
804 ostei_general_vrr1_I(7, 8,
805 one_over_2p, a_over_p, aop_PQ, P_PA,
806 PRIM_INT__i_s_s_s, PRIM_INT__h_s_s_s, PRIM_INT__k_s_s_s);
807
808
809 ostei_general_vrr_K(7, 0, 1, 0, 7,
810 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
811 PRIM_INT__k_s_s_s, NULL, NULL, PRIM_INT__i_s_s_s, NULL, PRIM_INT__k_s_p_s);
812
813
814 ostei_general_vrr_K(7, 0, 2, 0, 6,
815 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
816 PRIM_INT__k_s_p_s, PRIM_INT__k_s_s_s, NULL, PRIM_INT__i_s_p_s, NULL, PRIM_INT__k_s_d_s);
817
818
819 ostei_general_vrr_K(7, 0, 3, 0, 5,
820 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
821 PRIM_INT__k_s_d_s, PRIM_INT__k_s_p_s, NULL, PRIM_INT__i_s_d_s, NULL, PRIM_INT__k_s_f_s);
822
823
824 ostei_general_vrr_K(7, 0, 4, 0, 4,
825 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
826 PRIM_INT__k_s_f_s, PRIM_INT__k_s_d_s, NULL, PRIM_INT__i_s_f_s, NULL, PRIM_INT__k_s_g_s);
827
828
829 ostei_general_vrr_K(7, 0, 5, 0, 3,
830 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
831 PRIM_INT__k_s_g_s, PRIM_INT__k_s_f_s, NULL, PRIM_INT__i_s_g_s, NULL, PRIM_INT__k_s_h_s);
832
833
834 ostei_general_vrr_K(6, 0, 7, 0, 1,
835 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
836 PRIM_INT__i_s_i_s, PRIM_INT__i_s_h_s, NULL, PRIM_INT__h_s_i_s, NULL, PRIM_INT__i_s_k_s);
837
838
839 ostei_general_vrr_K(7, 0, 6, 0, 2,
840 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
841 PRIM_INT__k_s_h_s, PRIM_INT__k_s_g_s, NULL, PRIM_INT__i_s_h_s, NULL, PRIM_INT__k_s_i_s);
842
843
844 ostei_general_vrr_K(7, 0, 7, 0, 1,
845 one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
846 PRIM_INT__k_s_i_s, PRIM_INT__k_s_h_s, NULL, PRIM_INT__i_s_i_s, NULL, PRIM_INT__k_s_k_s);
847
848
849
850
851 ////////////////////////////////////
852 // Accumulate contracted integrals
853 ////////////////////////////////////
854 if(lastoffset == 0)
855 {
856 contract_all(441, PRIM_INT__h_s_h_s, PRIM_PTR_INT__h_s_h_s);
857 contract_all(588, PRIM_INT__h_s_i_s, PRIM_PTR_INT__h_s_i_s);
858 contract_all(756, PRIM_INT__h_s_k_s, PRIM_PTR_INT__h_s_k_s);
859 contract_all(588, PRIM_INT__i_s_h_s, PRIM_PTR_INT__i_s_h_s);
860 contract_all(784, PRIM_INT__i_s_i_s, PRIM_PTR_INT__i_s_i_s);
861 contract_all(1008, PRIM_INT__i_s_k_s, PRIM_PTR_INT__i_s_k_s);
862 contract_all(756, PRIM_INT__k_s_h_s, PRIM_PTR_INT__k_s_h_s);
863 contract_all(1008, PRIM_INT__k_s_i_s, PRIM_PTR_INT__k_s_i_s);
864 contract_all(1296, PRIM_INT__k_s_k_s, PRIM_PTR_INT__k_s_k_s);
865 }
866 else
867 {
868 contract(441, shelloffsets, PRIM_INT__h_s_h_s, PRIM_PTR_INT__h_s_h_s);
869 contract(588, shelloffsets, PRIM_INT__h_s_i_s, PRIM_PTR_INT__h_s_i_s);
870 contract(756, shelloffsets, PRIM_INT__h_s_k_s, PRIM_PTR_INT__h_s_k_s);
871 contract(588, shelloffsets, PRIM_INT__i_s_h_s, PRIM_PTR_INT__i_s_h_s);
872 contract(784, shelloffsets, PRIM_INT__i_s_i_s, PRIM_PTR_INT__i_s_i_s);
873 contract(1008, shelloffsets, PRIM_INT__i_s_k_s, PRIM_PTR_INT__i_s_k_s);
874 contract(756, shelloffsets, PRIM_INT__k_s_h_s, PRIM_PTR_INT__k_s_h_s);
875 contract(1008, shelloffsets, PRIM_INT__k_s_i_s, PRIM_PTR_INT__k_s_i_s);
876 contract(1296, shelloffsets, PRIM_INT__k_s_k_s, PRIM_PTR_INT__k_s_k_s);
877 PRIM_PTR_INT__h_s_h_s += lastoffset*441;
878 PRIM_PTR_INT__h_s_i_s += lastoffset*588;
879 PRIM_PTR_INT__h_s_k_s += lastoffset*756;
880 PRIM_PTR_INT__i_s_h_s += lastoffset*588;
881 PRIM_PTR_INT__i_s_i_s += lastoffset*784;
882 PRIM_PTR_INT__i_s_k_s += lastoffset*1008;
883 PRIM_PTR_INT__k_s_h_s += lastoffset*756;
884 PRIM_PTR_INT__k_s_i_s += lastoffset*1008;
885 PRIM_PTR_INT__k_s_k_s += lastoffset*1296;
886 }
887
888 } // close loop over j
889 } // close loop over i
890
891 //Advance to the next batch
892 jstart = SIMINT_SIMD_ROUND(jend);
893
894 //////////////////////////////////////////////
895 // Contracted integrals: Horizontal recurrance
896 //////////////////////////////////////////////
897
898
899 const double hAB[3] = { P.AB_x[ab], P.AB_y[ab], P.AB_z[ab] };
900
901
902 for(abcd = 0; abcd < nshellbatch; ++abcd, ++real_abcd)
903 {
904 const double hCD[3] = { Q.AB_x[cd+abcd], Q.AB_y[cd+abcd], Q.AB_z[cd+abcd] };
905
906 // set up HRR pointers
907 double const * restrict HRR_INT__h_s_h_s = INT__h_s_h_s + abcd * 441;
908 double const * restrict HRR_INT__h_s_i_s = INT__h_s_i_s + abcd * 588;
909 double const * restrict HRR_INT__h_s_k_s = INT__h_s_k_s + abcd * 756;
910 double const * restrict HRR_INT__i_s_h_s = INT__i_s_h_s + abcd * 588;
911 double const * restrict HRR_INT__i_s_i_s = INT__i_s_i_s + abcd * 784;
912 double const * restrict HRR_INT__i_s_k_s = INT__i_s_k_s + abcd * 1008;
913 double const * restrict HRR_INT__k_s_h_s = INT__k_s_h_s + abcd * 756;
914 double const * restrict HRR_INT__k_s_i_s = INT__k_s_i_s + abcd * 1008;
915 double const * restrict HRR_INT__k_s_k_s = INT__k_s_k_s + abcd * 1296;
916 double * restrict HRR_INT__h_d_h_d = INT__h_d_h_d + real_abcd * 15876;
917
918 // form INT__h_p_h_s
919 ostei_general_hrr_J(5, 1, 5, 0, hAB, HRR_INT__i_s_h_s, HRR_INT__h_s_h_s, HRR_INT__h_p_h_s);
920
921 // form INT__h_p_i_s
922 ostei_general_hrr_J(5, 1, 6, 0, hAB, HRR_INT__i_s_i_s, HRR_INT__h_s_i_s, HRR_INT__h_p_i_s);
923
924 // form INT__h_p_k_s
925 ostei_general_hrr_J(5, 1, 7, 0, hAB, HRR_INT__i_s_k_s, HRR_INT__h_s_k_s, HRR_INT__h_p_k_s);
926
927 // form INT__i_p_h_s
928 ostei_general_hrr_J(6, 1, 5, 0, hAB, HRR_INT__k_s_h_s, HRR_INT__i_s_h_s, HRR_INT__i_p_h_s);
929
930 // form INT__i_p_i_s
931 ostei_general_hrr_J(6, 1, 6, 0, hAB, HRR_INT__k_s_i_s, HRR_INT__i_s_i_s, HRR_INT__i_p_i_s);
932
933 // form INT__i_p_k_s
934 ostei_general_hrr_J(6, 1, 7, 0, hAB, HRR_INT__k_s_k_s, HRR_INT__i_s_k_s, HRR_INT__i_p_k_s);
935
936 // form INT__h_d_h_s
937 ostei_general_hrr_J(5, 2, 5, 0, hAB, HRR_INT__i_p_h_s, HRR_INT__h_p_h_s, HRR_INT__h_d_h_s);
938
939 // form INT__h_d_i_s
940 ostei_general_hrr_J(5, 2, 6, 0, hAB, HRR_INT__i_p_i_s, HRR_INT__h_p_i_s, HRR_INT__h_d_i_s);
941
942 // form INT__h_d_k_s
943 ostei_general_hrr_J(5, 2, 7, 0, hAB, HRR_INT__i_p_k_s, HRR_INT__h_p_k_s, HRR_INT__h_d_k_s);
944
945 // form INT__h_d_h_p
946 ostei_general_hrr_L(5, 2, 5, 1, hCD, HRR_INT__h_d_i_s, HRR_INT__h_d_h_s, HRR_INT__h_d_h_p);
947
948 // form INT__h_d_i_p
949 ostei_general_hrr_L(5, 2, 6, 1, hCD, HRR_INT__h_d_k_s, HRR_INT__h_d_i_s, HRR_INT__h_d_i_p);
950
951 // form INT__h_d_h_d
952 ostei_general_hrr_L(5, 2, 5, 2, hCD, HRR_INT__h_d_i_p, HRR_INT__h_d_h_p, HRR_INT__h_d_h_d);
953
954
955 } // close HRR loop
956
957
958 } // close loop cdbatch
959
960 istart = iend;
961 } // close loop over ab
962
963 return P.nshell12_clip * Q.nshell12_clip;
964 }
965
ostei_d_h_h_d(struct simint_multi_shellpair const P,struct simint_multi_shellpair const Q,double screen_tol,double * const restrict work,double * const restrict INT__d_h_h_d)966 int ostei_d_h_h_d(struct simint_multi_shellpair const P,
967 struct simint_multi_shellpair const Q,
968 double screen_tol,
969 double * const restrict work,
970 double * const restrict INT__d_h_h_d)
971 {
972 double P_AB[3*P.nshell12];
973 struct simint_multi_shellpair P_tmp = P;
974 P_tmp.PA_x = P.PB_x; P_tmp.PA_y = P.PB_y; P_tmp.PA_z = P.PB_z;
975 P_tmp.PB_x = P.PA_x; P_tmp.PB_y = P.PA_y; P_tmp.PB_z = P.PA_z;
976 P_tmp.AB_x = P_AB;
977 P_tmp.AB_y = P_AB + P.nshell12;
978 P_tmp.AB_z = P_AB + 2*P.nshell12;
979
980 for(int i = 0; i < P.nshell12; i++)
981 {
982 P_tmp.AB_x[i] = -P.AB_x[i];
983 P_tmp.AB_y[i] = -P.AB_y[i];
984 P_tmp.AB_z[i] = -P.AB_z[i];
985 }
986
987 int ret = ostei_h_d_h_d(P_tmp, Q, screen_tol, work, INT__d_h_h_d);
988 double buffer[15876] SIMINT_ALIGN_ARRAY_DBL;
989
990 for(int q = 0; q < ret; q++)
991 {
992 int idx = 0;
993 for(int a = 0; a < 6; ++a)
994 for(int b = 0; b < 21; ++b)
995 for(int c = 0; c < 21; ++c)
996 for(int d = 0; d < 6; ++d)
997 buffer[idx++] = INT__d_h_h_d[q*15876+b*756+a*126+c*6+d];
998
999 memcpy(INT__d_h_h_d+q*15876, buffer, 15876*sizeof(double));
1000 }
1001
1002 return ret;
1003 }
1004
ostei_h_d_d_h(struct simint_multi_shellpair const P,struct simint_multi_shellpair const Q,double screen_tol,double * const restrict work,double * const restrict INT__h_d_d_h)1005 int ostei_h_d_d_h(struct simint_multi_shellpair const P,
1006 struct simint_multi_shellpair const Q,
1007 double screen_tol,
1008 double * const restrict work,
1009 double * const restrict INT__h_d_d_h)
1010 {
1011 double Q_AB[3*Q.nshell12];
1012 struct simint_multi_shellpair Q_tmp = Q;
1013 Q_tmp.PA_x = Q.PB_x; Q_tmp.PA_y = Q.PB_y; Q_tmp.PA_z = Q.PB_z;
1014 Q_tmp.PB_x = Q.PA_x; Q_tmp.PB_y = Q.PA_y; Q_tmp.PB_z = Q.PA_z;
1015 Q_tmp.AB_x = Q_AB;
1016 Q_tmp.AB_y = Q_AB + Q.nshell12;
1017 Q_tmp.AB_z = Q_AB + 2*Q.nshell12;
1018
1019 for(int i = 0; i < Q.nshell12; i++)
1020 {
1021 Q_tmp.AB_x[i] = -Q.AB_x[i];
1022 Q_tmp.AB_y[i] = -Q.AB_y[i];
1023 Q_tmp.AB_z[i] = -Q.AB_z[i];
1024 }
1025
1026 int ret = ostei_h_d_h_d(P, Q_tmp, screen_tol, work, INT__h_d_d_h);
1027 double buffer[15876] SIMINT_ALIGN_ARRAY_DBL;
1028
1029 for(int q = 0; q < ret; q++)
1030 {
1031 int idx = 0;
1032 for(int a = 0; a < 21; ++a)
1033 for(int b = 0; b < 6; ++b)
1034 for(int c = 0; c < 6; ++c)
1035 for(int d = 0; d < 21; ++d)
1036 buffer[idx++] = INT__h_d_d_h[q*15876+a*756+b*126+d*6+c];
1037
1038 memcpy(INT__h_d_d_h+q*15876, buffer, 15876*sizeof(double));
1039 }
1040
1041 return ret;
1042 }
1043
ostei_d_h_d_h(struct simint_multi_shellpair const P,struct simint_multi_shellpair const Q,double screen_tol,double * const restrict work,double * const restrict INT__d_h_d_h)1044 int ostei_d_h_d_h(struct simint_multi_shellpair const P,
1045 struct simint_multi_shellpair const Q,
1046 double screen_tol,
1047 double * const restrict work,
1048 double * const restrict INT__d_h_d_h)
1049 {
1050 double P_AB[3*P.nshell12];
1051 struct simint_multi_shellpair P_tmp = P;
1052 P_tmp.PA_x = P.PB_x; P_tmp.PA_y = P.PB_y; P_tmp.PA_z = P.PB_z;
1053 P_tmp.PB_x = P.PA_x; P_tmp.PB_y = P.PA_y; P_tmp.PB_z = P.PA_z;
1054 P_tmp.AB_x = P_AB;
1055 P_tmp.AB_y = P_AB + P.nshell12;
1056 P_tmp.AB_z = P_AB + 2*P.nshell12;
1057
1058 for(int i = 0; i < P.nshell12; i++)
1059 {
1060 P_tmp.AB_x[i] = -P.AB_x[i];
1061 P_tmp.AB_y[i] = -P.AB_y[i];
1062 P_tmp.AB_z[i] = -P.AB_z[i];
1063 }
1064
1065 double Q_AB[3*Q.nshell12];
1066 struct simint_multi_shellpair Q_tmp = Q;
1067 Q_tmp.PA_x = Q.PB_x; Q_tmp.PA_y = Q.PB_y; Q_tmp.PA_z = Q.PB_z;
1068 Q_tmp.PB_x = Q.PA_x; Q_tmp.PB_y = Q.PA_y; Q_tmp.PB_z = Q.PA_z;
1069 Q_tmp.AB_x = Q_AB;
1070 Q_tmp.AB_y = Q_AB + Q.nshell12;
1071 Q_tmp.AB_z = Q_AB + 2*Q.nshell12;
1072
1073 for(int i = 0; i < Q.nshell12; i++)
1074 {
1075 Q_tmp.AB_x[i] = -Q.AB_x[i];
1076 Q_tmp.AB_y[i] = -Q.AB_y[i];
1077 Q_tmp.AB_z[i] = -Q.AB_z[i];
1078 }
1079
1080 int ret = ostei_h_d_h_d(P_tmp, Q_tmp, screen_tol, work, INT__d_h_d_h);
1081 double buffer[15876] SIMINT_ALIGN_ARRAY_DBL;
1082
1083 for(int q = 0; q < ret; q++)
1084 {
1085 int idx = 0;
1086 for(int a = 0; a < 6; ++a)
1087 for(int b = 0; b < 21; ++b)
1088 for(int c = 0; c < 6; ++c)
1089 for(int d = 0; d < 21; ++d)
1090 buffer[idx++] = INT__d_h_d_h[q*15876+b*756+a*126+d*6+c];
1091
1092 memcpy(INT__d_h_d_h+q*15876, buffer, 15876*sizeof(double));
1093 }
1094
1095 return ret;
1096 }
1097
1098