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