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_f_f_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__f_f_h_d)8 int ostei_f_f_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__f_f_h_d)
13 {
14 
15     SIMINT_ASSUME_ALIGN_DBL(work);
16     SIMINT_ASSUME_ALIGN_DBL(INT__f_f_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__f_s_h_s = work + (SIMINT_NSHELL_SIMD * 0);
30     double * const INT__f_s_i_s = work + (SIMINT_NSHELL_SIMD * 210);
31     double * const INT__f_s_k_s = work + (SIMINT_NSHELL_SIMD * 490);
32     double * const INT__g_s_h_s = work + (SIMINT_NSHELL_SIMD * 850);
33     double * const INT__g_s_i_s = work + (SIMINT_NSHELL_SIMD * 1165);
34     double * const INT__g_s_k_s = work + (SIMINT_NSHELL_SIMD * 1585);
35     double * const INT__h_s_h_s = work + (SIMINT_NSHELL_SIMD * 2125);
36     double * const INT__h_s_i_s = work + (SIMINT_NSHELL_SIMD * 2566);
37     double * const INT__h_s_k_s = work + (SIMINT_NSHELL_SIMD * 3154);
38     double * const INT__i_s_h_s = work + (SIMINT_NSHELL_SIMD * 3910);
39     double * const INT__i_s_i_s = work + (SIMINT_NSHELL_SIMD * 4498);
40     double * const INT__i_s_k_s = work + (SIMINT_NSHELL_SIMD * 5282);
41     SIMINT_DBLTYPE * const primwork = (SIMINT_DBLTYPE *)(work + SIMINT_NSHELL_SIMD*6290);
42     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_s_s = primwork + 0;
43     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_p_s = primwork + 14;
44     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_d_s = primwork + 53;
45     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_f_s = primwork + 125;
46     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_g_s = primwork + 235;
47     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_h_s = primwork + 385;
48     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_i_s = primwork + 574;
49     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_k_s = primwork + 798;
50     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_s_s = primwork + 1050;
51     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_p_s = primwork + 1068;
52     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_d_s = primwork + 1122;
53     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_f_s = primwork + 1230;
54     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_g_s = primwork + 1410;
55     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_h_s = primwork + 1680;
56     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_i_s = primwork + 2058;
57     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_k_s = primwork + 2562;
58     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_p_s = primwork + 3210;
59     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_d_s = primwork + 3300;
60     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_f_s = primwork + 3480;
61     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_g_s = primwork + 3780;
62     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_h_s = primwork + 4230;
63     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_i_s = primwork + 4860;
64     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_k_s = primwork + 5700;
65     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_d_s = primwork + 6780;
66     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_f_s = primwork + 7020;
67     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_g_s = primwork + 7420;
68     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_h_s = primwork + 8020;
69     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_i_s = primwork + 8860;
70     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_k_s = primwork + 9980;
71     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_f_s = primwork + 11420;
72     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_g_s = primwork + 11870;
73     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_h_s = primwork + 12545;
74     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_i_s = primwork + 13490;
75     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_k_s = primwork + 14750;
76     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_g_s = primwork + 16370;
77     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_h_s = primwork + 17000;
78     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_i_s = primwork + 17882;
79     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_k_s = primwork + 19058;
80     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_h_s = primwork + 20570;
81     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_i_s = primwork + 21158;
82     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_k_s = primwork + 21942;
83     double * const hrrwork = (double *)(primwork + 22950);
84     double * const HRR_INT__f_p_h_s = hrrwork + 0;
85     double * const HRR_INT__f_p_i_s = hrrwork + 630;
86     double * const HRR_INT__f_p_k_s = hrrwork + 1470;
87     double * const HRR_INT__f_d_h_s = hrrwork + 2550;
88     double * const HRR_INT__f_d_i_s = hrrwork + 3810;
89     double * const HRR_INT__f_d_k_s = hrrwork + 5490;
90     double * const HRR_INT__f_f_h_s = hrrwork + 7650;
91     double * const HRR_INT__f_f_h_p = hrrwork + 9750;
92     double * const HRR_INT__f_f_i_s = hrrwork + 16050;
93     double * const HRR_INT__f_f_i_p = hrrwork + 18850;
94     double * const HRR_INT__f_f_k_s = hrrwork + 27250;
95     double * const HRR_INT__g_p_h_s = hrrwork + 30850;
96     double * const HRR_INT__g_p_i_s = hrrwork + 31795;
97     double * const HRR_INT__g_p_k_s = hrrwork + 33055;
98     double * const HRR_INT__g_d_h_s = hrrwork + 34675;
99     double * const HRR_INT__g_d_i_s = hrrwork + 36565;
100     double * const HRR_INT__g_d_k_s = hrrwork + 39085;
101     double * const HRR_INT__h_p_h_s = hrrwork + 42325;
102     double * const HRR_INT__h_p_i_s = hrrwork + 43648;
103     double * const HRR_INT__h_p_k_s = hrrwork + 45412;
104 
105 
106     // Create constants
107     const SIMINT_DBLTYPE const_1 = SIMINT_DBLSET1(1);
108     const SIMINT_DBLTYPE const_2 = SIMINT_DBLSET1(2);
109     const SIMINT_DBLTYPE const_3 = SIMINT_DBLSET1(3);
110     const SIMINT_DBLTYPE const_4 = SIMINT_DBLSET1(4);
111     const SIMINT_DBLTYPE const_5 = SIMINT_DBLSET1(5);
112     const SIMINT_DBLTYPE const_6 = SIMINT_DBLSET1(6);
113     const SIMINT_DBLTYPE const_7 = SIMINT_DBLSET1(7);
114     const SIMINT_DBLTYPE one_half = SIMINT_DBLSET1(0.5);
115 
116 
117     ////////////////////////////////////////
118     // Loop over shells and primitives
119     ////////////////////////////////////////
120 
121     real_abcd = 0;
122     istart = 0;
123     for(ab = 0; ab < P.nshell12_clip; ++ab)
124     {
125         const int iend = istart + P.nprim12[ab];
126 
127         cd = 0;
128         jstart = 0;
129 
130         for(cd = 0; cd < Q.nshell12_clip; cd += SIMINT_NSHELL_SIMD)
131         {
132             const int nshellbatch = ((cd + SIMINT_NSHELL_SIMD) > Q.nshell12_clip) ? Q.nshell12_clip - cd : SIMINT_NSHELL_SIMD;
133             int jend = jstart;
134             for(i = 0; i < nshellbatch; i++)
135                 jend += Q.nprim12[cd+i];
136 
137             // Clear the beginning of the workspace (where we are accumulating integrals)
138             memset(work, 0, SIMINT_NSHELL_SIMD * 6290 * sizeof(double));
139             abcd = 0;
140 
141 
142             for(i = istart; i < iend; ++i)
143             {
144                 SIMINT_DBLTYPE bra_screen_max;  // only used if check_screen
145 
146                 if(check_screen)
147                 {
148                     // Skip this whole thing if always insignificant
149                     if((P.screen[i] * Q.screen_max) < screen_tol)
150                         continue;
151                     bra_screen_max = SIMINT_DBLSET1(P.screen[i]);
152                 }
153 
154                 icd = 0;
155                 iprimcd = 0;
156                 nprim_icd = Q.nprim12[cd];
157                 double * restrict PRIM_PTR_INT__f_s_h_s = INT__f_s_h_s + abcd * 210;
158                 double * restrict PRIM_PTR_INT__f_s_i_s = INT__f_s_i_s + abcd * 280;
159                 double * restrict PRIM_PTR_INT__f_s_k_s = INT__f_s_k_s + abcd * 360;
160                 double * restrict PRIM_PTR_INT__g_s_h_s = INT__g_s_h_s + abcd * 315;
161                 double * restrict PRIM_PTR_INT__g_s_i_s = INT__g_s_i_s + abcd * 420;
162                 double * restrict PRIM_PTR_INT__g_s_k_s = INT__g_s_k_s + abcd * 540;
163                 double * restrict PRIM_PTR_INT__h_s_h_s = INT__h_s_h_s + abcd * 441;
164                 double * restrict PRIM_PTR_INT__h_s_i_s = INT__h_s_i_s + abcd * 588;
165                 double * restrict PRIM_PTR_INT__h_s_k_s = INT__h_s_k_s + abcd * 756;
166                 double * restrict PRIM_PTR_INT__i_s_h_s = INT__i_s_h_s + abcd * 588;
167                 double * restrict PRIM_PTR_INT__i_s_i_s = INT__i_s_i_s + abcd * 784;
168                 double * restrict PRIM_PTR_INT__i_s_k_s = INT__i_s_k_s + abcd * 1008;
169 
170 
171 
172                 // Load these one per loop over i
173                 const SIMINT_DBLTYPE P_alpha = SIMINT_DBLSET1(P.alpha[i]);
174                 const SIMINT_DBLTYPE P_prefac = SIMINT_DBLSET1(P.prefac[i]);
175                 const SIMINT_DBLTYPE Pxyz[3] = { SIMINT_DBLSET1(P.x[i]), SIMINT_DBLSET1(P.y[i]), SIMINT_DBLSET1(P.z[i]) };
176 
177                 const SIMINT_DBLTYPE P_PA[3] = { SIMINT_DBLSET1(P.PA_x[i]), SIMINT_DBLSET1(P.PA_y[i]), SIMINT_DBLSET1(P.PA_z[i]) };
178 
179                 for(j = jstart; j < jend; j += SIMINT_SIMD_LEN)
180                 {
181                     // calculate the shell offsets
182                     // these are the offset from the shell pointed to by cd
183                     // for each element
184                     int shelloffsets[SIMINT_SIMD_LEN] = {0};
185                     int lastoffset = 0;
186                     const int nlane = ( ((j + SIMINT_SIMD_LEN) < jend) ? SIMINT_SIMD_LEN : (jend - j));
187 
188                     if((iprimcd + SIMINT_SIMD_LEN) >= nprim_icd)
189                     {
190                         // Handle if the first element of the vector is a new shell
191                         if(iprimcd >= nprim_icd && ((icd+1) < nshellbatch))
192                         {
193                             nprim_icd += Q.nprim12[cd + (++icd)];
194                             PRIM_PTR_INT__f_s_h_s += 210;
195                             PRIM_PTR_INT__f_s_i_s += 280;
196                             PRIM_PTR_INT__f_s_k_s += 360;
197                             PRIM_PTR_INT__g_s_h_s += 315;
198                             PRIM_PTR_INT__g_s_i_s += 420;
199                             PRIM_PTR_INT__g_s_k_s += 540;
200                             PRIM_PTR_INT__h_s_h_s += 441;
201                             PRIM_PTR_INT__h_s_i_s += 588;
202                             PRIM_PTR_INT__h_s_k_s += 756;
203                             PRIM_PTR_INT__i_s_h_s += 588;
204                             PRIM_PTR_INT__i_s_i_s += 784;
205                             PRIM_PTR_INT__i_s_k_s += 1008;
206                         }
207                         iprimcd++;
208                         for(n = 1; n < SIMINT_SIMD_LEN; ++n)
209                         {
210                             if(iprimcd >= nprim_icd && ((icd+1) < nshellbatch))
211                             {
212                                 shelloffsets[n] = shelloffsets[n-1] + 1;
213                                 lastoffset++;
214                                 nprim_icd += Q.nprim12[cd + (++icd)];
215                             }
216                             else
217                                 shelloffsets[n] = shelloffsets[n-1];
218                             iprimcd++;
219                         }
220                     }
221                     else
222                         iprimcd += SIMINT_SIMD_LEN;
223 
224                     // Do we have to compute this vector (or has it been screened out)?
225                     // (not_screened != 0 means we have to do this vector)
226                     if(check_screen)
227                     {
228                         const double vmax = vector_max(SIMINT_MUL(bra_screen_max, SIMINT_DBLLOAD(Q.screen, j)));
229                         if(vmax < screen_tol)
230                         {
231                             PRIM_PTR_INT__f_s_h_s += lastoffset*210;
232                             PRIM_PTR_INT__f_s_i_s += lastoffset*280;
233                             PRIM_PTR_INT__f_s_k_s += lastoffset*360;
234                             PRIM_PTR_INT__g_s_h_s += lastoffset*315;
235                             PRIM_PTR_INT__g_s_i_s += lastoffset*420;
236                             PRIM_PTR_INT__g_s_k_s += lastoffset*540;
237                             PRIM_PTR_INT__h_s_h_s += lastoffset*441;
238                             PRIM_PTR_INT__h_s_i_s += lastoffset*588;
239                             PRIM_PTR_INT__h_s_k_s += lastoffset*756;
240                             PRIM_PTR_INT__i_s_h_s += lastoffset*588;
241                             PRIM_PTR_INT__i_s_i_s += lastoffset*784;
242                             PRIM_PTR_INT__i_s_k_s += lastoffset*1008;
243                             continue;
244                         }
245                     }
246 
247                     const SIMINT_DBLTYPE Q_alpha = SIMINT_DBLLOAD(Q.alpha, j);
248                     const SIMINT_DBLTYPE PQalpha_mul = SIMINT_MUL(P_alpha, Q_alpha);
249                     const SIMINT_DBLTYPE PQalpha_sum = SIMINT_ADD(P_alpha, Q_alpha);
250                     const SIMINT_DBLTYPE one_over_PQalpha_sum = SIMINT_DIV(const_1, PQalpha_sum);
251 
252 
253                     /* construct R2 = (Px - Qx)**2 + (Py - Qy)**2 + (Pz -Qz)**2 */
254                     SIMINT_DBLTYPE PQ[3];
255                     PQ[0] = SIMINT_SUB(Pxyz[0], SIMINT_DBLLOAD(Q.x, j));
256                     PQ[1] = SIMINT_SUB(Pxyz[1], SIMINT_DBLLOAD(Q.y, j));
257                     PQ[2] = SIMINT_SUB(Pxyz[2], SIMINT_DBLLOAD(Q.z, j));
258                     SIMINT_DBLTYPE R2 = SIMINT_MUL(PQ[0], PQ[0]);
259                     R2 = SIMINT_FMADD(PQ[1], PQ[1], R2);
260                     R2 = SIMINT_FMADD(PQ[2], PQ[2], R2);
261 
262                     const SIMINT_DBLTYPE alpha = SIMINT_MUL(PQalpha_mul, one_over_PQalpha_sum); // alpha from MEST
263                     const SIMINT_DBLTYPE one_over_p = SIMINT_DIV(const_1, P_alpha);
264                     const SIMINT_DBLTYPE one_over_q = SIMINT_DIV(const_1, Q_alpha);
265                     const SIMINT_DBLTYPE one_over_2p = SIMINT_MUL(one_half, one_over_p);
266                     const SIMINT_DBLTYPE one_over_2q = SIMINT_MUL(one_half, one_over_q);
267                     const SIMINT_DBLTYPE one_over_2pq = SIMINT_MUL(one_half, one_over_PQalpha_sum);
268                     const SIMINT_DBLTYPE Q_PA[3] = { SIMINT_DBLLOAD(Q.PA_x, j), SIMINT_DBLLOAD(Q.PA_y, j), SIMINT_DBLLOAD(Q.PA_z, j) };
269 
270                     // NOTE: Minus sign!
271                     const SIMINT_DBLTYPE a_over_p = SIMINT_MUL(SIMINT_NEG(alpha), one_over_p);
272                     SIMINT_DBLTYPE aop_PQ[3];
273                     aop_PQ[0] = SIMINT_MUL(a_over_p, PQ[0]);
274                     aop_PQ[1] = SIMINT_MUL(a_over_p, PQ[1]);
275                     aop_PQ[2] = SIMINT_MUL(a_over_p, PQ[2]);
276 
277                     SIMINT_DBLTYPE a_over_q = SIMINT_MUL(alpha, one_over_q);
278                     SIMINT_DBLTYPE aoq_PQ[3];
279                     aoq_PQ[0] = SIMINT_MUL(a_over_q, PQ[0]);
280                     aoq_PQ[1] = SIMINT_MUL(a_over_q, PQ[1]);
281                     aoq_PQ[2] = SIMINT_MUL(a_over_q, PQ[2]);
282                     // Put a minus sign here so we don't have to in RR routines
283                     a_over_q = SIMINT_NEG(a_over_q);
284 
285 
286                     //////////////////////////////////////////////
287                     // Fjt function section
288                     // Maximum v value: 13
289                     //////////////////////////////////////////////
290                     // The parameter to the Fjt function
291                     const SIMINT_DBLTYPE F_x = SIMINT_MUL(R2, alpha);
292 
293 
294                     const SIMINT_DBLTYPE Q_prefac = mask_load(nlane, Q.prefac + j);
295 
296 
297                     boys_F_split(PRIM_INT__s_s_s_s, F_x, 13);
298                     SIMINT_DBLTYPE prefac = SIMINT_SQRT(one_over_PQalpha_sum);
299                     prefac = SIMINT_MUL(SIMINT_MUL(P_prefac, Q_prefac), prefac);
300                     for(n = 0; n <= 13; n++)
301                         PRIM_INT__s_s_s_s[n] = SIMINT_MUL(PRIM_INT__s_s_s_s[n], prefac);
302 
303                     //////////////////////////////////////////////
304                     // Primitive integrals: Vertical recurrance
305                     //////////////////////////////////////////////
306 
307                     const SIMINT_DBLTYPE vrr_const_1_over_2p = one_over_2p;
308                     const SIMINT_DBLTYPE vrr_const_2_over_2p = SIMINT_MUL(const_2, one_over_2p);
309                     const SIMINT_DBLTYPE vrr_const_3_over_2p = SIMINT_MUL(const_3, one_over_2p);
310                     const SIMINT_DBLTYPE vrr_const_4_over_2p = SIMINT_MUL(const_4, one_over_2p);
311                     const SIMINT_DBLTYPE vrr_const_5_over_2p = SIMINT_MUL(const_5, one_over_2p);
312                     const SIMINT_DBLTYPE vrr_const_1_over_2q = one_over_2q;
313                     const SIMINT_DBLTYPE vrr_const_2_over_2q = SIMINT_MUL(const_2, one_over_2q);
314                     const SIMINT_DBLTYPE vrr_const_3_over_2q = SIMINT_MUL(const_3, one_over_2q);
315                     const SIMINT_DBLTYPE vrr_const_4_over_2q = SIMINT_MUL(const_4, one_over_2q);
316                     const SIMINT_DBLTYPE vrr_const_5_over_2q = SIMINT_MUL(const_5, one_over_2q);
317                     const SIMINT_DBLTYPE vrr_const_6_over_2q = SIMINT_MUL(const_6, one_over_2q);
318                     const SIMINT_DBLTYPE vrr_const_1_over_2pq = one_over_2pq;
319                     const SIMINT_DBLTYPE vrr_const_2_over_2pq = SIMINT_MUL(const_2, one_over_2pq);
320                     const SIMINT_DBLTYPE vrr_const_3_over_2pq = SIMINT_MUL(const_3, one_over_2pq);
321                     const SIMINT_DBLTYPE vrr_const_4_over_2pq = SIMINT_MUL(const_4, one_over_2pq);
322                     const SIMINT_DBLTYPE vrr_const_5_over_2pq = SIMINT_MUL(const_5, one_over_2pq);
323                     const SIMINT_DBLTYPE vrr_const_6_over_2pq = SIMINT_MUL(const_6, one_over_2pq);
324                     const SIMINT_DBLTYPE vrr_const_7_over_2pq = SIMINT_MUL(const_7, one_over_2pq);
325 
326 
327 
328                     // Forming PRIM_INT__s_s_p_s[13 * 3];
329                     for(n = 0; n < 13; ++n)  // loop over orders of auxiliary function
330                     {
331 
332                         PRIM_INT__s_s_p_s[n * 3 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__s_s_s_s[n * 1 + 0]);
333                         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]);
334 
335                         PRIM_INT__s_s_p_s[n * 3 + 1] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_s_s[n * 1 + 0]);
336                         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]);
337 
338                         PRIM_INT__s_s_p_s[n * 3 + 2] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_s_s[n * 1 + 0]);
339                         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]);
340 
341                     }
342 
343 
344 
345                     // Forming PRIM_INT__s_s_d_s[12 * 6];
346                     for(n = 0; n < 12; ++n)  // loop over orders of auxiliary function
347                     {
348 
349                         PRIM_INT__s_s_d_s[n * 6 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__s_s_p_s[n * 3 + 0]);
350                         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]);
351                         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]);
352 
353                         PRIM_INT__s_s_d_s[n * 6 + 1] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_p_s[n * 3 + 0]);
354                         PRIM_INT__s_s_d_s[n * 6 + 1] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__s_s_p_s[(n+1) * 3 + 0], PRIM_INT__s_s_d_s[n * 6 + 1]);
355 
356                         PRIM_INT__s_s_d_s[n * 6 + 2] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_p_s[n * 3 + 0]);
357                         PRIM_INT__s_s_d_s[n * 6 + 2] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__s_s_p_s[(n+1) * 3 + 0], PRIM_INT__s_s_d_s[n * 6 + 2]);
358 
359                         PRIM_INT__s_s_d_s[n * 6 + 3] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_p_s[n * 3 + 1]);
360                         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]);
361                         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]);
362 
363                         PRIM_INT__s_s_d_s[n * 6 + 4] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_p_s[n * 3 + 1]);
364                         PRIM_INT__s_s_d_s[n * 6 + 4] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__s_s_p_s[(n+1) * 3 + 1], PRIM_INT__s_s_d_s[n * 6 + 4]);
365 
366                         PRIM_INT__s_s_d_s[n * 6 + 5] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_p_s[n * 3 + 2]);
367                         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]);
368                         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]);
369 
370                     }
371 
372 
373 
374                     // Forming PRIM_INT__s_s_f_s[11 * 10];
375                     for(n = 0; n < 11; ++n)  // loop over orders of auxiliary function
376                     {
377 
378                         PRIM_INT__s_s_f_s[n * 10 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__s_s_d_s[n * 6 + 0]);
379                         PRIM_INT__s_s_f_s[n * 10 + 0] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__s_s_d_s[(n+1) * 6 + 0], PRIM_INT__s_s_f_s[n * 10 + 0]);
380                         PRIM_INT__s_s_f_s[n * 10 + 0] = SIMINT_FMADD( vrr_const_2_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__s_s_p_s[(n+1) * 3 + 0], PRIM_INT__s_s_p_s[n * 3 + 0]), PRIM_INT__s_s_f_s[n * 10 + 0]);
381 
382                         PRIM_INT__s_s_f_s[n * 10 + 1] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_d_s[n * 6 + 0]);
383                         PRIM_INT__s_s_f_s[n * 10 + 1] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__s_s_d_s[(n+1) * 6 + 0], PRIM_INT__s_s_f_s[n * 10 + 1]);
384 
385                         PRIM_INT__s_s_f_s[n * 10 + 2] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_d_s[n * 6 + 0]);
386                         PRIM_INT__s_s_f_s[n * 10 + 2] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__s_s_d_s[(n+1) * 6 + 0], PRIM_INT__s_s_f_s[n * 10 + 2]);
387 
388                         PRIM_INT__s_s_f_s[n * 10 + 3] = SIMINT_MUL(Q_PA[0], PRIM_INT__s_s_d_s[n * 6 + 3]);
389                         PRIM_INT__s_s_f_s[n * 10 + 3] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__s_s_d_s[(n+1) * 6 + 3], PRIM_INT__s_s_f_s[n * 10 + 3]);
390 
391                         PRIM_INT__s_s_f_s[n * 10 + 4] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_d_s[n * 6 + 1]);
392                         PRIM_INT__s_s_f_s[n * 10 + 4] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__s_s_d_s[(n+1) * 6 + 1], PRIM_INT__s_s_f_s[n * 10 + 4]);
393 
394                         PRIM_INT__s_s_f_s[n * 10 + 5] = SIMINT_MUL(Q_PA[0], PRIM_INT__s_s_d_s[n * 6 + 5]);
395                         PRIM_INT__s_s_f_s[n * 10 + 5] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__s_s_d_s[(n+1) * 6 + 5], PRIM_INT__s_s_f_s[n * 10 + 5]);
396 
397                         PRIM_INT__s_s_f_s[n * 10 + 6] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_d_s[n * 6 + 3]);
398                         PRIM_INT__s_s_f_s[n * 10 + 6] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__s_s_d_s[(n+1) * 6 + 3], PRIM_INT__s_s_f_s[n * 10 + 6]);
399                         PRIM_INT__s_s_f_s[n * 10 + 6] = SIMINT_FMADD( vrr_const_2_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__s_s_p_s[(n+1) * 3 + 1], PRIM_INT__s_s_p_s[n * 3 + 1]), PRIM_INT__s_s_f_s[n * 10 + 6]);
400 
401                         PRIM_INT__s_s_f_s[n * 10 + 7] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_d_s[n * 6 + 3]);
402                         PRIM_INT__s_s_f_s[n * 10 + 7] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__s_s_d_s[(n+1) * 6 + 3], PRIM_INT__s_s_f_s[n * 10 + 7]);
403 
404                         PRIM_INT__s_s_f_s[n * 10 + 8] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_d_s[n * 6 + 5]);
405                         PRIM_INT__s_s_f_s[n * 10 + 8] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__s_s_d_s[(n+1) * 6 + 5], PRIM_INT__s_s_f_s[n * 10 + 8]);
406 
407                         PRIM_INT__s_s_f_s[n * 10 + 9] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_d_s[n * 6 + 5]);
408                         PRIM_INT__s_s_f_s[n * 10 + 9] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__s_s_d_s[(n+1) * 6 + 5], PRIM_INT__s_s_f_s[n * 10 + 9]);
409                         PRIM_INT__s_s_f_s[n * 10 + 9] = SIMINT_FMADD( vrr_const_2_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__s_s_p_s[(n+1) * 3 + 2], PRIM_INT__s_s_p_s[n * 3 + 2]), PRIM_INT__s_s_f_s[n * 10 + 9]);
410 
411                     }
412 
413 
414                     VRR_K_s_s_g_s(
415                             PRIM_INT__s_s_g_s,
416                             PRIM_INT__s_s_f_s,
417                             PRIM_INT__s_s_d_s,
418                             Q_PA,
419                             a_over_q,
420                             aoq_PQ,
421                             one_over_2q,
422                             10);
423 
424 
425                     VRR_K_s_s_h_s(
426                             PRIM_INT__s_s_h_s,
427                             PRIM_INT__s_s_g_s,
428                             PRIM_INT__s_s_f_s,
429                             Q_PA,
430                             a_over_q,
431                             aoq_PQ,
432                             one_over_2q,
433                             9);
434 
435 
436                     ostei_general_vrr_I(1, 0, 5, 0, 6,
437                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
438                             PRIM_INT__s_s_h_s, NULL, NULL, PRIM_INT__s_s_g_s, NULL, PRIM_INT__p_s_h_s);
439 
440 
441                     VRR_I_p_s_g_s(
442                             PRIM_INT__p_s_g_s,
443                             PRIM_INT__s_s_g_s,
444                             PRIM_INT__s_s_f_s,
445                             P_PA,
446                             aop_PQ,
447                             one_over_2pq,
448                             6);
449 
450 
451                     ostei_general_vrr_I(2, 0, 5, 0, 5,
452                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
453                             PRIM_INT__p_s_h_s, PRIM_INT__s_s_h_s, NULL, PRIM_INT__p_s_g_s, NULL, PRIM_INT__d_s_h_s);
454 
455 
456                     VRR_I_p_s_f_s(
457                             PRIM_INT__p_s_f_s,
458                             PRIM_INT__s_s_f_s,
459                             PRIM_INT__s_s_d_s,
460                             P_PA,
461                             aop_PQ,
462                             one_over_2pq,
463                             6);
464 
465 
466                     ostei_general_vrr_I(2, 0, 4, 0, 5,
467                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
468                             PRIM_INT__p_s_g_s, PRIM_INT__s_s_g_s, NULL, PRIM_INT__p_s_f_s, NULL, PRIM_INT__d_s_g_s);
469 
470 
471                     ostei_general_vrr_I(3, 0, 5, 0, 4,
472                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
473                             PRIM_INT__d_s_h_s, PRIM_INT__p_s_h_s, NULL, PRIM_INT__d_s_g_s, NULL, PRIM_INT__f_s_h_s);
474 
475 
476                     ostei_general_vrr1_K(6, 8,
477                             one_over_2q, a_over_q, aoq_PQ, Q_PA,
478                             PRIM_INT__s_s_h_s, PRIM_INT__s_s_g_s, PRIM_INT__s_s_i_s);
479 
480 
481                     ostei_general_vrr_I(1, 0, 6, 0, 6,
482                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
483                             PRIM_INT__s_s_i_s, NULL, NULL, PRIM_INT__s_s_h_s, NULL, PRIM_INT__p_s_i_s);
484 
485 
486                     ostei_general_vrr_I(2, 0, 6, 0, 5,
487                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
488                             PRIM_INT__p_s_i_s, PRIM_INT__s_s_i_s, NULL, PRIM_INT__p_s_h_s, NULL, PRIM_INT__d_s_i_s);
489 
490 
491                     ostei_general_vrr_I(3, 0, 6, 0, 4,
492                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
493                             PRIM_INT__d_s_i_s, PRIM_INT__p_s_i_s, NULL, PRIM_INT__d_s_h_s, NULL, PRIM_INT__f_s_i_s);
494 
495 
496 
497                     // Forming PRIM_INT__p_s_d_s[6 * 18];
498                     for(n = 0; n < 6; ++n)  // loop over orders of auxiliary function
499                     {
500 
501                         PRIM_INT__p_s_d_s[n * 18 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_d_s[n * 6 + 0]);
502                         PRIM_INT__p_s_d_s[n * 18 + 0] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__s_s_d_s[(n+1) * 6 + 0], PRIM_INT__p_s_d_s[n * 18 + 0]);
503                         PRIM_INT__p_s_d_s[n * 18 + 0] = SIMINT_FMADD( vrr_const_2_over_2pq, PRIM_INT__s_s_p_s[(n+1) * 3 + 0], PRIM_INT__p_s_d_s[n * 18 + 0]);
504 
505                         PRIM_INT__p_s_d_s[n * 18 + 1] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_d_s[n * 6 + 1]);
506                         PRIM_INT__p_s_d_s[n * 18 + 1] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__s_s_d_s[(n+1) * 6 + 1], PRIM_INT__p_s_d_s[n * 18 + 1]);
507                         PRIM_INT__p_s_d_s[n * 18 + 1] = 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 + 1]);
508 
509                         PRIM_INT__p_s_d_s[n * 18 + 2] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_d_s[n * 6 + 2]);
510                         PRIM_INT__p_s_d_s[n * 18 + 2] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__s_s_d_s[(n+1) * 6 + 2], PRIM_INT__p_s_d_s[n * 18 + 2]);
511                         PRIM_INT__p_s_d_s[n * 18 + 2] = 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 + 2]);
512 
513                         PRIM_INT__p_s_d_s[n * 18 + 3] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_d_s[n * 6 + 3]);
514                         PRIM_INT__p_s_d_s[n * 18 + 3] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__s_s_d_s[(n+1) * 6 + 3], PRIM_INT__p_s_d_s[n * 18 + 3]);
515 
516                         PRIM_INT__p_s_d_s[n * 18 + 4] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_d_s[n * 6 + 4]);
517                         PRIM_INT__p_s_d_s[n * 18 + 4] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__s_s_d_s[(n+1) * 6 + 4], PRIM_INT__p_s_d_s[n * 18 + 4]);
518 
519                         PRIM_INT__p_s_d_s[n * 18 + 5] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_d_s[n * 6 + 5]);
520                         PRIM_INT__p_s_d_s[n * 18 + 5] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__s_s_d_s[(n+1) * 6 + 5], PRIM_INT__p_s_d_s[n * 18 + 5]);
521 
522                         PRIM_INT__p_s_d_s[n * 18 + 6] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_d_s[n * 6 + 0]);
523                         PRIM_INT__p_s_d_s[n * 18 + 6] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__s_s_d_s[(n+1) * 6 + 0], PRIM_INT__p_s_d_s[n * 18 + 6]);
524 
525                         PRIM_INT__p_s_d_s[n * 18 + 7] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_d_s[n * 6 + 1]);
526                         PRIM_INT__p_s_d_s[n * 18 + 7] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__s_s_d_s[(n+1) * 6 + 1], PRIM_INT__p_s_d_s[n * 18 + 7]);
527                         PRIM_INT__p_s_d_s[n * 18 + 7] = 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 + 7]);
528 
529                         PRIM_INT__p_s_d_s[n * 18 + 8] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_d_s[n * 6 + 2]);
530                         PRIM_INT__p_s_d_s[n * 18 + 8] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__s_s_d_s[(n+1) * 6 + 2], PRIM_INT__p_s_d_s[n * 18 + 8]);
531 
532                         PRIM_INT__p_s_d_s[n * 18 + 9] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_d_s[n * 6 + 3]);
533                         PRIM_INT__p_s_d_s[n * 18 + 9] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__s_s_d_s[(n+1) * 6 + 3], PRIM_INT__p_s_d_s[n * 18 + 9]);
534                         PRIM_INT__p_s_d_s[n * 18 + 9] = SIMINT_FMADD( vrr_const_2_over_2pq, PRIM_INT__s_s_p_s[(n+1) * 3 + 1], PRIM_INT__p_s_d_s[n * 18 + 9]);
535 
536                         PRIM_INT__p_s_d_s[n * 18 + 10] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_d_s[n * 6 + 4]);
537                         PRIM_INT__p_s_d_s[n * 18 + 10] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__s_s_d_s[(n+1) * 6 + 4], PRIM_INT__p_s_d_s[n * 18 + 10]);
538                         PRIM_INT__p_s_d_s[n * 18 + 10] = 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 + 10]);
539 
540                         PRIM_INT__p_s_d_s[n * 18 + 11] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_d_s[n * 6 + 5]);
541                         PRIM_INT__p_s_d_s[n * 18 + 11] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__s_s_d_s[(n+1) * 6 + 5], PRIM_INT__p_s_d_s[n * 18 + 11]);
542 
543                         PRIM_INT__p_s_d_s[n * 18 + 12] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_d_s[n * 6 + 0]);
544                         PRIM_INT__p_s_d_s[n * 18 + 12] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__s_s_d_s[(n+1) * 6 + 0], PRIM_INT__p_s_d_s[n * 18 + 12]);
545 
546                         PRIM_INT__p_s_d_s[n * 18 + 13] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_d_s[n * 6 + 1]);
547                         PRIM_INT__p_s_d_s[n * 18 + 13] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__s_s_d_s[(n+1) * 6 + 1], PRIM_INT__p_s_d_s[n * 18 + 13]);
548 
549                         PRIM_INT__p_s_d_s[n * 18 + 14] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_d_s[n * 6 + 2]);
550                         PRIM_INT__p_s_d_s[n * 18 + 14] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__s_s_d_s[(n+1) * 6 + 2], PRIM_INT__p_s_d_s[n * 18 + 14]);
551                         PRIM_INT__p_s_d_s[n * 18 + 14] = 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 + 14]);
552 
553                         PRIM_INT__p_s_d_s[n * 18 + 15] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_d_s[n * 6 + 3]);
554                         PRIM_INT__p_s_d_s[n * 18 + 15] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__s_s_d_s[(n+1) * 6 + 3], PRIM_INT__p_s_d_s[n * 18 + 15]);
555 
556                         PRIM_INT__p_s_d_s[n * 18 + 16] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_d_s[n * 6 + 4]);
557                         PRIM_INT__p_s_d_s[n * 18 + 16] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__s_s_d_s[(n+1) * 6 + 4], PRIM_INT__p_s_d_s[n * 18 + 16]);
558                         PRIM_INT__p_s_d_s[n * 18 + 16] = 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 + 16]);
559 
560                         PRIM_INT__p_s_d_s[n * 18 + 17] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_d_s[n * 6 + 5]);
561                         PRIM_INT__p_s_d_s[n * 18 + 17] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__s_s_d_s[(n+1) * 6 + 5], PRIM_INT__p_s_d_s[n * 18 + 17]);
562                         PRIM_INT__p_s_d_s[n * 18 + 17] = SIMINT_FMADD( vrr_const_2_over_2pq, PRIM_INT__s_s_p_s[(n+1) * 3 + 2], PRIM_INT__p_s_d_s[n * 18 + 17]);
563 
564                     }
565 
566 
567                     VRR_I_d_s_f_s(
568                             PRIM_INT__d_s_f_s,
569                             PRIM_INT__p_s_f_s,
570                             PRIM_INT__s_s_f_s,
571                             PRIM_INT__p_s_d_s,
572                             P_PA,
573                             a_over_p,
574                             aop_PQ,
575                             one_over_2p,
576                             one_over_2pq,
577                             5);
578 
579 
580                     ostei_general_vrr_I(3, 0, 4, 0, 4,
581                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
582                             PRIM_INT__d_s_g_s, PRIM_INT__p_s_g_s, NULL, PRIM_INT__d_s_f_s, NULL, PRIM_INT__f_s_g_s);
583 
584 
585                     ostei_general_vrr_I(4, 0, 5, 0, 3,
586                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
587                             PRIM_INT__f_s_h_s, PRIM_INT__d_s_h_s, NULL, PRIM_INT__f_s_g_s, NULL, PRIM_INT__g_s_h_s);
588 
589 
590                     ostei_general_vrr1_K(7, 7,
591                             one_over_2q, a_over_q, aoq_PQ, Q_PA,
592                             PRIM_INT__s_s_i_s, PRIM_INT__s_s_h_s, PRIM_INT__s_s_k_s);
593 
594 
595                     ostei_general_vrr_I(1, 0, 7, 0, 6,
596                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
597                             PRIM_INT__s_s_k_s, NULL, NULL, PRIM_INT__s_s_i_s, NULL, PRIM_INT__p_s_k_s);
598 
599 
600                     ostei_general_vrr_I(2, 0, 7, 0, 5,
601                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
602                             PRIM_INT__p_s_k_s, PRIM_INT__s_s_k_s, NULL, PRIM_INT__p_s_i_s, NULL, PRIM_INT__d_s_k_s);
603 
604 
605                     ostei_general_vrr_I(3, 0, 7, 0, 4,
606                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
607                             PRIM_INT__d_s_k_s, PRIM_INT__p_s_k_s, NULL, PRIM_INT__d_s_i_s, NULL, PRIM_INT__f_s_k_s);
608 
609 
610                     ostei_general_vrr_I(4, 0, 6, 0, 3,
611                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
612                             PRIM_INT__f_s_i_s, PRIM_INT__d_s_i_s, NULL, PRIM_INT__f_s_h_s, NULL, PRIM_INT__g_s_i_s);
613 
614 
615 
616                     // Forming PRIM_INT__p_s_p_s[6 * 9];
617                     for(n = 0; n < 6; ++n)  // loop over orders of auxiliary function
618                     {
619 
620                         PRIM_INT__p_s_p_s[n * 9 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_p_s[n * 3 + 0]);
621                         PRIM_INT__p_s_p_s[n * 9 + 0] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__s_s_p_s[(n+1) * 3 + 0], PRIM_INT__p_s_p_s[n * 9 + 0]);
622                         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]);
623 
624                         PRIM_INT__p_s_p_s[n * 9 + 1] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_p_s[n * 3 + 1]);
625                         PRIM_INT__p_s_p_s[n * 9 + 1] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__s_s_p_s[(n+1) * 3 + 1], PRIM_INT__p_s_p_s[n * 9 + 1]);
626 
627                         PRIM_INT__p_s_p_s[n * 9 + 2] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_p_s[n * 3 + 2]);
628                         PRIM_INT__p_s_p_s[n * 9 + 2] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__s_s_p_s[(n+1) * 3 + 2], PRIM_INT__p_s_p_s[n * 9 + 2]);
629 
630                         PRIM_INT__p_s_p_s[n * 9 + 3] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_p_s[n * 3 + 0]);
631                         PRIM_INT__p_s_p_s[n * 9 + 3] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__s_s_p_s[(n+1) * 3 + 0], PRIM_INT__p_s_p_s[n * 9 + 3]);
632 
633                         PRIM_INT__p_s_p_s[n * 9 + 4] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_p_s[n * 3 + 1]);
634                         PRIM_INT__p_s_p_s[n * 9 + 4] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__s_s_p_s[(n+1) * 3 + 1], PRIM_INT__p_s_p_s[n * 9 + 4]);
635                         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]);
636 
637                         PRIM_INT__p_s_p_s[n * 9 + 5] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_p_s[n * 3 + 2]);
638                         PRIM_INT__p_s_p_s[n * 9 + 5] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__s_s_p_s[(n+1) * 3 + 2], PRIM_INT__p_s_p_s[n * 9 + 5]);
639 
640                         PRIM_INT__p_s_p_s[n * 9 + 6] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_p_s[n * 3 + 0]);
641                         PRIM_INT__p_s_p_s[n * 9 + 6] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__s_s_p_s[(n+1) * 3 + 0], PRIM_INT__p_s_p_s[n * 9 + 6]);
642 
643                         PRIM_INT__p_s_p_s[n * 9 + 7] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_p_s[n * 3 + 1]);
644                         PRIM_INT__p_s_p_s[n * 9 + 7] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__s_s_p_s[(n+1) * 3 + 1], PRIM_INT__p_s_p_s[n * 9 + 7]);
645 
646                         PRIM_INT__p_s_p_s[n * 9 + 8] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_p_s[n * 3 + 2]);
647                         PRIM_INT__p_s_p_s[n * 9 + 8] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__s_s_p_s[(n+1) * 3 + 2], PRIM_INT__p_s_p_s[n * 9 + 8]);
648                         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]);
649 
650                     }
651 
652 
653                     VRR_I_d_s_d_s(
654                             PRIM_INT__d_s_d_s,
655                             PRIM_INT__p_s_d_s,
656                             PRIM_INT__s_s_d_s,
657                             PRIM_INT__p_s_p_s,
658                             P_PA,
659                             a_over_p,
660                             aop_PQ,
661                             one_over_2p,
662                             one_over_2pq,
663                             5);
664 
665 
666                     ostei_general_vrr_I(3, 0, 3, 0, 4,
667                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
668                             PRIM_INT__d_s_f_s, PRIM_INT__p_s_f_s, NULL, PRIM_INT__d_s_d_s, NULL, PRIM_INT__f_s_f_s);
669 
670 
671                     ostei_general_vrr_I(4, 0, 4, 0, 3,
672                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
673                             PRIM_INT__f_s_g_s, PRIM_INT__d_s_g_s, NULL, PRIM_INT__f_s_f_s, NULL, PRIM_INT__g_s_g_s);
674 
675 
676                     ostei_general_vrr_I(5, 0, 5, 0, 2,
677                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
678                             PRIM_INT__g_s_h_s, PRIM_INT__f_s_h_s, NULL, PRIM_INT__g_s_g_s, NULL, PRIM_INT__h_s_h_s);
679 
680 
681                     ostei_general_vrr_I(4, 0, 7, 0, 3,
682                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
683                             PRIM_INT__f_s_k_s, PRIM_INT__d_s_k_s, NULL, PRIM_INT__f_s_i_s, NULL, PRIM_INT__g_s_k_s);
684 
685 
686                     ostei_general_vrr_I(5, 0, 6, 0, 2,
687                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
688                             PRIM_INT__g_s_i_s, PRIM_INT__f_s_i_s, NULL, PRIM_INT__g_s_h_s, NULL, PRIM_INT__h_s_i_s);
689 
690 
691 
692                     // Forming PRIM_INT__p_s_s_s[6 * 3];
693                     for(n = 0; n < 6; ++n)  // loop over orders of auxiliary function
694                     {
695 
696                         PRIM_INT__p_s_s_s[n * 3 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_s_s[n * 1 + 0]);
697                         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]);
698 
699                         PRIM_INT__p_s_s_s[n * 3 + 1] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_s_s[n * 1 + 0]);
700                         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]);
701 
702                         PRIM_INT__p_s_s_s[n * 3 + 2] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_s_s[n * 1 + 0]);
703                         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]);
704 
705                     }
706 
707 
708 
709                     // Forming PRIM_INT__d_s_p_s[5 * 18];
710                     for(n = 0; n < 5; ++n)  // loop over orders of auxiliary function
711                     {
712 
713                         PRIM_INT__d_s_p_s[n * 18 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__p_s_p_s[n * 9 + 0]);
714                         PRIM_INT__d_s_p_s[n * 18 + 0] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__p_s_p_s[(n+1) * 9 + 0], PRIM_INT__d_s_p_s[n * 18 + 0]);
715                         PRIM_INT__d_s_p_s[n * 18 + 0] = SIMINT_FMADD( vrr_const_1_over_2p, SIMINT_FMADD(a_over_p, PRIM_INT__s_s_p_s[(n+1) * 3 + 0], PRIM_INT__s_s_p_s[n * 3 + 0]), PRIM_INT__d_s_p_s[n * 18 + 0]);
716                         PRIM_INT__d_s_p_s[n * 18 + 0] = 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 + 0]);
717 
718                         PRIM_INT__d_s_p_s[n * 18 + 1] = SIMINT_MUL(P_PA[0], PRIM_INT__p_s_p_s[n * 9 + 1]);
719                         PRIM_INT__d_s_p_s[n * 18 + 1] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__p_s_p_s[(n+1) * 9 + 1], PRIM_INT__d_s_p_s[n * 18 + 1]);
720                         PRIM_INT__d_s_p_s[n * 18 + 1] = SIMINT_FMADD( vrr_const_1_over_2p, SIMINT_FMADD(a_over_p, PRIM_INT__s_s_p_s[(n+1) * 3 + 1], PRIM_INT__s_s_p_s[n * 3 + 1]), PRIM_INT__d_s_p_s[n * 18 + 1]);
721 
722                         PRIM_INT__d_s_p_s[n * 18 + 2] = SIMINT_MUL(P_PA[0], PRIM_INT__p_s_p_s[n * 9 + 2]);
723                         PRIM_INT__d_s_p_s[n * 18 + 2] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__p_s_p_s[(n+1) * 9 + 2], PRIM_INT__d_s_p_s[n * 18 + 2]);
724                         PRIM_INT__d_s_p_s[n * 18 + 2] = SIMINT_FMADD( vrr_const_1_over_2p, SIMINT_FMADD(a_over_p, PRIM_INT__s_s_p_s[(n+1) * 3 + 2], PRIM_INT__s_s_p_s[n * 3 + 2]), PRIM_INT__d_s_p_s[n * 18 + 2]);
725 
726                         PRIM_INT__d_s_p_s[n * 18 + 9] = SIMINT_MUL(P_PA[1], PRIM_INT__p_s_p_s[n * 9 + 3]);
727                         PRIM_INT__d_s_p_s[n * 18 + 9] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__p_s_p_s[(n+1) * 9 + 3], PRIM_INT__d_s_p_s[n * 18 + 9]);
728                         PRIM_INT__d_s_p_s[n * 18 + 9] = SIMINT_FMADD( vrr_const_1_over_2p, SIMINT_FMADD(a_over_p, PRIM_INT__s_s_p_s[(n+1) * 3 + 0], PRIM_INT__s_s_p_s[n * 3 + 0]), PRIM_INT__d_s_p_s[n * 18 + 9]);
729 
730                         PRIM_INT__d_s_p_s[n * 18 + 10] = SIMINT_MUL(P_PA[1], PRIM_INT__p_s_p_s[n * 9 + 4]);
731                         PRIM_INT__d_s_p_s[n * 18 + 10] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__p_s_p_s[(n+1) * 9 + 4], PRIM_INT__d_s_p_s[n * 18 + 10]);
732                         PRIM_INT__d_s_p_s[n * 18 + 10] = SIMINT_FMADD( vrr_const_1_over_2p, SIMINT_FMADD(a_over_p, PRIM_INT__s_s_p_s[(n+1) * 3 + 1], PRIM_INT__s_s_p_s[n * 3 + 1]), PRIM_INT__d_s_p_s[n * 18 + 10]);
733                         PRIM_INT__d_s_p_s[n * 18 + 10] = 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 + 10]);
734 
735                         PRIM_INT__d_s_p_s[n * 18 + 11] = SIMINT_MUL(P_PA[1], PRIM_INT__p_s_p_s[n * 9 + 5]);
736                         PRIM_INT__d_s_p_s[n * 18 + 11] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__p_s_p_s[(n+1) * 9 + 5], PRIM_INT__d_s_p_s[n * 18 + 11]);
737                         PRIM_INT__d_s_p_s[n * 18 + 11] = SIMINT_FMADD( vrr_const_1_over_2p, SIMINT_FMADD(a_over_p, PRIM_INT__s_s_p_s[(n+1) * 3 + 2], PRIM_INT__s_s_p_s[n * 3 + 2]), PRIM_INT__d_s_p_s[n * 18 + 11]);
738 
739                         PRIM_INT__d_s_p_s[n * 18 + 15] = SIMINT_MUL(P_PA[2], PRIM_INT__p_s_p_s[n * 9 + 6]);
740                         PRIM_INT__d_s_p_s[n * 18 + 15] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__p_s_p_s[(n+1) * 9 + 6], PRIM_INT__d_s_p_s[n * 18 + 15]);
741                         PRIM_INT__d_s_p_s[n * 18 + 15] = SIMINT_FMADD( vrr_const_1_over_2p, SIMINT_FMADD(a_over_p, PRIM_INT__s_s_p_s[(n+1) * 3 + 0], PRIM_INT__s_s_p_s[n * 3 + 0]), PRIM_INT__d_s_p_s[n * 18 + 15]);
742 
743                         PRIM_INT__d_s_p_s[n * 18 + 16] = SIMINT_MUL(P_PA[2], PRIM_INT__p_s_p_s[n * 9 + 7]);
744                         PRIM_INT__d_s_p_s[n * 18 + 16] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__p_s_p_s[(n+1) * 9 + 7], PRIM_INT__d_s_p_s[n * 18 + 16]);
745                         PRIM_INT__d_s_p_s[n * 18 + 16] = SIMINT_FMADD( vrr_const_1_over_2p, SIMINT_FMADD(a_over_p, PRIM_INT__s_s_p_s[(n+1) * 3 + 1], PRIM_INT__s_s_p_s[n * 3 + 1]), PRIM_INT__d_s_p_s[n * 18 + 16]);
746 
747                         PRIM_INT__d_s_p_s[n * 18 + 17] = SIMINT_MUL(P_PA[2], PRIM_INT__p_s_p_s[n * 9 + 8]);
748                         PRIM_INT__d_s_p_s[n * 18 + 17] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__p_s_p_s[(n+1) * 9 + 8], PRIM_INT__d_s_p_s[n * 18 + 17]);
749                         PRIM_INT__d_s_p_s[n * 18 + 17] = SIMINT_FMADD( vrr_const_1_over_2p, SIMINT_FMADD(a_over_p, PRIM_INT__s_s_p_s[(n+1) * 3 + 2], PRIM_INT__s_s_p_s[n * 3 + 2]), PRIM_INT__d_s_p_s[n * 18 + 17]);
750                         PRIM_INT__d_s_p_s[n * 18 + 17] = 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 + 17]);
751 
752                     }
753 
754 
755                     VRR_I_f_s_d_s(
756                             PRIM_INT__f_s_d_s,
757                             PRIM_INT__d_s_d_s,
758                             PRIM_INT__p_s_d_s,
759                             PRIM_INT__d_s_p_s,
760                             P_PA,
761                             a_over_p,
762                             aop_PQ,
763                             one_over_2p,
764                             one_over_2pq,
765                             4);
766 
767 
768                     ostei_general_vrr_I(4, 0, 3, 0, 3,
769                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
770                             PRIM_INT__f_s_f_s, PRIM_INT__d_s_f_s, NULL, PRIM_INT__f_s_d_s, NULL, PRIM_INT__g_s_f_s);
771 
772 
773                     ostei_general_vrr_I(5, 0, 4, 0, 2,
774                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
775                             PRIM_INT__g_s_g_s, PRIM_INT__f_s_g_s, NULL, PRIM_INT__g_s_f_s, NULL, PRIM_INT__h_s_g_s);
776 
777 
778                     ostei_general_vrr_I(6, 0, 5, 0, 1,
779                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
780                             PRIM_INT__h_s_h_s, PRIM_INT__g_s_h_s, NULL, PRIM_INT__h_s_g_s, NULL, PRIM_INT__i_s_h_s);
781 
782 
783                     ostei_general_vrr_I(5, 0, 7, 0, 2,
784                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
785                             PRIM_INT__g_s_k_s, PRIM_INT__f_s_k_s, NULL, PRIM_INT__g_s_i_s, NULL, PRIM_INT__h_s_k_s);
786 
787 
788                     ostei_general_vrr_I(6, 0, 6, 0, 1,
789                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
790                             PRIM_INT__h_s_i_s, PRIM_INT__g_s_i_s, NULL, PRIM_INT__h_s_h_s, NULL, PRIM_INT__i_s_i_s);
791 
792 
793                     ostei_general_vrr_I(6, 0, 7, 0, 1,
794                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
795                             PRIM_INT__h_s_k_s, PRIM_INT__g_s_k_s, NULL, PRIM_INT__h_s_i_s, NULL, PRIM_INT__i_s_k_s);
796 
797 
798 
799 
800                     ////////////////////////////////////
801                     // Accumulate contracted integrals
802                     ////////////////////////////////////
803                     if(lastoffset == 0)
804                     {
805                         contract_all(210, PRIM_INT__f_s_h_s, PRIM_PTR_INT__f_s_h_s);
806                         contract_all(280, PRIM_INT__f_s_i_s, PRIM_PTR_INT__f_s_i_s);
807                         contract_all(360, PRIM_INT__f_s_k_s, PRIM_PTR_INT__f_s_k_s);
808                         contract_all(315, PRIM_INT__g_s_h_s, PRIM_PTR_INT__g_s_h_s);
809                         contract_all(420, PRIM_INT__g_s_i_s, PRIM_PTR_INT__g_s_i_s);
810                         contract_all(540, PRIM_INT__g_s_k_s, PRIM_PTR_INT__g_s_k_s);
811                         contract_all(441, PRIM_INT__h_s_h_s, PRIM_PTR_INT__h_s_h_s);
812                         contract_all(588, PRIM_INT__h_s_i_s, PRIM_PTR_INT__h_s_i_s);
813                         contract_all(756, PRIM_INT__h_s_k_s, PRIM_PTR_INT__h_s_k_s);
814                         contract_all(588, PRIM_INT__i_s_h_s, PRIM_PTR_INT__i_s_h_s);
815                         contract_all(784, PRIM_INT__i_s_i_s, PRIM_PTR_INT__i_s_i_s);
816                         contract_all(1008, PRIM_INT__i_s_k_s, PRIM_PTR_INT__i_s_k_s);
817                     }
818                     else
819                     {
820                         contract(210, shelloffsets, PRIM_INT__f_s_h_s, PRIM_PTR_INT__f_s_h_s);
821                         contract(280, shelloffsets, PRIM_INT__f_s_i_s, PRIM_PTR_INT__f_s_i_s);
822                         contract(360, shelloffsets, PRIM_INT__f_s_k_s, PRIM_PTR_INT__f_s_k_s);
823                         contract(315, shelloffsets, PRIM_INT__g_s_h_s, PRIM_PTR_INT__g_s_h_s);
824                         contract(420, shelloffsets, PRIM_INT__g_s_i_s, PRIM_PTR_INT__g_s_i_s);
825                         contract(540, shelloffsets, PRIM_INT__g_s_k_s, PRIM_PTR_INT__g_s_k_s);
826                         contract(441, shelloffsets, PRIM_INT__h_s_h_s, PRIM_PTR_INT__h_s_h_s);
827                         contract(588, shelloffsets, PRIM_INT__h_s_i_s, PRIM_PTR_INT__h_s_i_s);
828                         contract(756, shelloffsets, PRIM_INT__h_s_k_s, PRIM_PTR_INT__h_s_k_s);
829                         contract(588, shelloffsets, PRIM_INT__i_s_h_s, PRIM_PTR_INT__i_s_h_s);
830                         contract(784, shelloffsets, PRIM_INT__i_s_i_s, PRIM_PTR_INT__i_s_i_s);
831                         contract(1008, shelloffsets, PRIM_INT__i_s_k_s, PRIM_PTR_INT__i_s_k_s);
832                         PRIM_PTR_INT__f_s_h_s += lastoffset*210;
833                         PRIM_PTR_INT__f_s_i_s += lastoffset*280;
834                         PRIM_PTR_INT__f_s_k_s += lastoffset*360;
835                         PRIM_PTR_INT__g_s_h_s += lastoffset*315;
836                         PRIM_PTR_INT__g_s_i_s += lastoffset*420;
837                         PRIM_PTR_INT__g_s_k_s += lastoffset*540;
838                         PRIM_PTR_INT__h_s_h_s += lastoffset*441;
839                         PRIM_PTR_INT__h_s_i_s += lastoffset*588;
840                         PRIM_PTR_INT__h_s_k_s += lastoffset*756;
841                         PRIM_PTR_INT__i_s_h_s += lastoffset*588;
842                         PRIM_PTR_INT__i_s_i_s += lastoffset*784;
843                         PRIM_PTR_INT__i_s_k_s += lastoffset*1008;
844                     }
845 
846                 }  // close loop over j
847             }  // close loop over i
848 
849             //Advance to the next batch
850             jstart = SIMINT_SIMD_ROUND(jend);
851 
852             //////////////////////////////////////////////
853             // Contracted integrals: Horizontal recurrance
854             //////////////////////////////////////////////
855 
856 
857             const double hAB[3] = { P.AB_x[ab], P.AB_y[ab], P.AB_z[ab] };
858 
859 
860             for(abcd = 0; abcd < nshellbatch; ++abcd, ++real_abcd)
861             {
862                 const double hCD[3] = { Q.AB_x[cd+abcd], Q.AB_y[cd+abcd], Q.AB_z[cd+abcd] };
863 
864                 // set up HRR pointers
865                 double const * restrict HRR_INT__f_s_h_s = INT__f_s_h_s + abcd * 210;
866                 double const * restrict HRR_INT__f_s_i_s = INT__f_s_i_s + abcd * 280;
867                 double const * restrict HRR_INT__f_s_k_s = INT__f_s_k_s + abcd * 360;
868                 double const * restrict HRR_INT__g_s_h_s = INT__g_s_h_s + abcd * 315;
869                 double const * restrict HRR_INT__g_s_i_s = INT__g_s_i_s + abcd * 420;
870                 double const * restrict HRR_INT__g_s_k_s = INT__g_s_k_s + abcd * 540;
871                 double const * restrict HRR_INT__h_s_h_s = INT__h_s_h_s + abcd * 441;
872                 double const * restrict HRR_INT__h_s_i_s = INT__h_s_i_s + abcd * 588;
873                 double const * restrict HRR_INT__h_s_k_s = INT__h_s_k_s + abcd * 756;
874                 double const * restrict HRR_INT__i_s_h_s = INT__i_s_h_s + abcd * 588;
875                 double const * restrict HRR_INT__i_s_i_s = INT__i_s_i_s + abcd * 784;
876                 double const * restrict HRR_INT__i_s_k_s = INT__i_s_k_s + abcd * 1008;
877                 double * restrict HRR_INT__f_f_h_d = INT__f_f_h_d + real_abcd * 12600;
878 
879                 // form INT__f_p_h_s
880                 HRR_J_f_p(
881                     HRR_INT__f_p_h_s,
882                     HRR_INT__f_s_h_s,
883                     HRR_INT__g_s_h_s,
884                     hAB, 21);
885 
886                 // form INT__f_p_i_s
887                 HRR_J_f_p(
888                     HRR_INT__f_p_i_s,
889                     HRR_INT__f_s_i_s,
890                     HRR_INT__g_s_i_s,
891                     hAB, 28);
892 
893                 // form INT__f_p_k_s
894                 HRR_J_f_p(
895                     HRR_INT__f_p_k_s,
896                     HRR_INT__f_s_k_s,
897                     HRR_INT__g_s_k_s,
898                     hAB, 36);
899 
900                 // form INT__g_p_h_s
901                 HRR_J_g_p(
902                     HRR_INT__g_p_h_s,
903                     HRR_INT__g_s_h_s,
904                     HRR_INT__h_s_h_s,
905                     hAB, 21);
906 
907                 // form INT__g_p_i_s
908                 HRR_J_g_p(
909                     HRR_INT__g_p_i_s,
910                     HRR_INT__g_s_i_s,
911                     HRR_INT__h_s_i_s,
912                     hAB, 28);
913 
914                 // form INT__g_p_k_s
915                 HRR_J_g_p(
916                     HRR_INT__g_p_k_s,
917                     HRR_INT__g_s_k_s,
918                     HRR_INT__h_s_k_s,
919                     hAB, 36);
920 
921                 // form INT__h_p_h_s
922                 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);
923 
924                 // form INT__h_p_i_s
925                 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);
926 
927                 // form INT__h_p_k_s
928                 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);
929 
930                 // form INT__f_d_h_s
931                 HRR_J_f_d(
932                     HRR_INT__f_d_h_s,
933                     HRR_INT__f_p_h_s,
934                     HRR_INT__g_p_h_s,
935                     hAB, 21);
936 
937                 // form INT__f_d_i_s
938                 HRR_J_f_d(
939                     HRR_INT__f_d_i_s,
940                     HRR_INT__f_p_i_s,
941                     HRR_INT__g_p_i_s,
942                     hAB, 28);
943 
944                 // form INT__f_d_k_s
945                 HRR_J_f_d(
946                     HRR_INT__f_d_k_s,
947                     HRR_INT__f_p_k_s,
948                     HRR_INT__g_p_k_s,
949                     hAB, 36);
950 
951                 // form INT__g_d_h_s
952                 ostei_general_hrr_J(4, 2, 5, 0, hAB, HRR_INT__h_p_h_s, HRR_INT__g_p_h_s, HRR_INT__g_d_h_s);
953 
954                 // form INT__g_d_i_s
955                 ostei_general_hrr_J(4, 2, 6, 0, hAB, HRR_INT__h_p_i_s, HRR_INT__g_p_i_s, HRR_INT__g_d_i_s);
956 
957                 // form INT__g_d_k_s
958                 ostei_general_hrr_J(4, 2, 7, 0, hAB, HRR_INT__h_p_k_s, HRR_INT__g_p_k_s, HRR_INT__g_d_k_s);
959 
960                 // form INT__f_f_h_s
961                 ostei_general_hrr_J(3, 3, 5, 0, hAB, HRR_INT__g_d_h_s, HRR_INT__f_d_h_s, HRR_INT__f_f_h_s);
962 
963                 // form INT__f_f_i_s
964                 ostei_general_hrr_J(3, 3, 6, 0, hAB, HRR_INT__g_d_i_s, HRR_INT__f_d_i_s, HRR_INT__f_f_i_s);
965 
966                 // form INT__f_f_k_s
967                 ostei_general_hrr_J(3, 3, 7, 0, hAB, HRR_INT__g_d_k_s, HRR_INT__f_d_k_s, HRR_INT__f_f_k_s);
968 
969                 // form INT__f_f_h_p
970                 ostei_general_hrr_L(3, 3, 5, 1, hCD, HRR_INT__f_f_i_s, HRR_INT__f_f_h_s, HRR_INT__f_f_h_p);
971 
972                 // form INT__f_f_i_p
973                 ostei_general_hrr_L(3, 3, 6, 1, hCD, HRR_INT__f_f_k_s, HRR_INT__f_f_i_s, HRR_INT__f_f_i_p);
974 
975                 // form INT__f_f_h_d
976                 ostei_general_hrr_L(3, 3, 5, 2, hCD, HRR_INT__f_f_i_p, HRR_INT__f_f_h_p, HRR_INT__f_f_h_d);
977 
978 
979             }  // close HRR loop
980 
981 
982         }   // close loop cdbatch
983 
984         istart = iend;
985     }  // close loop over ab
986 
987     return P.nshell12_clip * Q.nshell12_clip;
988 }
989 
ostei_f_f_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__f_f_d_h)990 int ostei_f_f_d_h(struct simint_multi_shellpair const P,
991                   struct simint_multi_shellpair const Q,
992                   double screen_tol,
993                   double * const restrict work,
994                   double * const restrict INT__f_f_d_h)
995 {
996     double Q_AB[3*Q.nshell12];
997     struct simint_multi_shellpair Q_tmp = Q;
998     Q_tmp.PA_x = Q.PB_x;  Q_tmp.PA_y = Q.PB_y;  Q_tmp.PA_z = Q.PB_z;
999     Q_tmp.PB_x = Q.PA_x;  Q_tmp.PB_y = Q.PA_y;  Q_tmp.PB_z = Q.PA_z;
1000     Q_tmp.AB_x = Q_AB;
1001     Q_tmp.AB_y = Q_AB + Q.nshell12;
1002     Q_tmp.AB_z = Q_AB + 2*Q.nshell12;
1003 
1004     for(int i = 0; i < Q.nshell12; i++)
1005     {
1006         Q_tmp.AB_x[i] = -Q.AB_x[i];
1007         Q_tmp.AB_y[i] = -Q.AB_y[i];
1008         Q_tmp.AB_z[i] = -Q.AB_z[i];
1009     }
1010 
1011     int ret = ostei_f_f_h_d(P, Q_tmp, screen_tol, work, INT__f_f_d_h);
1012     double buffer[12600] SIMINT_ALIGN_ARRAY_DBL;
1013 
1014     for(int q = 0; q < ret; q++)
1015     {
1016         int idx = 0;
1017         for(int a = 0; a < 10; ++a)
1018         for(int b = 0; b < 10; ++b)
1019         for(int c = 0; c < 6; ++c)
1020         for(int d = 0; d < 21; ++d)
1021             buffer[idx++] = INT__f_f_d_h[q*12600+a*1260+b*126+d*6+c];
1022 
1023         memcpy(INT__f_f_d_h+q*12600, buffer, 12600*sizeof(double));
1024     }
1025 
1026     return ret;
1027 }
1028 
1029