1 #include "simint/boys/boys.h"
2 #include "simint/ostei/gen/ostei_generated.h"
3 #include "simint/vectorization/vectorization.h"
4 #include <math.h>
5 #include <string.h>
6 
7 
ostei_g_d_f_d(struct simint_multi_shellpair const P,struct simint_multi_shellpair const Q,double screen_tol,double * const restrict work,double * const restrict INT__g_d_f_d)8 int ostei_g_d_f_d(struct simint_multi_shellpair const P,
9                   struct simint_multi_shellpair const Q,
10                   double screen_tol,
11                   double * const restrict work,
12                   double * const restrict INT__g_d_f_d)
13 {
14 
15     SIMINT_ASSUME_ALIGN_DBL(work);
16     SIMINT_ASSUME_ALIGN_DBL(INT__g_d_f_d);
17     int ab, cd, abcd;
18     int istart, jstart;
19     int iprimcd, nprim_icd, icd;
20     const int check_screen = (screen_tol > 0.0);
21     int i, j;
22     int n;
23     int not_screened;
24     int real_abcd;
25     int iket;
26     int ibra;
27 
28     // partition workspace
29     double * const INT__g_s_f_s = work + (SIMINT_NSHELL_SIMD * 0);
30     double * const INT__g_s_g_s = work + (SIMINT_NSHELL_SIMD * 150);
31     double * const INT__g_s_h_s = work + (SIMINT_NSHELL_SIMD * 375);
32     double * const INT__h_s_f_s = work + (SIMINT_NSHELL_SIMD * 690);
33     double * const INT__h_s_g_s = work + (SIMINT_NSHELL_SIMD * 900);
34     double * const INT__h_s_h_s = work + (SIMINT_NSHELL_SIMD * 1215);
35     double * const INT__i_s_f_s = work + (SIMINT_NSHELL_SIMD * 1656);
36     double * const INT__i_s_g_s = work + (SIMINT_NSHELL_SIMD * 1936);
37     double * const INT__i_s_h_s = work + (SIMINT_NSHELL_SIMD * 2356);
38     SIMINT_DBLTYPE * const primwork = (SIMINT_DBLTYPE *)(work + SIMINT_NSHELL_SIMD*2944);
39     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_s_s = primwork + 0;
40     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_p_s = primwork + 12;
41     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_s_s = primwork + 27;
42     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_p_s = primwork + 60;
43     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_d_s = primwork + 105;
44     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_s_s = primwork + 177;
45     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_p_s = primwork + 237;
46     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_d_s = primwork + 327;
47     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_f_s = primwork + 471;
48     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_s_s = primwork + 651;
49     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_p_s = primwork + 741;
50     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_d_s = primwork + 891;
51     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_f_s = primwork + 1131;
52     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_g_s = primwork + 1431;
53     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_s_s = primwork + 1731;
54     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_p_s = primwork + 1851;
55     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_d_s = primwork + 2076;
56     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_f_s = primwork + 2436;
57     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_g_s = primwork + 2886;
58     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_h_s = primwork + 3336;
59     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_s_s = primwork + 3651;
60     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_p_s = primwork + 3798;
61     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_d_s = primwork + 4113;
62     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_f_s = primwork + 4617;
63     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_g_s = primwork + 5247;
64     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_h_s = primwork + 5877;
65     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_s_s = primwork + 6318;
66     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_p_s = primwork + 6486;
67     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_d_s = primwork + 6906;
68     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_f_s = primwork + 7578;
69     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_g_s = primwork + 8418;
70     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_h_s = primwork + 9258;
71     double * const hrrwork = (double *)(primwork + 9846);
72     double * const HRR_INT__g_p_f_s = hrrwork + 0;
73     double * const HRR_INT__g_p_g_s = hrrwork + 450;
74     double * const HRR_INT__g_p_h_s = hrrwork + 1125;
75     double * const HRR_INT__g_d_f_s = hrrwork + 2070;
76     double * const HRR_INT__g_d_f_p = hrrwork + 2970;
77     double * const HRR_INT__g_d_g_s = hrrwork + 5670;
78     double * const HRR_INT__g_d_g_p = hrrwork + 7020;
79     double * const HRR_INT__g_d_h_s = hrrwork + 11070;
80     double * const HRR_INT__h_p_f_s = hrrwork + 12960;
81     double * const HRR_INT__h_p_g_s = hrrwork + 13590;
82     double * const HRR_INT__h_p_h_s = hrrwork + 14535;
83 
84 
85     // Create constants
86     const SIMINT_DBLTYPE const_1 = SIMINT_DBLSET1(1);
87     const SIMINT_DBLTYPE const_2 = SIMINT_DBLSET1(2);
88     const SIMINT_DBLTYPE const_3 = SIMINT_DBLSET1(3);
89     const SIMINT_DBLTYPE const_4 = SIMINT_DBLSET1(4);
90     const SIMINT_DBLTYPE const_5 = SIMINT_DBLSET1(5);
91     const SIMINT_DBLTYPE const_6 = SIMINT_DBLSET1(6);
92     const SIMINT_DBLTYPE one_half = SIMINT_DBLSET1(0.5);
93 
94 
95     ////////////////////////////////////////
96     // Loop over shells and primitives
97     ////////////////////////////////////////
98 
99     real_abcd = 0;
100     istart = 0;
101     for(ab = 0; ab < P.nshell12_clip; ++ab)
102     {
103         const int iend = istart + P.nprim12[ab];
104 
105         cd = 0;
106         jstart = 0;
107 
108         for(cd = 0; cd < Q.nshell12_clip; cd += SIMINT_NSHELL_SIMD)
109         {
110             const int nshellbatch = ((cd + SIMINT_NSHELL_SIMD) > Q.nshell12_clip) ? Q.nshell12_clip - cd : SIMINT_NSHELL_SIMD;
111             int jend = jstart;
112             for(i = 0; i < nshellbatch; i++)
113                 jend += Q.nprim12[cd+i];
114 
115             // Clear the beginning of the workspace (where we are accumulating integrals)
116             memset(work, 0, SIMINT_NSHELL_SIMD * 2944 * sizeof(double));
117             abcd = 0;
118 
119 
120             for(i = istart; i < iend; ++i)
121             {
122                 SIMINT_DBLTYPE bra_screen_max;  // only used if check_screen
123 
124                 if(check_screen)
125                 {
126                     // Skip this whole thing if always insignificant
127                     if((P.screen[i] * Q.screen_max) < screen_tol)
128                         continue;
129                     bra_screen_max = SIMINT_DBLSET1(P.screen[i]);
130                 }
131 
132                 icd = 0;
133                 iprimcd = 0;
134                 nprim_icd = Q.nprim12[cd];
135                 double * restrict PRIM_PTR_INT__g_s_f_s = INT__g_s_f_s + abcd * 150;
136                 double * restrict PRIM_PTR_INT__g_s_g_s = INT__g_s_g_s + abcd * 225;
137                 double * restrict PRIM_PTR_INT__g_s_h_s = INT__g_s_h_s + abcd * 315;
138                 double * restrict PRIM_PTR_INT__h_s_f_s = INT__h_s_f_s + abcd * 210;
139                 double * restrict PRIM_PTR_INT__h_s_g_s = INT__h_s_g_s + abcd * 315;
140                 double * restrict PRIM_PTR_INT__h_s_h_s = INT__h_s_h_s + abcd * 441;
141                 double * restrict PRIM_PTR_INT__i_s_f_s = INT__i_s_f_s + abcd * 280;
142                 double * restrict PRIM_PTR_INT__i_s_g_s = INT__i_s_g_s + abcd * 420;
143                 double * restrict PRIM_PTR_INT__i_s_h_s = INT__i_s_h_s + abcd * 588;
144 
145 
146 
147                 // Load these one per loop over i
148                 const SIMINT_DBLTYPE P_alpha = SIMINT_DBLSET1(P.alpha[i]);
149                 const SIMINT_DBLTYPE P_prefac = SIMINT_DBLSET1(P.prefac[i]);
150                 const SIMINT_DBLTYPE Pxyz[3] = { SIMINT_DBLSET1(P.x[i]), SIMINT_DBLSET1(P.y[i]), SIMINT_DBLSET1(P.z[i]) };
151 
152                 const SIMINT_DBLTYPE P_PA[3] = { SIMINT_DBLSET1(P.PA_x[i]), SIMINT_DBLSET1(P.PA_y[i]), SIMINT_DBLSET1(P.PA_z[i]) };
153 
154                 for(j = jstart; j < jend; j += SIMINT_SIMD_LEN)
155                 {
156                     // calculate the shell offsets
157                     // these are the offset from the shell pointed to by cd
158                     // for each element
159                     int shelloffsets[SIMINT_SIMD_LEN] = {0};
160                     int lastoffset = 0;
161                     const int nlane = ( ((j + SIMINT_SIMD_LEN) < jend) ? SIMINT_SIMD_LEN : (jend - j));
162 
163                     if((iprimcd + SIMINT_SIMD_LEN) >= nprim_icd)
164                     {
165                         // Handle if the first element of the vector is a new shell
166                         if(iprimcd >= nprim_icd && ((icd+1) < nshellbatch))
167                         {
168                             nprim_icd += Q.nprim12[cd + (++icd)];
169                             PRIM_PTR_INT__g_s_f_s += 150;
170                             PRIM_PTR_INT__g_s_g_s += 225;
171                             PRIM_PTR_INT__g_s_h_s += 315;
172                             PRIM_PTR_INT__h_s_f_s += 210;
173                             PRIM_PTR_INT__h_s_g_s += 315;
174                             PRIM_PTR_INT__h_s_h_s += 441;
175                             PRIM_PTR_INT__i_s_f_s += 280;
176                             PRIM_PTR_INT__i_s_g_s += 420;
177                             PRIM_PTR_INT__i_s_h_s += 588;
178                         }
179                         iprimcd++;
180                         for(n = 1; n < SIMINT_SIMD_LEN; ++n)
181                         {
182                             if(iprimcd >= nprim_icd && ((icd+1) < nshellbatch))
183                             {
184                                 shelloffsets[n] = shelloffsets[n-1] + 1;
185                                 lastoffset++;
186                                 nprim_icd += Q.nprim12[cd + (++icd)];
187                             }
188                             else
189                                 shelloffsets[n] = shelloffsets[n-1];
190                             iprimcd++;
191                         }
192                     }
193                     else
194                         iprimcd += SIMINT_SIMD_LEN;
195 
196                     // Do we have to compute this vector (or has it been screened out)?
197                     // (not_screened != 0 means we have to do this vector)
198                     if(check_screen)
199                     {
200                         const double vmax = vector_max(SIMINT_MUL(bra_screen_max, SIMINT_DBLLOAD(Q.screen, j)));
201                         if(vmax < screen_tol)
202                         {
203                             PRIM_PTR_INT__g_s_f_s += lastoffset*150;
204                             PRIM_PTR_INT__g_s_g_s += lastoffset*225;
205                             PRIM_PTR_INT__g_s_h_s += lastoffset*315;
206                             PRIM_PTR_INT__h_s_f_s += lastoffset*210;
207                             PRIM_PTR_INT__h_s_g_s += lastoffset*315;
208                             PRIM_PTR_INT__h_s_h_s += lastoffset*441;
209                             PRIM_PTR_INT__i_s_f_s += lastoffset*280;
210                             PRIM_PTR_INT__i_s_g_s += lastoffset*420;
211                             PRIM_PTR_INT__i_s_h_s += lastoffset*588;
212                             continue;
213                         }
214                     }
215 
216                     const SIMINT_DBLTYPE Q_alpha = SIMINT_DBLLOAD(Q.alpha, j);
217                     const SIMINT_DBLTYPE PQalpha_mul = SIMINT_MUL(P_alpha, Q_alpha);
218                     const SIMINT_DBLTYPE PQalpha_sum = SIMINT_ADD(P_alpha, Q_alpha);
219                     const SIMINT_DBLTYPE one_over_PQalpha_sum = SIMINT_DIV(const_1, PQalpha_sum);
220 
221 
222                     /* construct R2 = (Px - Qx)**2 + (Py - Qy)**2 + (Pz -Qz)**2 */
223                     SIMINT_DBLTYPE PQ[3];
224                     PQ[0] = SIMINT_SUB(Pxyz[0], SIMINT_DBLLOAD(Q.x, j));
225                     PQ[1] = SIMINT_SUB(Pxyz[1], SIMINT_DBLLOAD(Q.y, j));
226                     PQ[2] = SIMINT_SUB(Pxyz[2], SIMINT_DBLLOAD(Q.z, j));
227                     SIMINT_DBLTYPE R2 = SIMINT_MUL(PQ[0], PQ[0]);
228                     R2 = SIMINT_FMADD(PQ[1], PQ[1], R2);
229                     R2 = SIMINT_FMADD(PQ[2], PQ[2], R2);
230 
231                     const SIMINT_DBLTYPE alpha = SIMINT_MUL(PQalpha_mul, one_over_PQalpha_sum); // alpha from MEST
232                     const SIMINT_DBLTYPE one_over_p = SIMINT_DIV(const_1, P_alpha);
233                     const SIMINT_DBLTYPE one_over_q = SIMINT_DIV(const_1, Q_alpha);
234                     const SIMINT_DBLTYPE one_over_2p = SIMINT_MUL(one_half, one_over_p);
235                     const SIMINT_DBLTYPE one_over_2q = SIMINT_MUL(one_half, one_over_q);
236                     const SIMINT_DBLTYPE one_over_2pq = SIMINT_MUL(one_half, one_over_PQalpha_sum);
237                     const SIMINT_DBLTYPE Q_PA[3] = { SIMINT_DBLLOAD(Q.PA_x, j), SIMINT_DBLLOAD(Q.PA_y, j), SIMINT_DBLLOAD(Q.PA_z, j) };
238 
239                     // NOTE: Minus sign!
240                     const SIMINT_DBLTYPE a_over_p = SIMINT_MUL(SIMINT_NEG(alpha), one_over_p);
241                     SIMINT_DBLTYPE aop_PQ[3];
242                     aop_PQ[0] = SIMINT_MUL(a_over_p, PQ[0]);
243                     aop_PQ[1] = SIMINT_MUL(a_over_p, PQ[1]);
244                     aop_PQ[2] = SIMINT_MUL(a_over_p, PQ[2]);
245 
246                     SIMINT_DBLTYPE a_over_q = SIMINT_MUL(alpha, one_over_q);
247                     SIMINT_DBLTYPE aoq_PQ[3];
248                     aoq_PQ[0] = SIMINT_MUL(a_over_q, PQ[0]);
249                     aoq_PQ[1] = SIMINT_MUL(a_over_q, PQ[1]);
250                     aoq_PQ[2] = SIMINT_MUL(a_over_q, PQ[2]);
251                     // Put a minus sign here so we don't have to in RR routines
252                     a_over_q = SIMINT_NEG(a_over_q);
253 
254 
255                     //////////////////////////////////////////////
256                     // Fjt function section
257                     // Maximum v value: 11
258                     //////////////////////////////////////////////
259                     // The parameter to the Fjt function
260                     const SIMINT_DBLTYPE F_x = SIMINT_MUL(R2, alpha);
261 
262 
263                     const SIMINT_DBLTYPE Q_prefac = mask_load(nlane, Q.prefac + j);
264 
265 
266                     boys_F_split(PRIM_INT__s_s_s_s, F_x, 11);
267                     SIMINT_DBLTYPE prefac = SIMINT_SQRT(one_over_PQalpha_sum);
268                     prefac = SIMINT_MUL(SIMINT_MUL(P_prefac, Q_prefac), prefac);
269                     for(n = 0; n <= 11; n++)
270                         PRIM_INT__s_s_s_s[n] = SIMINT_MUL(PRIM_INT__s_s_s_s[n], prefac);
271 
272                     //////////////////////////////////////////////
273                     // Primitive integrals: Vertical recurrance
274                     //////////////////////////////////////////////
275 
276                     const SIMINT_DBLTYPE vrr_const_1_over_2p = one_over_2p;
277                     const SIMINT_DBLTYPE vrr_const_2_over_2p = SIMINT_MUL(const_2, one_over_2p);
278                     const SIMINT_DBLTYPE vrr_const_3_over_2p = SIMINT_MUL(const_3, one_over_2p);
279                     const SIMINT_DBLTYPE vrr_const_4_over_2p = SIMINT_MUL(const_4, one_over_2p);
280                     const SIMINT_DBLTYPE vrr_const_5_over_2p = SIMINT_MUL(const_5, one_over_2p);
281                     const SIMINT_DBLTYPE vrr_const_1_over_2q = one_over_2q;
282                     const SIMINT_DBLTYPE vrr_const_2_over_2q = SIMINT_MUL(const_2, one_over_2q);
283                     const SIMINT_DBLTYPE vrr_const_3_over_2q = SIMINT_MUL(const_3, one_over_2q);
284                     const SIMINT_DBLTYPE vrr_const_4_over_2q = SIMINT_MUL(const_4, one_over_2q);
285                     const SIMINT_DBLTYPE vrr_const_1_over_2pq = one_over_2pq;
286                     const SIMINT_DBLTYPE vrr_const_2_over_2pq = SIMINT_MUL(const_2, one_over_2pq);
287                     const SIMINT_DBLTYPE vrr_const_3_over_2pq = SIMINT_MUL(const_3, one_over_2pq);
288                     const SIMINT_DBLTYPE vrr_const_4_over_2pq = SIMINT_MUL(const_4, one_over_2pq);
289                     const SIMINT_DBLTYPE vrr_const_5_over_2pq = SIMINT_MUL(const_5, one_over_2pq);
290                     const SIMINT_DBLTYPE vrr_const_6_over_2pq = SIMINT_MUL(const_6, one_over_2pq);
291 
292 
293 
294                     // Forming PRIM_INT__p_s_s_s[11 * 3];
295                     for(n = 0; n < 11; ++n)  // loop over orders of auxiliary function
296                     {
297 
298                         PRIM_INT__p_s_s_s[n * 3 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_s_s[n * 1 + 0]);
299                         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]);
300 
301                         PRIM_INT__p_s_s_s[n * 3 + 1] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_s_s[n * 1 + 0]);
302                         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]);
303 
304                         PRIM_INT__p_s_s_s[n * 3 + 2] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_s_s[n * 1 + 0]);
305                         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]);
306 
307                     }
308 
309 
310 
311                     // Forming PRIM_INT__d_s_s_s[10 * 6];
312                     for(n = 0; n < 10; ++n)  // loop over orders of auxiliary function
313                     {
314 
315                         PRIM_INT__d_s_s_s[n * 6 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__p_s_s_s[n * 3 + 0]);
316                         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]);
317                         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]);
318 
319                         PRIM_INT__d_s_s_s[n * 6 + 1] = SIMINT_MUL(P_PA[1], PRIM_INT__p_s_s_s[n * 3 + 0]);
320                         PRIM_INT__d_s_s_s[n * 6 + 1] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__d_s_s_s[n * 6 + 1]);
321 
322                         PRIM_INT__d_s_s_s[n * 6 + 2] = SIMINT_MUL(P_PA[2], PRIM_INT__p_s_s_s[n * 3 + 0]);
323                         PRIM_INT__d_s_s_s[n * 6 + 2] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__d_s_s_s[n * 6 + 2]);
324 
325                         PRIM_INT__d_s_s_s[n * 6 + 3] = SIMINT_MUL(P_PA[1], PRIM_INT__p_s_s_s[n * 3 + 1]);
326                         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]);
327                         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]);
328 
329                         PRIM_INT__d_s_s_s[n * 6 + 4] = SIMINT_MUL(P_PA[2], PRIM_INT__p_s_s_s[n * 3 + 1]);
330                         PRIM_INT__d_s_s_s[n * 6 + 4] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__d_s_s_s[n * 6 + 4]);
331 
332                         PRIM_INT__d_s_s_s[n * 6 + 5] = SIMINT_MUL(P_PA[2], PRIM_INT__p_s_s_s[n * 3 + 2]);
333                         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]);
334                         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]);
335 
336                     }
337 
338 
339 
340                     // Forming PRIM_INT__f_s_s_s[9 * 10];
341                     for(n = 0; n < 9; ++n)  // loop over orders of auxiliary function
342                     {
343 
344                         PRIM_INT__f_s_s_s[n * 10 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__d_s_s_s[n * 6 + 0]);
345                         PRIM_INT__f_s_s_s[n * 10 + 0] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__d_s_s_s[(n+1) * 6 + 0], PRIM_INT__f_s_s_s[n * 10 + 0]);
346                         PRIM_INT__f_s_s_s[n * 10 + 0] = SIMINT_FMADD( vrr_const_2_over_2p, SIMINT_FMADD(a_over_p, PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__p_s_s_s[n * 3 + 0]), PRIM_INT__f_s_s_s[n * 10 + 0]);
347 
348                         PRIM_INT__f_s_s_s[n * 10 + 1] = SIMINT_MUL(P_PA[1], PRIM_INT__d_s_s_s[n * 6 + 0]);
349                         PRIM_INT__f_s_s_s[n * 10 + 1] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__d_s_s_s[(n+1) * 6 + 0], PRIM_INT__f_s_s_s[n * 10 + 1]);
350 
351                         PRIM_INT__f_s_s_s[n * 10 + 2] = SIMINT_MUL(P_PA[2], PRIM_INT__d_s_s_s[n * 6 + 0]);
352                         PRIM_INT__f_s_s_s[n * 10 + 2] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 0], PRIM_INT__f_s_s_s[n * 10 + 2]);
353 
354                         PRIM_INT__f_s_s_s[n * 10 + 3] = SIMINT_MUL(P_PA[0], PRIM_INT__d_s_s_s[n * 6 + 3]);
355                         PRIM_INT__f_s_s_s[n * 10 + 3] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__d_s_s_s[(n+1) * 6 + 3], PRIM_INT__f_s_s_s[n * 10 + 3]);
356 
357                         PRIM_INT__f_s_s_s[n * 10 + 4] = SIMINT_MUL(P_PA[2], PRIM_INT__d_s_s_s[n * 6 + 1]);
358                         PRIM_INT__f_s_s_s[n * 10 + 4] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 1], PRIM_INT__f_s_s_s[n * 10 + 4]);
359 
360                         PRIM_INT__f_s_s_s[n * 10 + 5] = SIMINT_MUL(P_PA[0], PRIM_INT__d_s_s_s[n * 6 + 5]);
361                         PRIM_INT__f_s_s_s[n * 10 + 5] = SIMINT_FMADD( aop_PQ[0], PRIM_INT__d_s_s_s[(n+1) * 6 + 5], PRIM_INT__f_s_s_s[n * 10 + 5]);
362 
363                         PRIM_INT__f_s_s_s[n * 10 + 6] = SIMINT_MUL(P_PA[1], PRIM_INT__d_s_s_s[n * 6 + 3]);
364                         PRIM_INT__f_s_s_s[n * 10 + 6] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__d_s_s_s[(n+1) * 6 + 3], PRIM_INT__f_s_s_s[n * 10 + 6]);
365                         PRIM_INT__f_s_s_s[n * 10 + 6] = SIMINT_FMADD( vrr_const_2_over_2p, SIMINT_FMADD(a_over_p, PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__p_s_s_s[n * 3 + 1]), PRIM_INT__f_s_s_s[n * 10 + 6]);
366 
367                         PRIM_INT__f_s_s_s[n * 10 + 7] = SIMINT_MUL(P_PA[2], PRIM_INT__d_s_s_s[n * 6 + 3]);
368                         PRIM_INT__f_s_s_s[n * 10 + 7] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 3], PRIM_INT__f_s_s_s[n * 10 + 7]);
369 
370                         PRIM_INT__f_s_s_s[n * 10 + 8] = SIMINT_MUL(P_PA[1], PRIM_INT__d_s_s_s[n * 6 + 5]);
371                         PRIM_INT__f_s_s_s[n * 10 + 8] = SIMINT_FMADD( aop_PQ[1], PRIM_INT__d_s_s_s[(n+1) * 6 + 5], PRIM_INT__f_s_s_s[n * 10 + 8]);
372 
373                         PRIM_INT__f_s_s_s[n * 10 + 9] = SIMINT_MUL(P_PA[2], PRIM_INT__d_s_s_s[n * 6 + 5]);
374                         PRIM_INT__f_s_s_s[n * 10 + 9] = SIMINT_FMADD( aop_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 5], PRIM_INT__f_s_s_s[n * 10 + 9]);
375                         PRIM_INT__f_s_s_s[n * 10 + 9] = SIMINT_FMADD( vrr_const_2_over_2p, SIMINT_FMADD(a_over_p, PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__p_s_s_s[n * 3 + 2]), PRIM_INT__f_s_s_s[n * 10 + 9]);
376 
377                     }
378 
379 
380                     VRR_I_g_s_s_s(
381                             PRIM_INT__g_s_s_s,
382                             PRIM_INT__f_s_s_s,
383                             PRIM_INT__d_s_s_s,
384                             P_PA,
385                             a_over_p,
386                             aop_PQ,
387                             one_over_2p,
388                             8);
389 
390 
391                     VRR_K_g_s_p_s(
392                             PRIM_INT__g_s_p_s,
393                             PRIM_INT__g_s_s_s,
394                             PRIM_INT__f_s_s_s,
395                             Q_PA,
396                             aoq_PQ,
397                             one_over_2pq,
398                             5);
399 
400 
401                     VRR_K_f_s_p_s(
402                             PRIM_INT__f_s_p_s,
403                             PRIM_INT__f_s_s_s,
404                             PRIM_INT__d_s_s_s,
405                             Q_PA,
406                             aoq_PQ,
407                             one_over_2pq,
408                             5);
409 
410 
411                     ostei_general_vrr_K(4, 0, 2, 0, 4,
412                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
413                             PRIM_INT__g_s_p_s, PRIM_INT__g_s_s_s, NULL, PRIM_INT__f_s_p_s, NULL, PRIM_INT__g_s_d_s);
414 
415 
416 
417                     // Forming PRIM_INT__d_s_p_s[5 * 18];
418                     for(n = 0; n < 5; ++n)  // loop over orders of auxiliary function
419                     {
420 
421                         PRIM_INT__d_s_p_s[n * 18 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__d_s_s_s[n * 6 + 0]);
422                         PRIM_INT__d_s_p_s[n * 18 + 0] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__d_s_s_s[(n+1) * 6 + 0], PRIM_INT__d_s_p_s[n * 18 + 0]);
423                         PRIM_INT__d_s_p_s[n * 18 + 0] = SIMINT_FMADD( vrr_const_2_over_2pq, PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__d_s_p_s[n * 18 + 0]);
424 
425                         PRIM_INT__d_s_p_s[n * 18 + 1] = SIMINT_MUL(Q_PA[1], PRIM_INT__d_s_s_s[n * 6 + 0]);
426                         PRIM_INT__d_s_p_s[n * 18 + 1] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__d_s_s_s[(n+1) * 6 + 0], PRIM_INT__d_s_p_s[n * 18 + 1]);
427 
428                         PRIM_INT__d_s_p_s[n * 18 + 2] = SIMINT_MUL(Q_PA[2], PRIM_INT__d_s_s_s[n * 6 + 0]);
429                         PRIM_INT__d_s_p_s[n * 18 + 2] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 0], PRIM_INT__d_s_p_s[n * 18 + 2]);
430 
431                         PRIM_INT__d_s_p_s[n * 18 + 3] = SIMINT_MUL(Q_PA[0], PRIM_INT__d_s_s_s[n * 6 + 1]);
432                         PRIM_INT__d_s_p_s[n * 18 + 3] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__d_s_s_s[(n+1) * 6 + 1], PRIM_INT__d_s_p_s[n * 18 + 3]);
433                         PRIM_INT__d_s_p_s[n * 18 + 3] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__d_s_p_s[n * 18 + 3]);
434 
435                         PRIM_INT__d_s_p_s[n * 18 + 4] = SIMINT_MUL(Q_PA[1], PRIM_INT__d_s_s_s[n * 6 + 1]);
436                         PRIM_INT__d_s_p_s[n * 18 + 4] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__d_s_s_s[(n+1) * 6 + 1], PRIM_INT__d_s_p_s[n * 18 + 4]);
437                         PRIM_INT__d_s_p_s[n * 18 + 4] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__d_s_p_s[n * 18 + 4]);
438 
439                         PRIM_INT__d_s_p_s[n * 18 + 5] = SIMINT_MUL(Q_PA[2], PRIM_INT__d_s_s_s[n * 6 + 1]);
440                         PRIM_INT__d_s_p_s[n * 18 + 5] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 1], PRIM_INT__d_s_p_s[n * 18 + 5]);
441 
442                         PRIM_INT__d_s_p_s[n * 18 + 6] = SIMINT_MUL(Q_PA[0], PRIM_INT__d_s_s_s[n * 6 + 2]);
443                         PRIM_INT__d_s_p_s[n * 18 + 6] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__d_s_s_s[(n+1) * 6 + 2], PRIM_INT__d_s_p_s[n * 18 + 6]);
444                         PRIM_INT__d_s_p_s[n * 18 + 6] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__d_s_p_s[n * 18 + 6]);
445 
446                         PRIM_INT__d_s_p_s[n * 18 + 7] = SIMINT_MUL(Q_PA[1], PRIM_INT__d_s_s_s[n * 6 + 2]);
447                         PRIM_INT__d_s_p_s[n * 18 + 7] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__d_s_s_s[(n+1) * 6 + 2], PRIM_INT__d_s_p_s[n * 18 + 7]);
448 
449                         PRIM_INT__d_s_p_s[n * 18 + 8] = SIMINT_MUL(Q_PA[2], PRIM_INT__d_s_s_s[n * 6 + 2]);
450                         PRIM_INT__d_s_p_s[n * 18 + 8] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 2], PRIM_INT__d_s_p_s[n * 18 + 8]);
451                         PRIM_INT__d_s_p_s[n * 18 + 8] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__d_s_p_s[n * 18 + 8]);
452 
453                         PRIM_INT__d_s_p_s[n * 18 + 9] = SIMINT_MUL(Q_PA[0], PRIM_INT__d_s_s_s[n * 6 + 3]);
454                         PRIM_INT__d_s_p_s[n * 18 + 9] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__d_s_s_s[(n+1) * 6 + 3], PRIM_INT__d_s_p_s[n * 18 + 9]);
455 
456                         PRIM_INT__d_s_p_s[n * 18 + 10] = SIMINT_MUL(Q_PA[1], PRIM_INT__d_s_s_s[n * 6 + 3]);
457                         PRIM_INT__d_s_p_s[n * 18 + 10] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__d_s_s_s[(n+1) * 6 + 3], PRIM_INT__d_s_p_s[n * 18 + 10]);
458                         PRIM_INT__d_s_p_s[n * 18 + 10] = SIMINT_FMADD( vrr_const_2_over_2pq, PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__d_s_p_s[n * 18 + 10]);
459 
460                         PRIM_INT__d_s_p_s[n * 18 + 11] = SIMINT_MUL(Q_PA[2], PRIM_INT__d_s_s_s[n * 6 + 3]);
461                         PRIM_INT__d_s_p_s[n * 18 + 11] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 3], PRIM_INT__d_s_p_s[n * 18 + 11]);
462 
463                         PRIM_INT__d_s_p_s[n * 18 + 12] = SIMINT_MUL(Q_PA[0], PRIM_INT__d_s_s_s[n * 6 + 4]);
464                         PRIM_INT__d_s_p_s[n * 18 + 12] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__d_s_s_s[(n+1) * 6 + 4], PRIM_INT__d_s_p_s[n * 18 + 12]);
465 
466                         PRIM_INT__d_s_p_s[n * 18 + 13] = SIMINT_MUL(Q_PA[1], PRIM_INT__d_s_s_s[n * 6 + 4]);
467                         PRIM_INT__d_s_p_s[n * 18 + 13] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__d_s_s_s[(n+1) * 6 + 4], PRIM_INT__d_s_p_s[n * 18 + 13]);
468                         PRIM_INT__d_s_p_s[n * 18 + 13] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__d_s_p_s[n * 18 + 13]);
469 
470                         PRIM_INT__d_s_p_s[n * 18 + 14] = SIMINT_MUL(Q_PA[2], PRIM_INT__d_s_s_s[n * 6 + 4]);
471                         PRIM_INT__d_s_p_s[n * 18 + 14] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 4], PRIM_INT__d_s_p_s[n * 18 + 14]);
472                         PRIM_INT__d_s_p_s[n * 18 + 14] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__d_s_p_s[n * 18 + 14]);
473 
474                         PRIM_INT__d_s_p_s[n * 18 + 15] = SIMINT_MUL(Q_PA[0], PRIM_INT__d_s_s_s[n * 6 + 5]);
475                         PRIM_INT__d_s_p_s[n * 18 + 15] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__d_s_s_s[(n+1) * 6 + 5], PRIM_INT__d_s_p_s[n * 18 + 15]);
476 
477                         PRIM_INT__d_s_p_s[n * 18 + 16] = SIMINT_MUL(Q_PA[1], PRIM_INT__d_s_s_s[n * 6 + 5]);
478                         PRIM_INT__d_s_p_s[n * 18 + 16] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__d_s_s_s[(n+1) * 6 + 5], PRIM_INT__d_s_p_s[n * 18 + 16]);
479 
480                         PRIM_INT__d_s_p_s[n * 18 + 17] = SIMINT_MUL(Q_PA[2], PRIM_INT__d_s_s_s[n * 6 + 5]);
481                         PRIM_INT__d_s_p_s[n * 18 + 17] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__d_s_s_s[(n+1) * 6 + 5], PRIM_INT__d_s_p_s[n * 18 + 17]);
482                         PRIM_INT__d_s_p_s[n * 18 + 17] = SIMINT_FMADD( vrr_const_2_over_2pq, PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__d_s_p_s[n * 18 + 17]);
483 
484                     }
485 
486 
487                     VRR_K_f_s_d_s(
488                             PRIM_INT__f_s_d_s,
489                             PRIM_INT__f_s_p_s,
490                             PRIM_INT__f_s_s_s,
491                             PRIM_INT__d_s_p_s,
492                             Q_PA,
493                             a_over_q,
494                             aoq_PQ,
495                             one_over_2pq,
496                             one_over_2q,
497                             4);
498 
499 
500                     ostei_general_vrr_K(4, 0, 3, 0, 3,
501                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
502                             PRIM_INT__g_s_d_s, PRIM_INT__g_s_p_s, NULL, PRIM_INT__f_s_d_s, NULL, PRIM_INT__g_s_f_s);
503 
504 
505 
506                     // Forming PRIM_INT__p_s_p_s[5 * 9];
507                     for(n = 0; n < 5; ++n)  // loop over orders of auxiliary function
508                     {
509 
510                         PRIM_INT__p_s_p_s[n * 9 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__p_s_s_s[n * 3 + 0]);
511                         PRIM_INT__p_s_p_s[n * 9 + 0] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__p_s_p_s[n * 9 + 0]);
512                         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]);
513 
514                         PRIM_INT__p_s_p_s[n * 9 + 1] = SIMINT_MUL(Q_PA[1], PRIM_INT__p_s_s_s[n * 3 + 0]);
515                         PRIM_INT__p_s_p_s[n * 9 + 1] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__p_s_p_s[n * 9 + 1]);
516 
517                         PRIM_INT__p_s_p_s[n * 9 + 2] = SIMINT_MUL(Q_PA[2], PRIM_INT__p_s_s_s[n * 3 + 0]);
518                         PRIM_INT__p_s_p_s[n * 9 + 2] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__p_s_p_s[n * 9 + 2]);
519 
520                         PRIM_INT__p_s_p_s[n * 9 + 3] = SIMINT_MUL(Q_PA[0], PRIM_INT__p_s_s_s[n * 3 + 1]);
521                         PRIM_INT__p_s_p_s[n * 9 + 3] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__p_s_p_s[n * 9 + 3]);
522 
523                         PRIM_INT__p_s_p_s[n * 9 + 4] = SIMINT_MUL(Q_PA[1], PRIM_INT__p_s_s_s[n * 3 + 1]);
524                         PRIM_INT__p_s_p_s[n * 9 + 4] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__p_s_p_s[n * 9 + 4]);
525                         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]);
526 
527                         PRIM_INT__p_s_p_s[n * 9 + 5] = SIMINT_MUL(Q_PA[2], PRIM_INT__p_s_s_s[n * 3 + 1]);
528                         PRIM_INT__p_s_p_s[n * 9 + 5] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__p_s_p_s[n * 9 + 5]);
529 
530                         PRIM_INT__p_s_p_s[n * 9 + 6] = SIMINT_MUL(Q_PA[0], PRIM_INT__p_s_s_s[n * 3 + 2]);
531                         PRIM_INT__p_s_p_s[n * 9 + 6] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__p_s_p_s[n * 9 + 6]);
532 
533                         PRIM_INT__p_s_p_s[n * 9 + 7] = SIMINT_MUL(Q_PA[1], PRIM_INT__p_s_s_s[n * 3 + 2]);
534                         PRIM_INT__p_s_p_s[n * 9 + 7] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__p_s_p_s[n * 9 + 7]);
535 
536                         PRIM_INT__p_s_p_s[n * 9 + 8] = SIMINT_MUL(Q_PA[2], PRIM_INT__p_s_s_s[n * 3 + 2]);
537                         PRIM_INT__p_s_p_s[n * 9 + 8] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__p_s_p_s[n * 9 + 8]);
538                         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]);
539 
540                     }
541 
542 
543                     VRR_K_d_s_d_s(
544                             PRIM_INT__d_s_d_s,
545                             PRIM_INT__d_s_p_s,
546                             PRIM_INT__d_s_s_s,
547                             PRIM_INT__p_s_p_s,
548                             Q_PA,
549                             a_over_q,
550                             aoq_PQ,
551                             one_over_2pq,
552                             one_over_2q,
553                             4);
554 
555 
556                     ostei_general_vrr_K(3, 0, 3, 0, 3,
557                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
558                             PRIM_INT__f_s_d_s, PRIM_INT__f_s_p_s, NULL, PRIM_INT__d_s_d_s, NULL, PRIM_INT__f_s_f_s);
559 
560 
561                     ostei_general_vrr_K(4, 0, 4, 0, 2,
562                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
563                             PRIM_INT__g_s_f_s, PRIM_INT__g_s_d_s, NULL, PRIM_INT__f_s_f_s, NULL, PRIM_INT__g_s_g_s);
564 
565 
566                     VRR_I_h_s_s_s(
567                             PRIM_INT__h_s_s_s,
568                             PRIM_INT__g_s_s_s,
569                             PRIM_INT__f_s_s_s,
570                             P_PA,
571                             a_over_p,
572                             aop_PQ,
573                             one_over_2p,
574                             7);
575 
576 
577                     ostei_general_vrr_K(5, 0, 1, 0, 5,
578                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
579                             PRIM_INT__h_s_s_s, NULL, NULL, PRIM_INT__g_s_s_s, NULL, PRIM_INT__h_s_p_s);
580 
581 
582                     ostei_general_vrr_K(5, 0, 2, 0, 4,
583                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
584                             PRIM_INT__h_s_p_s, PRIM_INT__h_s_s_s, NULL, PRIM_INT__g_s_p_s, NULL, PRIM_INT__h_s_d_s);
585 
586 
587                     ostei_general_vrr_K(5, 0, 3, 0, 3,
588                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
589                             PRIM_INT__h_s_d_s, PRIM_INT__h_s_p_s, NULL, PRIM_INT__g_s_d_s, NULL, PRIM_INT__h_s_f_s);
590 
591 
592 
593                     // Forming PRIM_INT__s_s_p_s[5 * 3];
594                     for(n = 0; n < 5; ++n)  // loop over orders of auxiliary function
595                     {
596 
597                         PRIM_INT__s_s_p_s[n * 3 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__s_s_s_s[n * 1 + 0]);
598                         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]);
599 
600                         PRIM_INT__s_s_p_s[n * 3 + 1] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_s_s[n * 1 + 0]);
601                         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]);
602 
603                         PRIM_INT__s_s_p_s[n * 3 + 2] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_s_s[n * 1 + 0]);
604                         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]);
605 
606                     }
607 
608 
609 
610                     // Forming PRIM_INT__p_s_d_s[4 * 18];
611                     for(n = 0; n < 4; ++n)  // loop over orders of auxiliary function
612                     {
613 
614                         PRIM_INT__p_s_d_s[n * 18 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__p_s_p_s[n * 9 + 0]);
615                         PRIM_INT__p_s_d_s[n * 18 + 0] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__p_s_p_s[(n+1) * 9 + 0], PRIM_INT__p_s_d_s[n * 18 + 0]);
616                         PRIM_INT__p_s_d_s[n * 18 + 0] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__p_s_s_s[n * 3 + 0]), PRIM_INT__p_s_d_s[n * 18 + 0]);
617                         PRIM_INT__p_s_d_s[n * 18 + 0] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__s_s_p_s[(n+1) * 3 + 0], PRIM_INT__p_s_d_s[n * 18 + 0]);
618 
619                         PRIM_INT__p_s_d_s[n * 18 + 3] = SIMINT_MUL(Q_PA[1], PRIM_INT__p_s_p_s[n * 9 + 1]);
620                         PRIM_INT__p_s_d_s[n * 18 + 3] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__p_s_p_s[(n+1) * 9 + 1], PRIM_INT__p_s_d_s[n * 18 + 3]);
621                         PRIM_INT__p_s_d_s[n * 18 + 3] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__p_s_s_s[n * 3 + 0]), PRIM_INT__p_s_d_s[n * 18 + 3]);
622 
623                         PRIM_INT__p_s_d_s[n * 18 + 5] = SIMINT_MUL(Q_PA[2], PRIM_INT__p_s_p_s[n * 9 + 2]);
624                         PRIM_INT__p_s_d_s[n * 18 + 5] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__p_s_p_s[(n+1) * 9 + 2], PRIM_INT__p_s_d_s[n * 18 + 5]);
625                         PRIM_INT__p_s_d_s[n * 18 + 5] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__p_s_s_s[n * 3 + 0]), PRIM_INT__p_s_d_s[n * 18 + 5]);
626 
627                         PRIM_INT__p_s_d_s[n * 18 + 6] = SIMINT_MUL(Q_PA[0], PRIM_INT__p_s_p_s[n * 9 + 3]);
628                         PRIM_INT__p_s_d_s[n * 18 + 6] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__p_s_p_s[(n+1) * 9 + 3], PRIM_INT__p_s_d_s[n * 18 + 6]);
629                         PRIM_INT__p_s_d_s[n * 18 + 6] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__p_s_s_s[n * 3 + 1]), PRIM_INT__p_s_d_s[n * 18 + 6]);
630 
631                         PRIM_INT__p_s_d_s[n * 18 + 9] = SIMINT_MUL(Q_PA[1], PRIM_INT__p_s_p_s[n * 9 + 4]);
632                         PRIM_INT__p_s_d_s[n * 18 + 9] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__p_s_p_s[(n+1) * 9 + 4], PRIM_INT__p_s_d_s[n * 18 + 9]);
633                         PRIM_INT__p_s_d_s[n * 18 + 9] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__p_s_s_s[n * 3 + 1]), PRIM_INT__p_s_d_s[n * 18 + 9]);
634                         PRIM_INT__p_s_d_s[n * 18 + 9] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__s_s_p_s[(n+1) * 3 + 1], PRIM_INT__p_s_d_s[n * 18 + 9]);
635 
636                         PRIM_INT__p_s_d_s[n * 18 + 11] = SIMINT_MUL(Q_PA[2], PRIM_INT__p_s_p_s[n * 9 + 5]);
637                         PRIM_INT__p_s_d_s[n * 18 + 11] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__p_s_p_s[(n+1) * 9 + 5], PRIM_INT__p_s_d_s[n * 18 + 11]);
638                         PRIM_INT__p_s_d_s[n * 18 + 11] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__p_s_s_s[n * 3 + 1]), PRIM_INT__p_s_d_s[n * 18 + 11]);
639 
640                         PRIM_INT__p_s_d_s[n * 18 + 12] = SIMINT_MUL(Q_PA[0], PRIM_INT__p_s_p_s[n * 9 + 6]);
641                         PRIM_INT__p_s_d_s[n * 18 + 12] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__p_s_p_s[(n+1) * 9 + 6], PRIM_INT__p_s_d_s[n * 18 + 12]);
642                         PRIM_INT__p_s_d_s[n * 18 + 12] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__p_s_s_s[n * 3 + 2]), PRIM_INT__p_s_d_s[n * 18 + 12]);
643 
644                         PRIM_INT__p_s_d_s[n * 18 + 15] = SIMINT_MUL(Q_PA[1], PRIM_INT__p_s_p_s[n * 9 + 7]);
645                         PRIM_INT__p_s_d_s[n * 18 + 15] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__p_s_p_s[(n+1) * 9 + 7], PRIM_INT__p_s_d_s[n * 18 + 15]);
646                         PRIM_INT__p_s_d_s[n * 18 + 15] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__p_s_s_s[n * 3 + 2]), PRIM_INT__p_s_d_s[n * 18 + 15]);
647 
648                         PRIM_INT__p_s_d_s[n * 18 + 17] = SIMINT_MUL(Q_PA[2], PRIM_INT__p_s_p_s[n * 9 + 8]);
649                         PRIM_INT__p_s_d_s[n * 18 + 17] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__p_s_p_s[(n+1) * 9 + 8], PRIM_INT__p_s_d_s[n * 18 + 17]);
650                         PRIM_INT__p_s_d_s[n * 18 + 17] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__p_s_s_s[n * 3 + 2]), PRIM_INT__p_s_d_s[n * 18 + 17]);
651                         PRIM_INT__p_s_d_s[n * 18 + 17] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__s_s_p_s[(n+1) * 3 + 2], PRIM_INT__p_s_d_s[n * 18 + 17]);
652 
653                     }
654 
655 
656                     VRR_K_d_s_f_s(
657                             PRIM_INT__d_s_f_s,
658                             PRIM_INT__d_s_d_s,
659                             PRIM_INT__d_s_p_s,
660                             PRIM_INT__p_s_d_s,
661                             Q_PA,
662                             a_over_q,
663                             aoq_PQ,
664                             one_over_2pq,
665                             one_over_2q,
666                             3);
667 
668 
669                     ostei_general_vrr_K(3, 0, 4, 0, 2,
670                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
671                             PRIM_INT__f_s_f_s, PRIM_INT__f_s_d_s, NULL, PRIM_INT__d_s_f_s, NULL, PRIM_INT__f_s_g_s);
672 
673 
674                     ostei_general_vrr_K(4, 0, 5, 0, 1,
675                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
676                             PRIM_INT__g_s_g_s, PRIM_INT__g_s_f_s, NULL, PRIM_INT__f_s_g_s, NULL, PRIM_INT__g_s_h_s);
677 
678 
679                     ostei_general_vrr_K(5, 0, 4, 0, 2,
680                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
681                             PRIM_INT__h_s_f_s, PRIM_INT__h_s_d_s, NULL, PRIM_INT__g_s_f_s, NULL, PRIM_INT__h_s_g_s);
682 
683 
684                     ostei_general_vrr1_I(6, 6,
685                             one_over_2p, a_over_p, aop_PQ, P_PA,
686                             PRIM_INT__h_s_s_s, PRIM_INT__g_s_s_s, PRIM_INT__i_s_s_s);
687 
688 
689                     ostei_general_vrr_K(6, 0, 1, 0, 5,
690                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
691                             PRIM_INT__i_s_s_s, NULL, NULL, PRIM_INT__h_s_s_s, NULL, PRIM_INT__i_s_p_s);
692 
693 
694                     ostei_general_vrr_K(6, 0, 2, 0, 4,
695                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
696                             PRIM_INT__i_s_p_s, PRIM_INT__i_s_s_s, NULL, PRIM_INT__h_s_p_s, NULL, PRIM_INT__i_s_d_s);
697 
698 
699                     ostei_general_vrr_K(6, 0, 3, 0, 3,
700                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
701                             PRIM_INT__i_s_d_s, PRIM_INT__i_s_p_s, NULL, PRIM_INT__h_s_d_s, NULL, PRIM_INT__i_s_f_s);
702 
703 
704                     ostei_general_vrr_K(5, 0, 5, 0, 1,
705                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
706                             PRIM_INT__h_s_g_s, PRIM_INT__h_s_f_s, NULL, PRIM_INT__g_s_g_s, NULL, PRIM_INT__h_s_h_s);
707 
708 
709                     ostei_general_vrr_K(6, 0, 4, 0, 2,
710                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
711                             PRIM_INT__i_s_f_s, PRIM_INT__i_s_d_s, NULL, PRIM_INT__h_s_f_s, NULL, PRIM_INT__i_s_g_s);
712 
713 
714                     ostei_general_vrr_K(6, 0, 5, 0, 1,
715                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
716                             PRIM_INT__i_s_g_s, PRIM_INT__i_s_f_s, NULL, PRIM_INT__h_s_g_s, NULL, PRIM_INT__i_s_h_s);
717 
718 
719 
720 
721                     ////////////////////////////////////
722                     // Accumulate contracted integrals
723                     ////////////////////////////////////
724                     if(lastoffset == 0)
725                     {
726                         contract_all(150, PRIM_INT__g_s_f_s, PRIM_PTR_INT__g_s_f_s);
727                         contract_all(225, PRIM_INT__g_s_g_s, PRIM_PTR_INT__g_s_g_s);
728                         contract_all(315, PRIM_INT__g_s_h_s, PRIM_PTR_INT__g_s_h_s);
729                         contract_all(210, PRIM_INT__h_s_f_s, PRIM_PTR_INT__h_s_f_s);
730                         contract_all(315, PRIM_INT__h_s_g_s, PRIM_PTR_INT__h_s_g_s);
731                         contract_all(441, PRIM_INT__h_s_h_s, PRIM_PTR_INT__h_s_h_s);
732                         contract_all(280, PRIM_INT__i_s_f_s, PRIM_PTR_INT__i_s_f_s);
733                         contract_all(420, PRIM_INT__i_s_g_s, PRIM_PTR_INT__i_s_g_s);
734                         contract_all(588, PRIM_INT__i_s_h_s, PRIM_PTR_INT__i_s_h_s);
735                     }
736                     else
737                     {
738                         contract(150, shelloffsets, PRIM_INT__g_s_f_s, PRIM_PTR_INT__g_s_f_s);
739                         contract(225, shelloffsets, PRIM_INT__g_s_g_s, PRIM_PTR_INT__g_s_g_s);
740                         contract(315, shelloffsets, PRIM_INT__g_s_h_s, PRIM_PTR_INT__g_s_h_s);
741                         contract(210, shelloffsets, PRIM_INT__h_s_f_s, PRIM_PTR_INT__h_s_f_s);
742                         contract(315, shelloffsets, PRIM_INT__h_s_g_s, PRIM_PTR_INT__h_s_g_s);
743                         contract(441, shelloffsets, PRIM_INT__h_s_h_s, PRIM_PTR_INT__h_s_h_s);
744                         contract(280, shelloffsets, PRIM_INT__i_s_f_s, PRIM_PTR_INT__i_s_f_s);
745                         contract(420, shelloffsets, PRIM_INT__i_s_g_s, PRIM_PTR_INT__i_s_g_s);
746                         contract(588, shelloffsets, PRIM_INT__i_s_h_s, PRIM_PTR_INT__i_s_h_s);
747                         PRIM_PTR_INT__g_s_f_s += lastoffset*150;
748                         PRIM_PTR_INT__g_s_g_s += lastoffset*225;
749                         PRIM_PTR_INT__g_s_h_s += lastoffset*315;
750                         PRIM_PTR_INT__h_s_f_s += lastoffset*210;
751                         PRIM_PTR_INT__h_s_g_s += lastoffset*315;
752                         PRIM_PTR_INT__h_s_h_s += lastoffset*441;
753                         PRIM_PTR_INT__i_s_f_s += lastoffset*280;
754                         PRIM_PTR_INT__i_s_g_s += lastoffset*420;
755                         PRIM_PTR_INT__i_s_h_s += lastoffset*588;
756                     }
757 
758                 }  // close loop over j
759             }  // close loop over i
760 
761             //Advance to the next batch
762             jstart = SIMINT_SIMD_ROUND(jend);
763 
764             //////////////////////////////////////////////
765             // Contracted integrals: Horizontal recurrance
766             //////////////////////////////////////////////
767 
768 
769             const double hAB[3] = { P.AB_x[ab], P.AB_y[ab], P.AB_z[ab] };
770 
771 
772             for(abcd = 0; abcd < nshellbatch; ++abcd, ++real_abcd)
773             {
774                 const double hCD[3] = { Q.AB_x[cd+abcd], Q.AB_y[cd+abcd], Q.AB_z[cd+abcd] };
775 
776                 // set up HRR pointers
777                 double const * restrict HRR_INT__g_s_f_s = INT__g_s_f_s + abcd * 150;
778                 double const * restrict HRR_INT__g_s_g_s = INT__g_s_g_s + abcd * 225;
779                 double const * restrict HRR_INT__g_s_h_s = INT__g_s_h_s + abcd * 315;
780                 double const * restrict HRR_INT__h_s_f_s = INT__h_s_f_s + abcd * 210;
781                 double const * restrict HRR_INT__h_s_g_s = INT__h_s_g_s + abcd * 315;
782                 double const * restrict HRR_INT__h_s_h_s = INT__h_s_h_s + abcd * 441;
783                 double const * restrict HRR_INT__i_s_f_s = INT__i_s_f_s + abcd * 280;
784                 double const * restrict HRR_INT__i_s_g_s = INT__i_s_g_s + abcd * 420;
785                 double const * restrict HRR_INT__i_s_h_s = INT__i_s_h_s + abcd * 588;
786                 double * restrict HRR_INT__g_d_f_d = INT__g_d_f_d + real_abcd * 5400;
787 
788                 // form INT__g_p_f_s
789                 HRR_J_g_p(
790                     HRR_INT__g_p_f_s,
791                     HRR_INT__g_s_f_s,
792                     HRR_INT__h_s_f_s,
793                     hAB, 10);
794 
795                 // form INT__g_p_g_s
796                 HRR_J_g_p(
797                     HRR_INT__g_p_g_s,
798                     HRR_INT__g_s_g_s,
799                     HRR_INT__h_s_g_s,
800                     hAB, 15);
801 
802                 // form INT__g_p_h_s
803                 HRR_J_g_p(
804                     HRR_INT__g_p_h_s,
805                     HRR_INT__g_s_h_s,
806                     HRR_INT__h_s_h_s,
807                     hAB, 21);
808 
809                 // form INT__h_p_f_s
810                 ostei_general_hrr_J(5, 1, 3, 0, hAB, HRR_INT__i_s_f_s, HRR_INT__h_s_f_s, HRR_INT__h_p_f_s);
811 
812                 // form INT__h_p_g_s
813                 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);
814 
815                 // form INT__h_p_h_s
816                 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);
817 
818                 // form INT__g_d_f_s
819                 ostei_general_hrr_J(4, 2, 3, 0, hAB, HRR_INT__h_p_f_s, HRR_INT__g_p_f_s, HRR_INT__g_d_f_s);
820 
821                 // form INT__g_d_g_s
822                 ostei_general_hrr_J(4, 2, 4, 0, hAB, HRR_INT__h_p_g_s, HRR_INT__g_p_g_s, HRR_INT__g_d_g_s);
823 
824                 // form INT__g_d_h_s
825                 ostei_general_hrr_J(4, 2, 5, 0, hAB, HRR_INT__h_p_h_s, HRR_INT__g_p_h_s, HRR_INT__g_d_h_s);
826 
827                 // form INT__g_d_f_p
828                 HRR_L_f_p(
829                     HRR_INT__g_d_f_p,
830                     HRR_INT__g_d_f_s,
831                     HRR_INT__g_d_g_s,
832                     hCD, 90);
833 
834                 // form INT__g_d_g_p
835                 HRR_L_g_p(
836                     HRR_INT__g_d_g_p,
837                     HRR_INT__g_d_g_s,
838                     HRR_INT__g_d_h_s,
839                     hCD, 90);
840 
841                 // form INT__g_d_f_d
842                 HRR_L_f_d(
843                     HRR_INT__g_d_f_d,
844                     HRR_INT__g_d_f_p,
845                     HRR_INT__g_d_g_p,
846                     hCD, 90);
847 
848 
849             }  // close HRR loop
850 
851 
852         }   // close loop cdbatch
853 
854         istart = iend;
855     }  // close loop over ab
856 
857     return P.nshell12_clip * Q.nshell12_clip;
858 }
859 
ostei_d_g_f_d(struct simint_multi_shellpair const P,struct simint_multi_shellpair const Q,double screen_tol,double * const restrict work,double * const restrict INT__d_g_f_d)860 int ostei_d_g_f_d(struct simint_multi_shellpair const P,
861                   struct simint_multi_shellpair const Q,
862                   double screen_tol,
863                   double * const restrict work,
864                   double * const restrict INT__d_g_f_d)
865 {
866     double P_AB[3*P.nshell12];
867     struct simint_multi_shellpair P_tmp = P;
868     P_tmp.PA_x = P.PB_x;  P_tmp.PA_y = P.PB_y;  P_tmp.PA_z = P.PB_z;
869     P_tmp.PB_x = P.PA_x;  P_tmp.PB_y = P.PA_y;  P_tmp.PB_z = P.PA_z;
870     P_tmp.AB_x = P_AB;
871     P_tmp.AB_y = P_AB + P.nshell12;
872     P_tmp.AB_z = P_AB + 2*P.nshell12;
873 
874     for(int i = 0; i < P.nshell12; i++)
875     {
876         P_tmp.AB_x[i] = -P.AB_x[i];
877         P_tmp.AB_y[i] = -P.AB_y[i];
878         P_tmp.AB_z[i] = -P.AB_z[i];
879     }
880 
881     int ret = ostei_g_d_f_d(P_tmp, Q, screen_tol, work, INT__d_g_f_d);
882     double buffer[5400] SIMINT_ALIGN_ARRAY_DBL;
883 
884     for(int q = 0; q < ret; q++)
885     {
886         int idx = 0;
887         for(int a = 0; a < 6; ++a)
888         for(int b = 0; b < 15; ++b)
889         for(int c = 0; c < 10; ++c)
890         for(int d = 0; d < 6; ++d)
891             buffer[idx++] = INT__d_g_f_d[q*5400+b*360+a*60+c*6+d];
892 
893         memcpy(INT__d_g_f_d+q*5400, buffer, 5400*sizeof(double));
894     }
895 
896     return ret;
897 }
898 
ostei_g_d_d_f(struct simint_multi_shellpair const P,struct simint_multi_shellpair const Q,double screen_tol,double * const restrict work,double * const restrict INT__g_d_d_f)899 int ostei_g_d_d_f(struct simint_multi_shellpair const P,
900                   struct simint_multi_shellpair const Q,
901                   double screen_tol,
902                   double * const restrict work,
903                   double * const restrict INT__g_d_d_f)
904 {
905     double Q_AB[3*Q.nshell12];
906     struct simint_multi_shellpair Q_tmp = Q;
907     Q_tmp.PA_x = Q.PB_x;  Q_tmp.PA_y = Q.PB_y;  Q_tmp.PA_z = Q.PB_z;
908     Q_tmp.PB_x = Q.PA_x;  Q_tmp.PB_y = Q.PA_y;  Q_tmp.PB_z = Q.PA_z;
909     Q_tmp.AB_x = Q_AB;
910     Q_tmp.AB_y = Q_AB + Q.nshell12;
911     Q_tmp.AB_z = Q_AB + 2*Q.nshell12;
912 
913     for(int i = 0; i < Q.nshell12; i++)
914     {
915         Q_tmp.AB_x[i] = -Q.AB_x[i];
916         Q_tmp.AB_y[i] = -Q.AB_y[i];
917         Q_tmp.AB_z[i] = -Q.AB_z[i];
918     }
919 
920     int ret = ostei_g_d_f_d(P, Q_tmp, screen_tol, work, INT__g_d_d_f);
921     double buffer[5400] SIMINT_ALIGN_ARRAY_DBL;
922 
923     for(int q = 0; q < ret; q++)
924     {
925         int idx = 0;
926         for(int a = 0; a < 15; ++a)
927         for(int b = 0; b < 6; ++b)
928         for(int c = 0; c < 6; ++c)
929         for(int d = 0; d < 10; ++d)
930             buffer[idx++] = INT__g_d_d_f[q*5400+a*360+b*60+d*6+c];
931 
932         memcpy(INT__g_d_d_f+q*5400, buffer, 5400*sizeof(double));
933     }
934 
935     return ret;
936 }
937 
ostei_d_g_d_f(struct simint_multi_shellpair const P,struct simint_multi_shellpair const Q,double screen_tol,double * const restrict work,double * const restrict INT__d_g_d_f)938 int ostei_d_g_d_f(struct simint_multi_shellpair const P,
939                   struct simint_multi_shellpair const Q,
940                   double screen_tol,
941                   double * const restrict work,
942                   double * const restrict INT__d_g_d_f)
943 {
944     double P_AB[3*P.nshell12];
945     struct simint_multi_shellpair P_tmp = P;
946     P_tmp.PA_x = P.PB_x;  P_tmp.PA_y = P.PB_y;  P_tmp.PA_z = P.PB_z;
947     P_tmp.PB_x = P.PA_x;  P_tmp.PB_y = P.PA_y;  P_tmp.PB_z = P.PA_z;
948     P_tmp.AB_x = P_AB;
949     P_tmp.AB_y = P_AB + P.nshell12;
950     P_tmp.AB_z = P_AB + 2*P.nshell12;
951 
952     for(int i = 0; i < P.nshell12; i++)
953     {
954         P_tmp.AB_x[i] = -P.AB_x[i];
955         P_tmp.AB_y[i] = -P.AB_y[i];
956         P_tmp.AB_z[i] = -P.AB_z[i];
957     }
958 
959     double Q_AB[3*Q.nshell12];
960     struct simint_multi_shellpair Q_tmp = Q;
961     Q_tmp.PA_x = Q.PB_x;  Q_tmp.PA_y = Q.PB_y;  Q_tmp.PA_z = Q.PB_z;
962     Q_tmp.PB_x = Q.PA_x;  Q_tmp.PB_y = Q.PA_y;  Q_tmp.PB_z = Q.PA_z;
963     Q_tmp.AB_x = Q_AB;
964     Q_tmp.AB_y = Q_AB + Q.nshell12;
965     Q_tmp.AB_z = Q_AB + 2*Q.nshell12;
966 
967     for(int i = 0; i < Q.nshell12; i++)
968     {
969         Q_tmp.AB_x[i] = -Q.AB_x[i];
970         Q_tmp.AB_y[i] = -Q.AB_y[i];
971         Q_tmp.AB_z[i] = -Q.AB_z[i];
972     }
973 
974     int ret = ostei_g_d_f_d(P_tmp, Q_tmp, screen_tol, work, INT__d_g_d_f);
975     double buffer[5400] SIMINT_ALIGN_ARRAY_DBL;
976 
977     for(int q = 0; q < ret; q++)
978     {
979         int idx = 0;
980         for(int a = 0; a < 6; ++a)
981         for(int b = 0; b < 15; ++b)
982         for(int c = 0; c < 6; ++c)
983         for(int d = 0; d < 10; ++d)
984             buffer[idx++] = INT__d_g_d_f[q*5400+b*360+a*60+d*6+c];
985 
986         memcpy(INT__d_g_d_f+q*5400, buffer, 5400*sizeof(double));
987     }
988 
989     return ret;
990 }
991 
992