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_i_p_i_h(struct simint_multi_shellpair const P,struct simint_multi_shellpair const Q,double screen_tol,double * const restrict work,double * const restrict INT__i_p_i_h)8 int ostei_i_p_i_h(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__i_p_i_h)
13 {
14 
15     SIMINT_ASSUME_ALIGN_DBL(work);
16     SIMINT_ASSUME_ALIGN_DBL(INT__i_p_i_h);
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__i_s_i_s = work + (SIMINT_NSHELL_SIMD * 0);
30     double * const INT__i_s_k_s = work + (SIMINT_NSHELL_SIMD * 784);
31     double * const INT__i_s_l_s = work + (SIMINT_NSHELL_SIMD * 1792);
32     double * const INT__i_s_m_s = work + (SIMINT_NSHELL_SIMD * 3052);
33     double * const INT__i_s_n_s = work + (SIMINT_NSHELL_SIMD * 4592);
34     double * const INT__i_s_o_s = work + (SIMINT_NSHELL_SIMD * 6440);
35     double * const INT__k_s_i_s = work + (SIMINT_NSHELL_SIMD * 8624);
36     double * const INT__k_s_k_s = work + (SIMINT_NSHELL_SIMD * 9632);
37     double * const INT__k_s_l_s = work + (SIMINT_NSHELL_SIMD * 10928);
38     double * const INT__k_s_m_s = work + (SIMINT_NSHELL_SIMD * 12548);
39     double * const INT__k_s_n_s = work + (SIMINT_NSHELL_SIMD * 14528);
40     double * const INT__k_s_o_s = work + (SIMINT_NSHELL_SIMD * 16904);
41     SIMINT_DBLTYPE * const primwork = (SIMINT_DBLTYPE *)(work + SIMINT_NSHELL_SIMD*19712);
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 + 19;
44     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_d_s = primwork + 73;
45     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_f_s = primwork + 175;
46     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_g_s = primwork + 335;
47     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_h_s = primwork + 560;
48     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_i_s = primwork + 854;
49     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_k_s = primwork + 1218;
50     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_l_s = primwork + 1650;
51     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_m_s = primwork + 2145;
52     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_n_s = primwork + 2695;
53     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_o_s = primwork + 3289;
54     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_s_s = primwork + 3913;
55     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_p_s = primwork + 3934;
56     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_d_s = primwork + 3997;
57     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_f_s = primwork + 4123;
58     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_g_s = primwork + 4333;
59     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_h_s = primwork + 4648;
60     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_i_s = primwork + 5089;
61     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_k_s = primwork + 5677;
62     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_l_s = primwork + 6433;
63     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_m_s = primwork + 7378;
64     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_n_s = primwork + 8533;
65     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_o_s = primwork + 9919;
66     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_p_s = primwork + 11557;
67     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_d_s = primwork + 11665;
68     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_f_s = primwork + 11881;
69     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_g_s = primwork + 12241;
70     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_h_s = primwork + 12781;
71     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_i_s = primwork + 13537;
72     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_k_s = primwork + 14545;
73     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_l_s = primwork + 15841;
74     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_m_s = primwork + 17461;
75     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_n_s = primwork + 19441;
76     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_o_s = primwork + 21817;
77     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_d_s = primwork + 24625;
78     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_f_s = primwork + 24925;
79     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_g_s = primwork + 25425;
80     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_h_s = primwork + 26175;
81     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_i_s = primwork + 27225;
82     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_k_s = primwork + 28625;
83     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_l_s = primwork + 30425;
84     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_m_s = primwork + 32675;
85     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_n_s = primwork + 35425;
86     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_o_s = primwork + 38725;
87     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_f_s = primwork + 42625;
88     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_g_s = primwork + 43225;
89     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_h_s = primwork + 44125;
90     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_i_s = primwork + 45385;
91     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_k_s = primwork + 47065;
92     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_l_s = primwork + 49225;
93     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_m_s = primwork + 51925;
94     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_n_s = primwork + 55225;
95     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_o_s = primwork + 59185;
96     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_g_s = primwork + 63865;
97     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_h_s = primwork + 64810;
98     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_i_s = primwork + 66133;
99     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_k_s = primwork + 67897;
100     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_l_s = primwork + 70165;
101     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_m_s = primwork + 73000;
102     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_n_s = primwork + 76465;
103     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_o_s = primwork + 80623;
104     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_h_s = primwork + 85537;
105     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_i_s = primwork + 86713;
106     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_k_s = primwork + 88281;
107     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_l_s = primwork + 90297;
108     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_m_s = primwork + 92817;
109     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_n_s = primwork + 95897;
110     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_o_s = primwork + 99593;
111     SIMINT_DBLTYPE * const restrict PRIM_INT__k_s_i_s = primwork + 103961;
112     SIMINT_DBLTYPE * const restrict PRIM_INT__k_s_k_s = primwork + 104969;
113     SIMINT_DBLTYPE * const restrict PRIM_INT__k_s_l_s = primwork + 106265;
114     SIMINT_DBLTYPE * const restrict PRIM_INT__k_s_m_s = primwork + 107885;
115     SIMINT_DBLTYPE * const restrict PRIM_INT__k_s_n_s = primwork + 109865;
116     SIMINT_DBLTYPE * const restrict PRIM_INT__k_s_o_s = primwork + 112241;
117     double * const hrrwork = (double *)(primwork + 115049);
118     double * const HRR_INT__i_p_i_s = hrrwork + 0;
119     double * const HRR_INT__i_p_i_p = hrrwork + 2352;
120     double * const HRR_INT__i_p_i_d = hrrwork + 9408;
121     double * const HRR_INT__i_p_i_f = hrrwork + 23520;
122     double * const HRR_INT__i_p_i_g = hrrwork + 47040;
123     double * const HRR_INT__i_p_k_s = hrrwork + 82320;
124     double * const HRR_INT__i_p_k_p = hrrwork + 85344;
125     double * const HRR_INT__i_p_k_d = hrrwork + 94416;
126     double * const HRR_INT__i_p_k_f = hrrwork + 112560;
127     double * const HRR_INT__i_p_k_g = hrrwork + 142800;
128     double * const HRR_INT__i_p_l_s = hrrwork + 188160;
129     double * const HRR_INT__i_p_l_p = hrrwork + 191940;
130     double * const HRR_INT__i_p_l_d = hrrwork + 203280;
131     double * const HRR_INT__i_p_l_f = hrrwork + 225960;
132     double * const HRR_INT__i_p_m_s = hrrwork + 263760;
133     double * const HRR_INT__i_p_m_p = hrrwork + 268380;
134     double * const HRR_INT__i_p_m_d = hrrwork + 282240;
135     double * const HRR_INT__i_p_n_s = hrrwork + 309960;
136     double * const HRR_INT__i_p_n_p = hrrwork + 315504;
137     double * const HRR_INT__i_p_o_s = hrrwork + 332136;
138 
139 
140     // Create constants
141     const SIMINT_DBLTYPE const_1 = SIMINT_DBLSET1(1);
142     const SIMINT_DBLTYPE const_10 = SIMINT_DBLSET1(10);
143     const SIMINT_DBLTYPE const_11 = SIMINT_DBLSET1(11);
144     const SIMINT_DBLTYPE const_2 = SIMINT_DBLSET1(2);
145     const SIMINT_DBLTYPE const_3 = SIMINT_DBLSET1(3);
146     const SIMINT_DBLTYPE const_4 = SIMINT_DBLSET1(4);
147     const SIMINT_DBLTYPE const_5 = SIMINT_DBLSET1(5);
148     const SIMINT_DBLTYPE const_6 = SIMINT_DBLSET1(6);
149     const SIMINT_DBLTYPE const_7 = SIMINT_DBLSET1(7);
150     const SIMINT_DBLTYPE const_8 = SIMINT_DBLSET1(8);
151     const SIMINT_DBLTYPE const_9 = SIMINT_DBLSET1(9);
152     const SIMINT_DBLTYPE one_half = SIMINT_DBLSET1(0.5);
153 
154 
155     ////////////////////////////////////////
156     // Loop over shells and primitives
157     ////////////////////////////////////////
158 
159     real_abcd = 0;
160     istart = 0;
161     for(ab = 0; ab < P.nshell12_clip; ++ab)
162     {
163         const int iend = istart + P.nprim12[ab];
164 
165         cd = 0;
166         jstart = 0;
167 
168         for(cd = 0; cd < Q.nshell12_clip; cd += SIMINT_NSHELL_SIMD)
169         {
170             const int nshellbatch = ((cd + SIMINT_NSHELL_SIMD) > Q.nshell12_clip) ? Q.nshell12_clip - cd : SIMINT_NSHELL_SIMD;
171             int jend = jstart;
172             for(i = 0; i < nshellbatch; i++)
173                 jend += Q.nprim12[cd+i];
174 
175             // Clear the beginning of the workspace (where we are accumulating integrals)
176             memset(work, 0, SIMINT_NSHELL_SIMD * 19712 * sizeof(double));
177             abcd = 0;
178 
179 
180             for(i = istart; i < iend; ++i)
181             {
182                 SIMINT_DBLTYPE bra_screen_max;  // only used if check_screen
183 
184                 if(check_screen)
185                 {
186                     // Skip this whole thing if always insignificant
187                     if((P.screen[i] * Q.screen_max) < screen_tol)
188                         continue;
189                     bra_screen_max = SIMINT_DBLSET1(P.screen[i]);
190                 }
191 
192                 icd = 0;
193                 iprimcd = 0;
194                 nprim_icd = Q.nprim12[cd];
195                 double * restrict PRIM_PTR_INT__i_s_i_s = INT__i_s_i_s + abcd * 784;
196                 double * restrict PRIM_PTR_INT__i_s_k_s = INT__i_s_k_s + abcd * 1008;
197                 double * restrict PRIM_PTR_INT__i_s_l_s = INT__i_s_l_s + abcd * 1260;
198                 double * restrict PRIM_PTR_INT__i_s_m_s = INT__i_s_m_s + abcd * 1540;
199                 double * restrict PRIM_PTR_INT__i_s_n_s = INT__i_s_n_s + abcd * 1848;
200                 double * restrict PRIM_PTR_INT__i_s_o_s = INT__i_s_o_s + abcd * 2184;
201                 double * restrict PRIM_PTR_INT__k_s_i_s = INT__k_s_i_s + abcd * 1008;
202                 double * restrict PRIM_PTR_INT__k_s_k_s = INT__k_s_k_s + abcd * 1296;
203                 double * restrict PRIM_PTR_INT__k_s_l_s = INT__k_s_l_s + abcd * 1620;
204                 double * restrict PRIM_PTR_INT__k_s_m_s = INT__k_s_m_s + abcd * 1980;
205                 double * restrict PRIM_PTR_INT__k_s_n_s = INT__k_s_n_s + abcd * 2376;
206                 double * restrict PRIM_PTR_INT__k_s_o_s = INT__k_s_o_s + abcd * 2808;
207 
208 
209 
210                 // Load these one per loop over i
211                 const SIMINT_DBLTYPE P_alpha = SIMINT_DBLSET1(P.alpha[i]);
212                 const SIMINT_DBLTYPE P_prefac = SIMINT_DBLSET1(P.prefac[i]);
213                 const SIMINT_DBLTYPE Pxyz[3] = { SIMINT_DBLSET1(P.x[i]), SIMINT_DBLSET1(P.y[i]), SIMINT_DBLSET1(P.z[i]) };
214 
215                 const SIMINT_DBLTYPE P_PA[3] = { SIMINT_DBLSET1(P.PA_x[i]), SIMINT_DBLSET1(P.PA_y[i]), SIMINT_DBLSET1(P.PA_z[i]) };
216 
217                 for(j = jstart; j < jend; j += SIMINT_SIMD_LEN)
218                 {
219                     // calculate the shell offsets
220                     // these are the offset from the shell pointed to by cd
221                     // for each element
222                     int shelloffsets[SIMINT_SIMD_LEN] = {0};
223                     int lastoffset = 0;
224                     const int nlane = ( ((j + SIMINT_SIMD_LEN) < jend) ? SIMINT_SIMD_LEN : (jend - j));
225 
226                     if((iprimcd + SIMINT_SIMD_LEN) >= nprim_icd)
227                     {
228                         // Handle if the first element of the vector is a new shell
229                         if(iprimcd >= nprim_icd && ((icd+1) < nshellbatch))
230                         {
231                             nprim_icd += Q.nprim12[cd + (++icd)];
232                             PRIM_PTR_INT__i_s_i_s += 784;
233                             PRIM_PTR_INT__i_s_k_s += 1008;
234                             PRIM_PTR_INT__i_s_l_s += 1260;
235                             PRIM_PTR_INT__i_s_m_s += 1540;
236                             PRIM_PTR_INT__i_s_n_s += 1848;
237                             PRIM_PTR_INT__i_s_o_s += 2184;
238                             PRIM_PTR_INT__k_s_i_s += 1008;
239                             PRIM_PTR_INT__k_s_k_s += 1296;
240                             PRIM_PTR_INT__k_s_l_s += 1620;
241                             PRIM_PTR_INT__k_s_m_s += 1980;
242                             PRIM_PTR_INT__k_s_n_s += 2376;
243                             PRIM_PTR_INT__k_s_o_s += 2808;
244                         }
245                         iprimcd++;
246                         for(n = 1; n < SIMINT_SIMD_LEN; ++n)
247                         {
248                             if(iprimcd >= nprim_icd && ((icd+1) < nshellbatch))
249                             {
250                                 shelloffsets[n] = shelloffsets[n-1] + 1;
251                                 lastoffset++;
252                                 nprim_icd += Q.nprim12[cd + (++icd)];
253                             }
254                             else
255                                 shelloffsets[n] = shelloffsets[n-1];
256                             iprimcd++;
257                         }
258                     }
259                     else
260                         iprimcd += SIMINT_SIMD_LEN;
261 
262                     // Do we have to compute this vector (or has it been screened out)?
263                     // (not_screened != 0 means we have to do this vector)
264                     if(check_screen)
265                     {
266                         const double vmax = vector_max(SIMINT_MUL(bra_screen_max, SIMINT_DBLLOAD(Q.screen, j)));
267                         if(vmax < screen_tol)
268                         {
269                             PRIM_PTR_INT__i_s_i_s += lastoffset*784;
270                             PRIM_PTR_INT__i_s_k_s += lastoffset*1008;
271                             PRIM_PTR_INT__i_s_l_s += lastoffset*1260;
272                             PRIM_PTR_INT__i_s_m_s += lastoffset*1540;
273                             PRIM_PTR_INT__i_s_n_s += lastoffset*1848;
274                             PRIM_PTR_INT__i_s_o_s += lastoffset*2184;
275                             PRIM_PTR_INT__k_s_i_s += lastoffset*1008;
276                             PRIM_PTR_INT__k_s_k_s += lastoffset*1296;
277                             PRIM_PTR_INT__k_s_l_s += lastoffset*1620;
278                             PRIM_PTR_INT__k_s_m_s += lastoffset*1980;
279                             PRIM_PTR_INT__k_s_n_s += lastoffset*2376;
280                             PRIM_PTR_INT__k_s_o_s += lastoffset*2808;
281                             continue;
282                         }
283                     }
284 
285                     const SIMINT_DBLTYPE Q_alpha = SIMINT_DBLLOAD(Q.alpha, j);
286                     const SIMINT_DBLTYPE PQalpha_mul = SIMINT_MUL(P_alpha, Q_alpha);
287                     const SIMINT_DBLTYPE PQalpha_sum = SIMINT_ADD(P_alpha, Q_alpha);
288                     const SIMINT_DBLTYPE one_over_PQalpha_sum = SIMINT_DIV(const_1, PQalpha_sum);
289 
290 
291                     /* construct R2 = (Px - Qx)**2 + (Py - Qy)**2 + (Pz -Qz)**2 */
292                     SIMINT_DBLTYPE PQ[3];
293                     PQ[0] = SIMINT_SUB(Pxyz[0], SIMINT_DBLLOAD(Q.x, j));
294                     PQ[1] = SIMINT_SUB(Pxyz[1], SIMINT_DBLLOAD(Q.y, j));
295                     PQ[2] = SIMINT_SUB(Pxyz[2], SIMINT_DBLLOAD(Q.z, j));
296                     SIMINT_DBLTYPE R2 = SIMINT_MUL(PQ[0], PQ[0]);
297                     R2 = SIMINT_FMADD(PQ[1], PQ[1], R2);
298                     R2 = SIMINT_FMADD(PQ[2], PQ[2], R2);
299 
300                     const SIMINT_DBLTYPE alpha = SIMINT_MUL(PQalpha_mul, one_over_PQalpha_sum); // alpha from MEST
301                     const SIMINT_DBLTYPE one_over_p = SIMINT_DIV(const_1, P_alpha);
302                     const SIMINT_DBLTYPE one_over_q = SIMINT_DIV(const_1, Q_alpha);
303                     const SIMINT_DBLTYPE one_over_2p = SIMINT_MUL(one_half, one_over_p);
304                     const SIMINT_DBLTYPE one_over_2q = SIMINT_MUL(one_half, one_over_q);
305                     const SIMINT_DBLTYPE one_over_2pq = SIMINT_MUL(one_half, one_over_PQalpha_sum);
306                     const SIMINT_DBLTYPE Q_PA[3] = { SIMINT_DBLLOAD(Q.PA_x, j), SIMINT_DBLLOAD(Q.PA_y, j), SIMINT_DBLLOAD(Q.PA_z, j) };
307 
308                     // NOTE: Minus sign!
309                     const SIMINT_DBLTYPE a_over_p = SIMINT_MUL(SIMINT_NEG(alpha), one_over_p);
310                     SIMINT_DBLTYPE aop_PQ[3];
311                     aop_PQ[0] = SIMINT_MUL(a_over_p, PQ[0]);
312                     aop_PQ[1] = SIMINT_MUL(a_over_p, PQ[1]);
313                     aop_PQ[2] = SIMINT_MUL(a_over_p, PQ[2]);
314 
315                     SIMINT_DBLTYPE a_over_q = SIMINT_MUL(alpha, one_over_q);
316                     SIMINT_DBLTYPE aoq_PQ[3];
317                     aoq_PQ[0] = SIMINT_MUL(a_over_q, PQ[0]);
318                     aoq_PQ[1] = SIMINT_MUL(a_over_q, PQ[1]);
319                     aoq_PQ[2] = SIMINT_MUL(a_over_q, PQ[2]);
320                     // Put a minus sign here so we don't have to in RR routines
321                     a_over_q = SIMINT_NEG(a_over_q);
322 
323 
324                     //////////////////////////////////////////////
325                     // Fjt function section
326                     // Maximum v value: 18
327                     //////////////////////////////////////////////
328                     // The parameter to the Fjt function
329                     const SIMINT_DBLTYPE F_x = SIMINT_MUL(R2, alpha);
330 
331 
332                     const SIMINT_DBLTYPE Q_prefac = mask_load(nlane, Q.prefac + j);
333 
334 
335                     boys_F_split(PRIM_INT__s_s_s_s, F_x, 18);
336                     SIMINT_DBLTYPE prefac = SIMINT_SQRT(one_over_PQalpha_sum);
337                     prefac = SIMINT_MUL(SIMINT_MUL(P_prefac, Q_prefac), prefac);
338                     for(n = 0; n <= 18; n++)
339                         PRIM_INT__s_s_s_s[n] = SIMINT_MUL(PRIM_INT__s_s_s_s[n], prefac);
340 
341                     //////////////////////////////////////////////
342                     // Primitive integrals: Vertical recurrance
343                     //////////////////////////////////////////////
344 
345                     const SIMINT_DBLTYPE vrr_const_1_over_2p = one_over_2p;
346                     const SIMINT_DBLTYPE vrr_const_2_over_2p = SIMINT_MUL(const_2, one_over_2p);
347                     const SIMINT_DBLTYPE vrr_const_3_over_2p = SIMINT_MUL(const_3, one_over_2p);
348                     const SIMINT_DBLTYPE vrr_const_4_over_2p = SIMINT_MUL(const_4, one_over_2p);
349                     const SIMINT_DBLTYPE vrr_const_5_over_2p = SIMINT_MUL(const_5, one_over_2p);
350                     const SIMINT_DBLTYPE vrr_const_6_over_2p = SIMINT_MUL(const_6, one_over_2p);
351                     const SIMINT_DBLTYPE vrr_const_1_over_2q = one_over_2q;
352                     const SIMINT_DBLTYPE vrr_const_2_over_2q = SIMINT_MUL(const_2, one_over_2q);
353                     const SIMINT_DBLTYPE vrr_const_3_over_2q = SIMINT_MUL(const_3, one_over_2q);
354                     const SIMINT_DBLTYPE vrr_const_4_over_2q = SIMINT_MUL(const_4, one_over_2q);
355                     const SIMINT_DBLTYPE vrr_const_5_over_2q = SIMINT_MUL(const_5, one_over_2q);
356                     const SIMINT_DBLTYPE vrr_const_6_over_2q = SIMINT_MUL(const_6, one_over_2q);
357                     const SIMINT_DBLTYPE vrr_const_7_over_2q = SIMINT_MUL(const_7, one_over_2q);
358                     const SIMINT_DBLTYPE vrr_const_8_over_2q = SIMINT_MUL(const_8, one_over_2q);
359                     const SIMINT_DBLTYPE vrr_const_9_over_2q = SIMINT_MUL(const_9, one_over_2q);
360                     const SIMINT_DBLTYPE vrr_const_10_over_2q = SIMINT_MUL(const_10, one_over_2q);
361                     const SIMINT_DBLTYPE vrr_const_1_over_2pq = one_over_2pq;
362                     const SIMINT_DBLTYPE vrr_const_2_over_2pq = SIMINT_MUL(const_2, one_over_2pq);
363                     const SIMINT_DBLTYPE vrr_const_3_over_2pq = SIMINT_MUL(const_3, one_over_2pq);
364                     const SIMINT_DBLTYPE vrr_const_4_over_2pq = SIMINT_MUL(const_4, one_over_2pq);
365                     const SIMINT_DBLTYPE vrr_const_5_over_2pq = SIMINT_MUL(const_5, one_over_2pq);
366                     const SIMINT_DBLTYPE vrr_const_6_over_2pq = SIMINT_MUL(const_6, one_over_2pq);
367                     const SIMINT_DBLTYPE vrr_const_7_over_2pq = SIMINT_MUL(const_7, one_over_2pq);
368                     const SIMINT_DBLTYPE vrr_const_8_over_2pq = SIMINT_MUL(const_8, one_over_2pq);
369                     const SIMINT_DBLTYPE vrr_const_9_over_2pq = SIMINT_MUL(const_9, one_over_2pq);
370                     const SIMINT_DBLTYPE vrr_const_10_over_2pq = SIMINT_MUL(const_10, one_over_2pq);
371                     const SIMINT_DBLTYPE vrr_const_11_over_2pq = SIMINT_MUL(const_11, one_over_2pq);
372 
373 
374 
375                     // Forming PRIM_INT__s_s_p_s[18 * 3];
376                     for(n = 0; n < 18; ++n)  // loop over orders of auxiliary function
377                     {
378 
379                         PRIM_INT__s_s_p_s[n * 3 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__s_s_s_s[n * 1 + 0]);
380                         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]);
381 
382                         PRIM_INT__s_s_p_s[n * 3 + 1] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_s_s[n * 1 + 0]);
383                         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]);
384 
385                         PRIM_INT__s_s_p_s[n * 3 + 2] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_s_s[n * 1 + 0]);
386                         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]);
387 
388                     }
389 
390 
391 
392                     // Forming PRIM_INT__s_s_d_s[17 * 6];
393                     for(n = 0; n < 17; ++n)  // loop over orders of auxiliary function
394                     {
395 
396                         PRIM_INT__s_s_d_s[n * 6 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__s_s_p_s[n * 3 + 0]);
397                         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]);
398                         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]);
399 
400                         PRIM_INT__s_s_d_s[n * 6 + 1] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_p_s[n * 3 + 0]);
401                         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]);
402 
403                         PRIM_INT__s_s_d_s[n * 6 + 2] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_p_s[n * 3 + 0]);
404                         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]);
405 
406                         PRIM_INT__s_s_d_s[n * 6 + 3] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_p_s[n * 3 + 1]);
407                         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]);
408                         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]);
409 
410                         PRIM_INT__s_s_d_s[n * 6 + 4] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_p_s[n * 3 + 1]);
411                         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]);
412 
413                         PRIM_INT__s_s_d_s[n * 6 + 5] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_p_s[n * 3 + 2]);
414                         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]);
415                         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]);
416 
417                     }
418 
419 
420 
421                     // Forming PRIM_INT__s_s_f_s[16 * 10];
422                     for(n = 0; n < 16; ++n)  // loop over orders of auxiliary function
423                     {
424 
425                         PRIM_INT__s_s_f_s[n * 10 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__s_s_d_s[n * 6 + 0]);
426                         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]);
427                         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]);
428 
429                         PRIM_INT__s_s_f_s[n * 10 + 1] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_d_s[n * 6 + 0]);
430                         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]);
431 
432                         PRIM_INT__s_s_f_s[n * 10 + 2] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_d_s[n * 6 + 0]);
433                         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]);
434 
435                         PRIM_INT__s_s_f_s[n * 10 + 3] = SIMINT_MUL(Q_PA[0], PRIM_INT__s_s_d_s[n * 6 + 3]);
436                         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]);
437 
438                         PRIM_INT__s_s_f_s[n * 10 + 4] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_d_s[n * 6 + 1]);
439                         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]);
440 
441                         PRIM_INT__s_s_f_s[n * 10 + 5] = SIMINT_MUL(Q_PA[0], PRIM_INT__s_s_d_s[n * 6 + 5]);
442                         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]);
443 
444                         PRIM_INT__s_s_f_s[n * 10 + 6] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_d_s[n * 6 + 3]);
445                         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]);
446                         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]);
447 
448                         PRIM_INT__s_s_f_s[n * 10 + 7] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_d_s[n * 6 + 3]);
449                         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]);
450 
451                         PRIM_INT__s_s_f_s[n * 10 + 8] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_d_s[n * 6 + 5]);
452                         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]);
453 
454                         PRIM_INT__s_s_f_s[n * 10 + 9] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_d_s[n * 6 + 5]);
455                         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]);
456                         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]);
457 
458                     }
459 
460 
461                     VRR_K_s_s_g_s(
462                             PRIM_INT__s_s_g_s,
463                             PRIM_INT__s_s_f_s,
464                             PRIM_INT__s_s_d_s,
465                             Q_PA,
466                             a_over_q,
467                             aoq_PQ,
468                             one_over_2q,
469                             15);
470 
471 
472                     VRR_K_s_s_h_s(
473                             PRIM_INT__s_s_h_s,
474                             PRIM_INT__s_s_g_s,
475                             PRIM_INT__s_s_f_s,
476                             Q_PA,
477                             a_over_q,
478                             aoq_PQ,
479                             one_over_2q,
480                             14);
481 
482 
483                     ostei_general_vrr1_K(6, 13,
484                             one_over_2q, a_over_q, aoq_PQ, Q_PA,
485                             PRIM_INT__s_s_h_s, PRIM_INT__s_s_g_s, PRIM_INT__s_s_i_s);
486 
487 
488                     ostei_general_vrr_I(1, 0, 6, 0, 7,
489                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
490                             PRIM_INT__s_s_i_s, NULL, NULL, PRIM_INT__s_s_h_s, NULL, PRIM_INT__p_s_i_s);
491 
492 
493                     ostei_general_vrr_I(1, 0, 5, 0, 7,
494                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
495                             PRIM_INT__s_s_h_s, NULL, NULL, PRIM_INT__s_s_g_s, NULL, PRIM_INT__p_s_h_s);
496 
497 
498                     ostei_general_vrr_I(2, 0, 6, 0, 6,
499                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
500                             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);
501 
502 
503                     VRR_I_p_s_g_s(
504                             PRIM_INT__p_s_g_s,
505                             PRIM_INT__s_s_g_s,
506                             PRIM_INT__s_s_f_s,
507                             P_PA,
508                             aop_PQ,
509                             one_over_2pq,
510                             7);
511 
512 
513                     ostei_general_vrr_I(2, 0, 5, 0, 6,
514                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
515                             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);
516 
517 
518                     ostei_general_vrr_I(3, 0, 6, 0, 5,
519                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
520                             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);
521 
522 
523                     VRR_I_p_s_f_s(
524                             PRIM_INT__p_s_f_s,
525                             PRIM_INT__s_s_f_s,
526                             PRIM_INT__s_s_d_s,
527                             P_PA,
528                             aop_PQ,
529                             one_over_2pq,
530                             7);
531 
532 
533                     ostei_general_vrr_I(2, 0, 4, 0, 6,
534                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
535                             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);
536 
537 
538                     ostei_general_vrr_I(3, 0, 5, 0, 5,
539                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
540                             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);
541 
542 
543                     ostei_general_vrr_I(4, 0, 6, 0, 4,
544                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
545                             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);
546 
547 
548 
549                     // Forming PRIM_INT__p_s_d_s[7 * 18];
550                     for(n = 0; n < 7; ++n)  // loop over orders of auxiliary function
551                     {
552 
553                         PRIM_INT__p_s_d_s[n * 18 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_d_s[n * 6 + 0]);
554                         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]);
555                         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]);
556 
557                         PRIM_INT__p_s_d_s[n * 18 + 1] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_d_s[n * 6 + 1]);
558                         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]);
559                         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]);
560 
561                         PRIM_INT__p_s_d_s[n * 18 + 2] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_d_s[n * 6 + 2]);
562                         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]);
563                         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]);
564 
565                         PRIM_INT__p_s_d_s[n * 18 + 3] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_d_s[n * 6 + 3]);
566                         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]);
567 
568                         PRIM_INT__p_s_d_s[n * 18 + 4] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_d_s[n * 6 + 4]);
569                         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]);
570 
571                         PRIM_INT__p_s_d_s[n * 18 + 5] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_d_s[n * 6 + 5]);
572                         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]);
573 
574                         PRIM_INT__p_s_d_s[n * 18 + 6] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_d_s[n * 6 + 0]);
575                         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]);
576 
577                         PRIM_INT__p_s_d_s[n * 18 + 7] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_d_s[n * 6 + 1]);
578                         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]);
579                         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]);
580 
581                         PRIM_INT__p_s_d_s[n * 18 + 8] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_d_s[n * 6 + 2]);
582                         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]);
583 
584                         PRIM_INT__p_s_d_s[n * 18 + 9] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_d_s[n * 6 + 3]);
585                         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]);
586                         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]);
587 
588                         PRIM_INT__p_s_d_s[n * 18 + 10] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_d_s[n * 6 + 4]);
589                         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]);
590                         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]);
591 
592                         PRIM_INT__p_s_d_s[n * 18 + 11] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_d_s[n * 6 + 5]);
593                         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]);
594 
595                         PRIM_INT__p_s_d_s[n * 18 + 12] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_d_s[n * 6 + 0]);
596                         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]);
597 
598                         PRIM_INT__p_s_d_s[n * 18 + 13] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_d_s[n * 6 + 1]);
599                         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]);
600 
601                         PRIM_INT__p_s_d_s[n * 18 + 14] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_d_s[n * 6 + 2]);
602                         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]);
603                         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]);
604 
605                         PRIM_INT__p_s_d_s[n * 18 + 15] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_d_s[n * 6 + 3]);
606                         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]);
607 
608                         PRIM_INT__p_s_d_s[n * 18 + 16] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_d_s[n * 6 + 4]);
609                         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]);
610                         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]);
611 
612                         PRIM_INT__p_s_d_s[n * 18 + 17] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_d_s[n * 6 + 5]);
613                         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]);
614                         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]);
615 
616                     }
617 
618 
619                     VRR_I_d_s_f_s(
620                             PRIM_INT__d_s_f_s,
621                             PRIM_INT__p_s_f_s,
622                             PRIM_INT__s_s_f_s,
623                             PRIM_INT__p_s_d_s,
624                             P_PA,
625                             a_over_p,
626                             aop_PQ,
627                             one_over_2p,
628                             one_over_2pq,
629                             6);
630 
631 
632                     ostei_general_vrr_I(3, 0, 4, 0, 5,
633                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
634                             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);
635 
636 
637                     ostei_general_vrr_I(4, 0, 5, 0, 4,
638                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
639                             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);
640 
641 
642                     ostei_general_vrr_I(5, 0, 6, 0, 3,
643                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
644                             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);
645 
646 
647 
648                     // Forming PRIM_INT__p_s_p_s[7 * 9];
649                     for(n = 0; n < 7; ++n)  // loop over orders of auxiliary function
650                     {
651 
652                         PRIM_INT__p_s_p_s[n * 9 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_p_s[n * 3 + 0]);
653                         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]);
654                         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]);
655 
656                         PRIM_INT__p_s_p_s[n * 9 + 1] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_p_s[n * 3 + 1]);
657                         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]);
658 
659                         PRIM_INT__p_s_p_s[n * 9 + 2] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_p_s[n * 3 + 2]);
660                         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]);
661 
662                         PRIM_INT__p_s_p_s[n * 9 + 3] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_p_s[n * 3 + 0]);
663                         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]);
664 
665                         PRIM_INT__p_s_p_s[n * 9 + 4] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_p_s[n * 3 + 1]);
666                         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]);
667                         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]);
668 
669                         PRIM_INT__p_s_p_s[n * 9 + 5] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_p_s[n * 3 + 2]);
670                         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]);
671 
672                         PRIM_INT__p_s_p_s[n * 9 + 6] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_p_s[n * 3 + 0]);
673                         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]);
674 
675                         PRIM_INT__p_s_p_s[n * 9 + 7] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_p_s[n * 3 + 1]);
676                         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]);
677 
678                         PRIM_INT__p_s_p_s[n * 9 + 8] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_p_s[n * 3 + 2]);
679                         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]);
680                         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]);
681 
682                     }
683 
684 
685                     VRR_I_d_s_d_s(
686                             PRIM_INT__d_s_d_s,
687                             PRIM_INT__p_s_d_s,
688                             PRIM_INT__s_s_d_s,
689                             PRIM_INT__p_s_p_s,
690                             P_PA,
691                             a_over_p,
692                             aop_PQ,
693                             one_over_2p,
694                             one_over_2pq,
695                             6);
696 
697 
698                     ostei_general_vrr_I(3, 0, 3, 0, 5,
699                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
700                             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);
701 
702 
703                     ostei_general_vrr_I(4, 0, 4, 0, 4,
704                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
705                             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);
706 
707 
708                     ostei_general_vrr_I(5, 0, 5, 0, 3,
709                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
710                             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);
711 
712 
713                     ostei_general_vrr_I(6, 0, 6, 0, 2,
714                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
715                             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);
716 
717 
718                     ostei_general_vrr1_K(7, 12,
719                             one_over_2q, a_over_q, aoq_PQ, Q_PA,
720                             PRIM_INT__s_s_i_s, PRIM_INT__s_s_h_s, PRIM_INT__s_s_k_s);
721 
722 
723                     ostei_general_vrr_I(1, 0, 7, 0, 7,
724                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
725                             PRIM_INT__s_s_k_s, NULL, NULL, PRIM_INT__s_s_i_s, NULL, PRIM_INT__p_s_k_s);
726 
727 
728                     ostei_general_vrr_I(2, 0, 7, 0, 6,
729                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
730                             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);
731 
732 
733                     ostei_general_vrr_I(3, 0, 7, 0, 5,
734                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
735                             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);
736 
737 
738                     ostei_general_vrr_I(4, 0, 7, 0, 4,
739                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
740                             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);
741 
742 
743                     ostei_general_vrr_I(5, 0, 7, 0, 3,
744                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
745                             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);
746 
747 
748                     ostei_general_vrr_I(6, 0, 7, 0, 2,
749                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
750                             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);
751 
752 
753 
754                     // Forming PRIM_INT__p_s_s_s[7 * 3];
755                     for(n = 0; n < 7; ++n)  // loop over orders of auxiliary function
756                     {
757 
758                         PRIM_INT__p_s_s_s[n * 3 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_s_s[n * 1 + 0]);
759                         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]);
760 
761                         PRIM_INT__p_s_s_s[n * 3 + 1] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_s_s[n * 1 + 0]);
762                         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]);
763 
764                         PRIM_INT__p_s_s_s[n * 3 + 2] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_s_s[n * 1 + 0]);
765                         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]);
766 
767                     }
768 
769 
770 
771                     // Forming PRIM_INT__d_s_p_s[6 * 18];
772                     for(n = 0; n < 6; ++n)  // loop over orders of auxiliary function
773                     {
774 
775                         PRIM_INT__d_s_p_s[n * 18 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__p_s_p_s[n * 9 + 0]);
776                         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]);
777                         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]);
778                         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]);
779 
780                         PRIM_INT__d_s_p_s[n * 18 + 1] = SIMINT_MUL(P_PA[0], PRIM_INT__p_s_p_s[n * 9 + 1]);
781                         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]);
782                         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]);
783 
784                         PRIM_INT__d_s_p_s[n * 18 + 2] = SIMINT_MUL(P_PA[0], PRIM_INT__p_s_p_s[n * 9 + 2]);
785                         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]);
786                         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]);
787 
788                         PRIM_INT__d_s_p_s[n * 18 + 9] = SIMINT_MUL(P_PA[1], PRIM_INT__p_s_p_s[n * 9 + 3]);
789                         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]);
790                         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]);
791 
792                         PRIM_INT__d_s_p_s[n * 18 + 10] = SIMINT_MUL(P_PA[1], PRIM_INT__p_s_p_s[n * 9 + 4]);
793                         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]);
794                         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]);
795                         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]);
796 
797                         PRIM_INT__d_s_p_s[n * 18 + 11] = SIMINT_MUL(P_PA[1], PRIM_INT__p_s_p_s[n * 9 + 5]);
798                         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]);
799                         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]);
800 
801                         PRIM_INT__d_s_p_s[n * 18 + 15] = SIMINT_MUL(P_PA[2], PRIM_INT__p_s_p_s[n * 9 + 6]);
802                         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]);
803                         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]);
804 
805                         PRIM_INT__d_s_p_s[n * 18 + 16] = SIMINT_MUL(P_PA[2], PRIM_INT__p_s_p_s[n * 9 + 7]);
806                         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]);
807                         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]);
808 
809                         PRIM_INT__d_s_p_s[n * 18 + 17] = SIMINT_MUL(P_PA[2], PRIM_INT__p_s_p_s[n * 9 + 8]);
810                         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]);
811                         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]);
812                         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]);
813 
814                     }
815 
816 
817                     VRR_I_f_s_d_s(
818                             PRIM_INT__f_s_d_s,
819                             PRIM_INT__d_s_d_s,
820                             PRIM_INT__p_s_d_s,
821                             PRIM_INT__d_s_p_s,
822                             P_PA,
823                             a_over_p,
824                             aop_PQ,
825                             one_over_2p,
826                             one_over_2pq,
827                             5);
828 
829 
830                     ostei_general_vrr_I(4, 0, 3, 0, 4,
831                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
832                             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);
833 
834 
835                     ostei_general_vrr_I(5, 0, 4, 0, 3,
836                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
837                             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);
838 
839 
840                     ostei_general_vrr_I(6, 0, 5, 0, 2,
841                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
842                             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);
843 
844 
845                     ostei_general_vrr_I(7, 0, 6, 0, 1,
846                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
847                             PRIM_INT__i_s_i_s, PRIM_INT__h_s_i_s, NULL, PRIM_INT__i_s_h_s, NULL, PRIM_INT__k_s_i_s);
848 
849 
850                     ostei_general_vrr1_K(8, 11,
851                             one_over_2q, a_over_q, aoq_PQ, Q_PA,
852                             PRIM_INT__s_s_k_s, PRIM_INT__s_s_i_s, PRIM_INT__s_s_l_s);
853 
854 
855                     ostei_general_vrr_I(1, 0, 8, 0, 7,
856                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
857                             PRIM_INT__s_s_l_s, NULL, NULL, PRIM_INT__s_s_k_s, NULL, PRIM_INT__p_s_l_s);
858 
859 
860                     ostei_general_vrr_I(2, 0, 8, 0, 6,
861                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
862                             PRIM_INT__p_s_l_s, PRIM_INT__s_s_l_s, NULL, PRIM_INT__p_s_k_s, NULL, PRIM_INT__d_s_l_s);
863 
864 
865                     ostei_general_vrr_I(3, 0, 8, 0, 5,
866                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
867                             PRIM_INT__d_s_l_s, PRIM_INT__p_s_l_s, NULL, PRIM_INT__d_s_k_s, NULL, PRIM_INT__f_s_l_s);
868 
869 
870                     ostei_general_vrr_I(4, 0, 8, 0, 4,
871                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
872                             PRIM_INT__f_s_l_s, PRIM_INT__d_s_l_s, NULL, PRIM_INT__f_s_k_s, NULL, PRIM_INT__g_s_l_s);
873 
874 
875                     ostei_general_vrr_I(5, 0, 8, 0, 3,
876                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
877                             PRIM_INT__g_s_l_s, PRIM_INT__f_s_l_s, NULL, PRIM_INT__g_s_k_s, NULL, PRIM_INT__h_s_l_s);
878 
879 
880                     ostei_general_vrr_I(6, 0, 8, 0, 2,
881                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
882                             PRIM_INT__h_s_l_s, PRIM_INT__g_s_l_s, NULL, PRIM_INT__h_s_k_s, NULL, PRIM_INT__i_s_l_s);
883 
884 
885                     ostei_general_vrr_I(7, 0, 7, 0, 1,
886                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
887                             PRIM_INT__i_s_k_s, PRIM_INT__h_s_k_s, NULL, PRIM_INT__i_s_i_s, NULL, PRIM_INT__k_s_k_s);
888 
889 
890                     ostei_general_vrr1_K(9, 10,
891                             one_over_2q, a_over_q, aoq_PQ, Q_PA,
892                             PRIM_INT__s_s_l_s, PRIM_INT__s_s_k_s, PRIM_INT__s_s_m_s);
893 
894 
895                     ostei_general_vrr_I(1, 0, 9, 0, 7,
896                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
897                             PRIM_INT__s_s_m_s, NULL, NULL, PRIM_INT__s_s_l_s, NULL, PRIM_INT__p_s_m_s);
898 
899 
900                     ostei_general_vrr_I(2, 0, 9, 0, 6,
901                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
902                             PRIM_INT__p_s_m_s, PRIM_INT__s_s_m_s, NULL, PRIM_INT__p_s_l_s, NULL, PRIM_INT__d_s_m_s);
903 
904 
905                     ostei_general_vrr_I(3, 0, 9, 0, 5,
906                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
907                             PRIM_INT__d_s_m_s, PRIM_INT__p_s_m_s, NULL, PRIM_INT__d_s_l_s, NULL, PRIM_INT__f_s_m_s);
908 
909 
910                     ostei_general_vrr_I(4, 0, 9, 0, 4,
911                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
912                             PRIM_INT__f_s_m_s, PRIM_INT__d_s_m_s, NULL, PRIM_INT__f_s_l_s, NULL, PRIM_INT__g_s_m_s);
913 
914 
915                     ostei_general_vrr_I(5, 0, 9, 0, 3,
916                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
917                             PRIM_INT__g_s_m_s, PRIM_INT__f_s_m_s, NULL, PRIM_INT__g_s_l_s, NULL, PRIM_INT__h_s_m_s);
918 
919 
920                     ostei_general_vrr_I(6, 0, 9, 0, 2,
921                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
922                             PRIM_INT__h_s_m_s, PRIM_INT__g_s_m_s, NULL, PRIM_INT__h_s_l_s, NULL, PRIM_INT__i_s_m_s);
923 
924 
925                     ostei_general_vrr_I(7, 0, 8, 0, 1,
926                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
927                             PRIM_INT__i_s_l_s, PRIM_INT__h_s_l_s, NULL, PRIM_INT__i_s_k_s, NULL, PRIM_INT__k_s_l_s);
928 
929 
930                     ostei_general_vrr1_K(10, 9,
931                             one_over_2q, a_over_q, aoq_PQ, Q_PA,
932                             PRIM_INT__s_s_m_s, PRIM_INT__s_s_l_s, PRIM_INT__s_s_n_s);
933 
934 
935                     ostei_general_vrr_I(1, 0, 10, 0, 7,
936                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
937                             PRIM_INT__s_s_n_s, NULL, NULL, PRIM_INT__s_s_m_s, NULL, PRIM_INT__p_s_n_s);
938 
939 
940                     ostei_general_vrr_I(2, 0, 10, 0, 6,
941                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
942                             PRIM_INT__p_s_n_s, PRIM_INT__s_s_n_s, NULL, PRIM_INT__p_s_m_s, NULL, PRIM_INT__d_s_n_s);
943 
944 
945                     ostei_general_vrr_I(3, 0, 10, 0, 5,
946                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
947                             PRIM_INT__d_s_n_s, PRIM_INT__p_s_n_s, NULL, PRIM_INT__d_s_m_s, NULL, PRIM_INT__f_s_n_s);
948 
949 
950                     ostei_general_vrr_I(4, 0, 10, 0, 4,
951                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
952                             PRIM_INT__f_s_n_s, PRIM_INT__d_s_n_s, NULL, PRIM_INT__f_s_m_s, NULL, PRIM_INT__g_s_n_s);
953 
954 
955                     ostei_general_vrr_I(5, 0, 10, 0, 3,
956                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
957                             PRIM_INT__g_s_n_s, PRIM_INT__f_s_n_s, NULL, PRIM_INT__g_s_m_s, NULL, PRIM_INT__h_s_n_s);
958 
959 
960                     ostei_general_vrr_I(6, 0, 10, 0, 2,
961                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
962                             PRIM_INT__h_s_n_s, PRIM_INT__g_s_n_s, NULL, PRIM_INT__h_s_m_s, NULL, PRIM_INT__i_s_n_s);
963 
964 
965                     ostei_general_vrr_I(7, 0, 9, 0, 1,
966                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
967                             PRIM_INT__i_s_m_s, PRIM_INT__h_s_m_s, NULL, PRIM_INT__i_s_l_s, NULL, PRIM_INT__k_s_m_s);
968 
969 
970                     ostei_general_vrr1_K(11, 8,
971                             one_over_2q, a_over_q, aoq_PQ, Q_PA,
972                             PRIM_INT__s_s_n_s, PRIM_INT__s_s_m_s, PRIM_INT__s_s_o_s);
973 
974 
975                     ostei_general_vrr_I(1, 0, 11, 0, 7,
976                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
977                             PRIM_INT__s_s_o_s, NULL, NULL, PRIM_INT__s_s_n_s, NULL, PRIM_INT__p_s_o_s);
978 
979 
980                     ostei_general_vrr_I(2, 0, 11, 0, 6,
981                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
982                             PRIM_INT__p_s_o_s, PRIM_INT__s_s_o_s, NULL, PRIM_INT__p_s_n_s, NULL, PRIM_INT__d_s_o_s);
983 
984 
985                     ostei_general_vrr_I(3, 0, 11, 0, 5,
986                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
987                             PRIM_INT__d_s_o_s, PRIM_INT__p_s_o_s, NULL, PRIM_INT__d_s_n_s, NULL, PRIM_INT__f_s_o_s);
988 
989 
990                     ostei_general_vrr_I(4, 0, 11, 0, 4,
991                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
992                             PRIM_INT__f_s_o_s, PRIM_INT__d_s_o_s, NULL, PRIM_INT__f_s_n_s, NULL, PRIM_INT__g_s_o_s);
993 
994 
995                     ostei_general_vrr_I(5, 0, 11, 0, 3,
996                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
997                             PRIM_INT__g_s_o_s, PRIM_INT__f_s_o_s, NULL, PRIM_INT__g_s_n_s, NULL, PRIM_INT__h_s_o_s);
998 
999 
1000                     ostei_general_vrr_I(6, 0, 11, 0, 2,
1001                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
1002                             PRIM_INT__h_s_o_s, PRIM_INT__g_s_o_s, NULL, PRIM_INT__h_s_n_s, NULL, PRIM_INT__i_s_o_s);
1003 
1004 
1005                     ostei_general_vrr_I(7, 0, 10, 0, 1,
1006                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
1007                             PRIM_INT__i_s_n_s, PRIM_INT__h_s_n_s, NULL, PRIM_INT__i_s_m_s, NULL, PRIM_INT__k_s_n_s);
1008 
1009 
1010                     ostei_general_vrr_I(7, 0, 11, 0, 1,
1011                             one_over_2p, a_over_p, one_over_2pq, aop_PQ, P_PA,
1012                             PRIM_INT__i_s_o_s, PRIM_INT__h_s_o_s, NULL, PRIM_INT__i_s_n_s, NULL, PRIM_INT__k_s_o_s);
1013 
1014 
1015 
1016 
1017                     ////////////////////////////////////
1018                     // Accumulate contracted integrals
1019                     ////////////////////////////////////
1020                     if(lastoffset == 0)
1021                     {
1022                         contract_all(784, PRIM_INT__i_s_i_s, PRIM_PTR_INT__i_s_i_s);
1023                         contract_all(1008, PRIM_INT__i_s_k_s, PRIM_PTR_INT__i_s_k_s);
1024                         contract_all(1260, PRIM_INT__i_s_l_s, PRIM_PTR_INT__i_s_l_s);
1025                         contract_all(1540, PRIM_INT__i_s_m_s, PRIM_PTR_INT__i_s_m_s);
1026                         contract_all(1848, PRIM_INT__i_s_n_s, PRIM_PTR_INT__i_s_n_s);
1027                         contract_all(2184, PRIM_INT__i_s_o_s, PRIM_PTR_INT__i_s_o_s);
1028                         contract_all(1008, PRIM_INT__k_s_i_s, PRIM_PTR_INT__k_s_i_s);
1029                         contract_all(1296, PRIM_INT__k_s_k_s, PRIM_PTR_INT__k_s_k_s);
1030                         contract_all(1620, PRIM_INT__k_s_l_s, PRIM_PTR_INT__k_s_l_s);
1031                         contract_all(1980, PRIM_INT__k_s_m_s, PRIM_PTR_INT__k_s_m_s);
1032                         contract_all(2376, PRIM_INT__k_s_n_s, PRIM_PTR_INT__k_s_n_s);
1033                         contract_all(2808, PRIM_INT__k_s_o_s, PRIM_PTR_INT__k_s_o_s);
1034                     }
1035                     else
1036                     {
1037                         contract(784, shelloffsets, PRIM_INT__i_s_i_s, PRIM_PTR_INT__i_s_i_s);
1038                         contract(1008, shelloffsets, PRIM_INT__i_s_k_s, PRIM_PTR_INT__i_s_k_s);
1039                         contract(1260, shelloffsets, PRIM_INT__i_s_l_s, PRIM_PTR_INT__i_s_l_s);
1040                         contract(1540, shelloffsets, PRIM_INT__i_s_m_s, PRIM_PTR_INT__i_s_m_s);
1041                         contract(1848, shelloffsets, PRIM_INT__i_s_n_s, PRIM_PTR_INT__i_s_n_s);
1042                         contract(2184, shelloffsets, PRIM_INT__i_s_o_s, PRIM_PTR_INT__i_s_o_s);
1043                         contract(1008, shelloffsets, PRIM_INT__k_s_i_s, PRIM_PTR_INT__k_s_i_s);
1044                         contract(1296, shelloffsets, PRIM_INT__k_s_k_s, PRIM_PTR_INT__k_s_k_s);
1045                         contract(1620, shelloffsets, PRIM_INT__k_s_l_s, PRIM_PTR_INT__k_s_l_s);
1046                         contract(1980, shelloffsets, PRIM_INT__k_s_m_s, PRIM_PTR_INT__k_s_m_s);
1047                         contract(2376, shelloffsets, PRIM_INT__k_s_n_s, PRIM_PTR_INT__k_s_n_s);
1048                         contract(2808, shelloffsets, PRIM_INT__k_s_o_s, PRIM_PTR_INT__k_s_o_s);
1049                         PRIM_PTR_INT__i_s_i_s += lastoffset*784;
1050                         PRIM_PTR_INT__i_s_k_s += lastoffset*1008;
1051                         PRIM_PTR_INT__i_s_l_s += lastoffset*1260;
1052                         PRIM_PTR_INT__i_s_m_s += lastoffset*1540;
1053                         PRIM_PTR_INT__i_s_n_s += lastoffset*1848;
1054                         PRIM_PTR_INT__i_s_o_s += lastoffset*2184;
1055                         PRIM_PTR_INT__k_s_i_s += lastoffset*1008;
1056                         PRIM_PTR_INT__k_s_k_s += lastoffset*1296;
1057                         PRIM_PTR_INT__k_s_l_s += lastoffset*1620;
1058                         PRIM_PTR_INT__k_s_m_s += lastoffset*1980;
1059                         PRIM_PTR_INT__k_s_n_s += lastoffset*2376;
1060                         PRIM_PTR_INT__k_s_o_s += lastoffset*2808;
1061                     }
1062 
1063                 }  // close loop over j
1064             }  // close loop over i
1065 
1066             //Advance to the next batch
1067             jstart = SIMINT_SIMD_ROUND(jend);
1068 
1069             //////////////////////////////////////////////
1070             // Contracted integrals: Horizontal recurrance
1071             //////////////////////////////////////////////
1072 
1073 
1074             const double hAB[3] = { P.AB_x[ab], P.AB_y[ab], P.AB_z[ab] };
1075 
1076 
1077             for(abcd = 0; abcd < nshellbatch; ++abcd, ++real_abcd)
1078             {
1079                 const double hCD[3] = { Q.AB_x[cd+abcd], Q.AB_y[cd+abcd], Q.AB_z[cd+abcd] };
1080 
1081                 // set up HRR pointers
1082                 double const * restrict HRR_INT__i_s_i_s = INT__i_s_i_s + abcd * 784;
1083                 double const * restrict HRR_INT__i_s_k_s = INT__i_s_k_s + abcd * 1008;
1084                 double const * restrict HRR_INT__i_s_l_s = INT__i_s_l_s + abcd * 1260;
1085                 double const * restrict HRR_INT__i_s_m_s = INT__i_s_m_s + abcd * 1540;
1086                 double const * restrict HRR_INT__i_s_n_s = INT__i_s_n_s + abcd * 1848;
1087                 double const * restrict HRR_INT__i_s_o_s = INT__i_s_o_s + abcd * 2184;
1088                 double const * restrict HRR_INT__k_s_i_s = INT__k_s_i_s + abcd * 1008;
1089                 double const * restrict HRR_INT__k_s_k_s = INT__k_s_k_s + abcd * 1296;
1090                 double const * restrict HRR_INT__k_s_l_s = INT__k_s_l_s + abcd * 1620;
1091                 double const * restrict HRR_INT__k_s_m_s = INT__k_s_m_s + abcd * 1980;
1092                 double const * restrict HRR_INT__k_s_n_s = INT__k_s_n_s + abcd * 2376;
1093                 double const * restrict HRR_INT__k_s_o_s = INT__k_s_o_s + abcd * 2808;
1094                 double * restrict HRR_INT__i_p_i_h = INT__i_p_i_h + real_abcd * 49392;
1095 
1096                 // form INT__i_p_i_s
1097                 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);
1098 
1099                 // form INT__i_p_k_s
1100                 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);
1101 
1102                 // form INT__i_p_l_s
1103                 ostei_general_hrr_J(6, 1, 8, 0, hAB, HRR_INT__k_s_l_s, HRR_INT__i_s_l_s, HRR_INT__i_p_l_s);
1104 
1105                 // form INT__i_p_m_s
1106                 ostei_general_hrr_J(6, 1, 9, 0, hAB, HRR_INT__k_s_m_s, HRR_INT__i_s_m_s, HRR_INT__i_p_m_s);
1107 
1108                 // form INT__i_p_n_s
1109                 ostei_general_hrr_J(6, 1, 10, 0, hAB, HRR_INT__k_s_n_s, HRR_INT__i_s_n_s, HRR_INT__i_p_n_s);
1110 
1111                 // form INT__i_p_o_s
1112                 ostei_general_hrr_J(6, 1, 11, 0, hAB, HRR_INT__k_s_o_s, HRR_INT__i_s_o_s, HRR_INT__i_p_o_s);
1113 
1114                 // form INT__i_p_i_p
1115                 ostei_general_hrr_L(6, 1, 6, 1, hCD, HRR_INT__i_p_k_s, HRR_INT__i_p_i_s, HRR_INT__i_p_i_p);
1116 
1117                 // form INT__i_p_k_p
1118                 ostei_general_hrr_L(6, 1, 7, 1, hCD, HRR_INT__i_p_l_s, HRR_INT__i_p_k_s, HRR_INT__i_p_k_p);
1119 
1120                 // form INT__i_p_l_p
1121                 ostei_general_hrr_L(6, 1, 8, 1, hCD, HRR_INT__i_p_m_s, HRR_INT__i_p_l_s, HRR_INT__i_p_l_p);
1122 
1123                 // form INT__i_p_m_p
1124                 ostei_general_hrr_L(6, 1, 9, 1, hCD, HRR_INT__i_p_n_s, HRR_INT__i_p_m_s, HRR_INT__i_p_m_p);
1125 
1126                 // form INT__i_p_n_p
1127                 ostei_general_hrr_L(6, 1, 10, 1, hCD, HRR_INT__i_p_o_s, HRR_INT__i_p_n_s, HRR_INT__i_p_n_p);
1128 
1129                 // form INT__i_p_i_d
1130                 ostei_general_hrr_L(6, 1, 6, 2, hCD, HRR_INT__i_p_k_p, HRR_INT__i_p_i_p, HRR_INT__i_p_i_d);
1131 
1132                 // form INT__i_p_k_d
1133                 ostei_general_hrr_L(6, 1, 7, 2, hCD, HRR_INT__i_p_l_p, HRR_INT__i_p_k_p, HRR_INT__i_p_k_d);
1134 
1135                 // form INT__i_p_l_d
1136                 ostei_general_hrr_L(6, 1, 8, 2, hCD, HRR_INT__i_p_m_p, HRR_INT__i_p_l_p, HRR_INT__i_p_l_d);
1137 
1138                 // form INT__i_p_m_d
1139                 ostei_general_hrr_L(6, 1, 9, 2, hCD, HRR_INT__i_p_n_p, HRR_INT__i_p_m_p, HRR_INT__i_p_m_d);
1140 
1141                 // form INT__i_p_i_f
1142                 ostei_general_hrr_L(6, 1, 6, 3, hCD, HRR_INT__i_p_k_d, HRR_INT__i_p_i_d, HRR_INT__i_p_i_f);
1143 
1144                 // form INT__i_p_k_f
1145                 ostei_general_hrr_L(6, 1, 7, 3, hCD, HRR_INT__i_p_l_d, HRR_INT__i_p_k_d, HRR_INT__i_p_k_f);
1146 
1147                 // form INT__i_p_l_f
1148                 ostei_general_hrr_L(6, 1, 8, 3, hCD, HRR_INT__i_p_m_d, HRR_INT__i_p_l_d, HRR_INT__i_p_l_f);
1149 
1150                 // form INT__i_p_i_g
1151                 ostei_general_hrr_L(6, 1, 6, 4, hCD, HRR_INT__i_p_k_f, HRR_INT__i_p_i_f, HRR_INT__i_p_i_g);
1152 
1153                 // form INT__i_p_k_g
1154                 ostei_general_hrr_L(6, 1, 7, 4, hCD, HRR_INT__i_p_l_f, HRR_INT__i_p_k_f, HRR_INT__i_p_k_g);
1155 
1156                 // form INT__i_p_i_h
1157                 ostei_general_hrr_L(6, 1, 6, 5, hCD, HRR_INT__i_p_k_g, HRR_INT__i_p_i_g, HRR_INT__i_p_i_h);
1158 
1159 
1160             }  // close HRR loop
1161 
1162 
1163         }   // close loop cdbatch
1164 
1165         istart = iend;
1166     }  // close loop over ab
1167 
1168     return P.nshell12_clip * Q.nshell12_clip;
1169 }
1170 
ostei_p_i_i_h(struct simint_multi_shellpair const P,struct simint_multi_shellpair const Q,double screen_tol,double * const restrict work,double * const restrict INT__p_i_i_h)1171 int ostei_p_i_i_h(struct simint_multi_shellpair const P,
1172                   struct simint_multi_shellpair const Q,
1173                   double screen_tol,
1174                   double * const restrict work,
1175                   double * const restrict INT__p_i_i_h)
1176 {
1177     double P_AB[3*P.nshell12];
1178     struct simint_multi_shellpair P_tmp = P;
1179     P_tmp.PA_x = P.PB_x;  P_tmp.PA_y = P.PB_y;  P_tmp.PA_z = P.PB_z;
1180     P_tmp.PB_x = P.PA_x;  P_tmp.PB_y = P.PA_y;  P_tmp.PB_z = P.PA_z;
1181     P_tmp.AB_x = P_AB;
1182     P_tmp.AB_y = P_AB + P.nshell12;
1183     P_tmp.AB_z = P_AB + 2*P.nshell12;
1184 
1185     for(int i = 0; i < P.nshell12; i++)
1186     {
1187         P_tmp.AB_x[i] = -P.AB_x[i];
1188         P_tmp.AB_y[i] = -P.AB_y[i];
1189         P_tmp.AB_z[i] = -P.AB_z[i];
1190     }
1191 
1192     int ret = ostei_i_p_i_h(P_tmp, Q, screen_tol, work, INT__p_i_i_h);
1193     double buffer[49392] SIMINT_ALIGN_ARRAY_DBL;
1194 
1195     for(int q = 0; q < ret; q++)
1196     {
1197         int idx = 0;
1198         for(int a = 0; a < 3; ++a)
1199         for(int b = 0; b < 28; ++b)
1200         for(int c = 0; c < 28; ++c)
1201         for(int d = 0; d < 21; ++d)
1202             buffer[idx++] = INT__p_i_i_h[q*49392+b*1764+a*588+c*21+d];
1203 
1204         memcpy(INT__p_i_i_h+q*49392, buffer, 49392*sizeof(double));
1205     }
1206 
1207     return ret;
1208 }
1209 
ostei_i_p_h_i(struct simint_multi_shellpair const P,struct simint_multi_shellpair const Q,double screen_tol,double * const restrict work,double * const restrict INT__i_p_h_i)1210 int ostei_i_p_h_i(struct simint_multi_shellpair const P,
1211                   struct simint_multi_shellpair const Q,
1212                   double screen_tol,
1213                   double * const restrict work,
1214                   double * const restrict INT__i_p_h_i)
1215 {
1216     double Q_AB[3*Q.nshell12];
1217     struct simint_multi_shellpair Q_tmp = Q;
1218     Q_tmp.PA_x = Q.PB_x;  Q_tmp.PA_y = Q.PB_y;  Q_tmp.PA_z = Q.PB_z;
1219     Q_tmp.PB_x = Q.PA_x;  Q_tmp.PB_y = Q.PA_y;  Q_tmp.PB_z = Q.PA_z;
1220     Q_tmp.AB_x = Q_AB;
1221     Q_tmp.AB_y = Q_AB + Q.nshell12;
1222     Q_tmp.AB_z = Q_AB + 2*Q.nshell12;
1223 
1224     for(int i = 0; i < Q.nshell12; i++)
1225     {
1226         Q_tmp.AB_x[i] = -Q.AB_x[i];
1227         Q_tmp.AB_y[i] = -Q.AB_y[i];
1228         Q_tmp.AB_z[i] = -Q.AB_z[i];
1229     }
1230 
1231     int ret = ostei_i_p_i_h(P, Q_tmp, screen_tol, work, INT__i_p_h_i);
1232     double buffer[49392] SIMINT_ALIGN_ARRAY_DBL;
1233 
1234     for(int q = 0; q < ret; q++)
1235     {
1236         int idx = 0;
1237         for(int a = 0; a < 28; ++a)
1238         for(int b = 0; b < 3; ++b)
1239         for(int c = 0; c < 21; ++c)
1240         for(int d = 0; d < 28; ++d)
1241             buffer[idx++] = INT__i_p_h_i[q*49392+a*1764+b*588+d*21+c];
1242 
1243         memcpy(INT__i_p_h_i+q*49392, buffer, 49392*sizeof(double));
1244     }
1245 
1246     return ret;
1247 }
1248 
ostei_p_i_h_i(struct simint_multi_shellpair const P,struct simint_multi_shellpair const Q,double screen_tol,double * const restrict work,double * const restrict INT__p_i_h_i)1249 int ostei_p_i_h_i(struct simint_multi_shellpair const P,
1250                   struct simint_multi_shellpair const Q,
1251                   double screen_tol,
1252                   double * const restrict work,
1253                   double * const restrict INT__p_i_h_i)
1254 {
1255     double P_AB[3*P.nshell12];
1256     struct simint_multi_shellpair P_tmp = P;
1257     P_tmp.PA_x = P.PB_x;  P_tmp.PA_y = P.PB_y;  P_tmp.PA_z = P.PB_z;
1258     P_tmp.PB_x = P.PA_x;  P_tmp.PB_y = P.PA_y;  P_tmp.PB_z = P.PA_z;
1259     P_tmp.AB_x = P_AB;
1260     P_tmp.AB_y = P_AB + P.nshell12;
1261     P_tmp.AB_z = P_AB + 2*P.nshell12;
1262 
1263     for(int i = 0; i < P.nshell12; i++)
1264     {
1265         P_tmp.AB_x[i] = -P.AB_x[i];
1266         P_tmp.AB_y[i] = -P.AB_y[i];
1267         P_tmp.AB_z[i] = -P.AB_z[i];
1268     }
1269 
1270     double Q_AB[3*Q.nshell12];
1271     struct simint_multi_shellpair Q_tmp = Q;
1272     Q_tmp.PA_x = Q.PB_x;  Q_tmp.PA_y = Q.PB_y;  Q_tmp.PA_z = Q.PB_z;
1273     Q_tmp.PB_x = Q.PA_x;  Q_tmp.PB_y = Q.PA_y;  Q_tmp.PB_z = Q.PA_z;
1274     Q_tmp.AB_x = Q_AB;
1275     Q_tmp.AB_y = Q_AB + Q.nshell12;
1276     Q_tmp.AB_z = Q_AB + 2*Q.nshell12;
1277 
1278     for(int i = 0; i < Q.nshell12; i++)
1279     {
1280         Q_tmp.AB_x[i] = -Q.AB_x[i];
1281         Q_tmp.AB_y[i] = -Q.AB_y[i];
1282         Q_tmp.AB_z[i] = -Q.AB_z[i];
1283     }
1284 
1285     int ret = ostei_i_p_i_h(P_tmp, Q_tmp, screen_tol, work, INT__p_i_h_i);
1286     double buffer[49392] SIMINT_ALIGN_ARRAY_DBL;
1287 
1288     for(int q = 0; q < ret; q++)
1289     {
1290         int idx = 0;
1291         for(int a = 0; a < 3; ++a)
1292         for(int b = 0; b < 28; ++b)
1293         for(int c = 0; c < 21; ++c)
1294         for(int d = 0; d < 28; ++d)
1295             buffer[idx++] = INT__p_i_h_i[q*49392+b*1764+a*588+d*21+c];
1296 
1297         memcpy(INT__p_i_h_i+q*49392, buffer, 49392*sizeof(double));
1298     }
1299 
1300     return ret;
1301 }
1302 
1303