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