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