1 #include "simint/boys/boys.h"
2 #include "simint/ostei/gen/ostei_generated.h"
3 #include "simint/vectorization/vectorization.h"
4 #include <math.h>
5 #include <string.h>
6 
7 
ostei_g_g_f_s(struct simint_multi_shellpair const P,struct simint_multi_shellpair const Q,double screen_tol,double * const restrict work,double * const restrict INT__g_g_f_s)8 int ostei_g_g_f_s(struct simint_multi_shellpair const P,
9                   struct simint_multi_shellpair const Q,
10                   double screen_tol,
11                   double * const restrict work,
12                   double * const restrict INT__g_g_f_s)
13 {
14 
15     SIMINT_ASSUME_ALIGN_DBL(work);
16     SIMINT_ASSUME_ALIGN_DBL(INT__g_g_f_s);
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 
27     // partition workspace
28     double * const INT__g_s_f_s = work + (SIMINT_NSHELL_SIMD * 0);
29     double * const INT__h_s_f_s = work + (SIMINT_NSHELL_SIMD * 150);
30     double * const INT__i_s_f_s = work + (SIMINT_NSHELL_SIMD * 360);
31     double * const INT__k_s_f_s = work + (SIMINT_NSHELL_SIMD * 640);
32     double * const INT__l_s_f_s = work + (SIMINT_NSHELL_SIMD * 1000);
33     SIMINT_DBLTYPE * const primwork = (SIMINT_DBLTYPE *)(work + SIMINT_NSHELL_SIMD*1450);
34     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_s_s = primwork + 0;
35     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_s_s = primwork + 12;
36     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_s_s = primwork + 45;
37     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_p_s = primwork + 105;
38     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_s_s = primwork + 159;
39     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_p_s = primwork + 249;
40     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_d_s = primwork + 339;
41     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_s_s = primwork + 459;
42     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_p_s = primwork + 579;
43     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_d_s = primwork + 714;
44     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_f_s = primwork + 894;
45     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_s_s = primwork + 1044;
46     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_p_s = primwork + 1191;
47     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_d_s = primwork + 1380;
48     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_f_s = primwork + 1632;
49     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_s_s = primwork + 1842;
50     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_p_s = primwork + 2010;
51     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_d_s = primwork + 2262;
52     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_f_s = primwork + 2598;
53     SIMINT_DBLTYPE * const restrict PRIM_INT__k_s_s_s = primwork + 2878;
54     SIMINT_DBLTYPE * const restrict PRIM_INT__k_s_p_s = primwork + 3058;
55     SIMINT_DBLTYPE * const restrict PRIM_INT__k_s_d_s = primwork + 3382;
56     SIMINT_DBLTYPE * const restrict PRIM_INT__k_s_f_s = primwork + 3814;
57     SIMINT_DBLTYPE * const restrict PRIM_INT__l_s_s_s = primwork + 4174;
58     SIMINT_DBLTYPE * const restrict PRIM_INT__l_s_p_s = primwork + 4354;
59     SIMINT_DBLTYPE * const restrict PRIM_INT__l_s_d_s = primwork + 4759;
60     SIMINT_DBLTYPE * const restrict PRIM_INT__l_s_f_s = primwork + 5299;
61     double * const hrrwork = (double *)(primwork + 5749);
62     double * const HRR_INT__g_p_f_s = hrrwork + 0;
63     double * const HRR_INT__g_d_f_s = hrrwork + 450;
64     double * const HRR_INT__g_f_f_s = hrrwork + 1350;
65     double * const HRR_INT__h_p_f_s = hrrwork + 2850;
66     double * const HRR_INT__h_d_f_s = hrrwork + 3480;
67     double * const HRR_INT__h_f_f_s = hrrwork + 4740;
68     double * const HRR_INT__i_p_f_s = hrrwork + 6840;
69     double * const HRR_INT__i_d_f_s = hrrwork + 7680;
70     double * const HRR_INT__k_p_f_s = hrrwork + 9360;
71 
72 
73     // Create constants
74     const SIMINT_DBLTYPE const_1 = SIMINT_DBLSET1(1);
75     const SIMINT_DBLTYPE const_2 = SIMINT_DBLSET1(2);
76     const SIMINT_DBLTYPE const_3 = SIMINT_DBLSET1(3);
77     const SIMINT_DBLTYPE const_4 = SIMINT_DBLSET1(4);
78     const SIMINT_DBLTYPE const_5 = SIMINT_DBLSET1(5);
79     const SIMINT_DBLTYPE const_6 = SIMINT_DBLSET1(6);
80     const SIMINT_DBLTYPE const_7 = SIMINT_DBLSET1(7);
81     const SIMINT_DBLTYPE const_8 = SIMINT_DBLSET1(8);
82     const SIMINT_DBLTYPE one_half = SIMINT_DBLSET1(0.5);
83 
84 
85     ////////////////////////////////////////
86     // Loop over shells and primitives
87     ////////////////////////////////////////
88 
89     real_abcd = 0;
90     istart = 0;
91     for(ab = 0; ab < P.nshell12_clip; ++ab)
92     {
93         const int iend = istart + P.nprim12[ab];
94 
95         cd = 0;
96         jstart = 0;
97 
98         for(cd = 0; cd < Q.nshell12_clip; cd += SIMINT_NSHELL_SIMD)
99         {
100             const int nshellbatch = ((cd + SIMINT_NSHELL_SIMD) > Q.nshell12_clip) ? Q.nshell12_clip - cd : SIMINT_NSHELL_SIMD;
101             int jend = jstart;
102             for(i = 0; i < nshellbatch; i++)
103                 jend += Q.nprim12[cd+i];
104 
105             // Clear the beginning of the workspace (where we are accumulating integrals)
106             memset(work, 0, SIMINT_NSHELL_SIMD * 1450 * sizeof(double));
107             abcd = 0;
108 
109 
110             for(i = istart; i < iend; ++i)
111             {
112                 SIMINT_DBLTYPE bra_screen_max;  // only used if check_screen
113 
114                 if(check_screen)
115                 {
116                     // Skip this whole thing if always insignificant
117                     if((P.screen[i] * Q.screen_max) < screen_tol)
118                         continue;
119                     bra_screen_max = SIMINT_DBLSET1(P.screen[i]);
120                 }
121 
122                 icd = 0;
123                 iprimcd = 0;
124                 nprim_icd = Q.nprim12[cd];
125                 double * restrict PRIM_PTR_INT__g_s_f_s = INT__g_s_f_s + abcd * 150;
126                 double * restrict PRIM_PTR_INT__h_s_f_s = INT__h_s_f_s + abcd * 210;
127                 double * restrict PRIM_PTR_INT__i_s_f_s = INT__i_s_f_s + abcd * 280;
128                 double * restrict PRIM_PTR_INT__k_s_f_s = INT__k_s_f_s + abcd * 360;
129                 double * restrict PRIM_PTR_INT__l_s_f_s = INT__l_s_f_s + abcd * 450;
130 
131 
132 
133                 // Load these one per loop over i
134                 const SIMINT_DBLTYPE P_alpha = SIMINT_DBLSET1(P.alpha[i]);
135                 const SIMINT_DBLTYPE P_prefac = SIMINT_DBLSET1(P.prefac[i]);
136                 const SIMINT_DBLTYPE Pxyz[3] = { SIMINT_DBLSET1(P.x[i]), SIMINT_DBLSET1(P.y[i]), SIMINT_DBLSET1(P.z[i]) };
137 
138                 const SIMINT_DBLTYPE P_PA[3] = { SIMINT_DBLSET1(P.PA_x[i]), SIMINT_DBLSET1(P.PA_y[i]), SIMINT_DBLSET1(P.PA_z[i]) };
139 
140                 for(j = jstart; j < jend; j += SIMINT_SIMD_LEN)
141                 {
142                     // calculate the shell offsets
143                     // these are the offset from the shell pointed to by cd
144                     // for each element
145                     int shelloffsets[SIMINT_SIMD_LEN] = {0};
146                     int lastoffset = 0;
147                     const int nlane = ( ((j + SIMINT_SIMD_LEN) < jend) ? SIMINT_SIMD_LEN : (jend - j));
148 
149                     if((iprimcd + SIMINT_SIMD_LEN) >= nprim_icd)
150                     {
151                         // Handle if the first element of the vector is a new shell
152                         if(iprimcd >= nprim_icd && ((icd+1) < nshellbatch))
153                         {
154                             nprim_icd += Q.nprim12[cd + (++icd)];
155                             PRIM_PTR_INT__g_s_f_s += 150;
156                             PRIM_PTR_INT__h_s_f_s += 210;
157                             PRIM_PTR_INT__i_s_f_s += 280;
158                             PRIM_PTR_INT__k_s_f_s += 360;
159                             PRIM_PTR_INT__l_s_f_s += 450;
160                         }
161                         iprimcd++;
162                         for(n = 1; n < SIMINT_SIMD_LEN; ++n)
163                         {
164                             if(iprimcd >= nprim_icd && ((icd+1) < nshellbatch))
165                             {
166                                 shelloffsets[n] = shelloffsets[n-1] + 1;
167                                 lastoffset++;
168                                 nprim_icd += Q.nprim12[cd + (++icd)];
169                             }
170                             else
171                                 shelloffsets[n] = shelloffsets[n-1];
172                             iprimcd++;
173                         }
174                     }
175                     else
176                         iprimcd += SIMINT_SIMD_LEN;
177 
178                     // Do we have to compute this vector (or has it been screened out)?
179                     // (not_screened != 0 means we have to do this vector)
180                     if(check_screen)
181                     {
182                         const double vmax = vector_max(SIMINT_MUL(bra_screen_max, SIMINT_DBLLOAD(Q.screen, j)));
183                         if(vmax < screen_tol)
184                         {
185                             PRIM_PTR_INT__g_s_f_s += lastoffset*150;
186                             PRIM_PTR_INT__h_s_f_s += lastoffset*210;
187                             PRIM_PTR_INT__i_s_f_s += lastoffset*280;
188                             PRIM_PTR_INT__k_s_f_s += lastoffset*360;
189                             PRIM_PTR_INT__l_s_f_s += lastoffset*450;
190                             continue;
191                         }
192                     }
193 
194                     const SIMINT_DBLTYPE Q_alpha = SIMINT_DBLLOAD(Q.alpha, j);
195                     const SIMINT_DBLTYPE PQalpha_mul = SIMINT_MUL(P_alpha, Q_alpha);
196                     const SIMINT_DBLTYPE PQalpha_sum = SIMINT_ADD(P_alpha, Q_alpha);
197                     const SIMINT_DBLTYPE one_over_PQalpha_sum = SIMINT_DIV(const_1, PQalpha_sum);
198 
199 
200                     /* construct R2 = (Px - Qx)**2 + (Py - Qy)**2 + (Pz -Qz)**2 */
201                     SIMINT_DBLTYPE PQ[3];
202                     PQ[0] = SIMINT_SUB(Pxyz[0], SIMINT_DBLLOAD(Q.x, j));
203                     PQ[1] = SIMINT_SUB(Pxyz[1], SIMINT_DBLLOAD(Q.y, j));
204                     PQ[2] = SIMINT_SUB(Pxyz[2], SIMINT_DBLLOAD(Q.z, j));
205                     SIMINT_DBLTYPE R2 = SIMINT_MUL(PQ[0], PQ[0]);
206                     R2 = SIMINT_FMADD(PQ[1], PQ[1], R2);
207                     R2 = SIMINT_FMADD(PQ[2], PQ[2], R2);
208 
209                     const SIMINT_DBLTYPE alpha = SIMINT_MUL(PQalpha_mul, one_over_PQalpha_sum); // alpha from MEST
210                     const SIMINT_DBLTYPE one_over_p = SIMINT_DIV(const_1, P_alpha);
211                     const SIMINT_DBLTYPE one_over_q = SIMINT_DIV(const_1, Q_alpha);
212                     const SIMINT_DBLTYPE one_over_2p = SIMINT_MUL(one_half, one_over_p);
213                     const SIMINT_DBLTYPE one_over_2q = SIMINT_MUL(one_half, one_over_q);
214                     const SIMINT_DBLTYPE one_over_2pq = SIMINT_MUL(one_half, one_over_PQalpha_sum);
215                     const SIMINT_DBLTYPE Q_PA[3] = { SIMINT_DBLLOAD(Q.PA_x, j), SIMINT_DBLLOAD(Q.PA_y, j), SIMINT_DBLLOAD(Q.PA_z, j) };
216 
217                     // NOTE: Minus sign!
218                     const SIMINT_DBLTYPE a_over_p = SIMINT_MUL(SIMINT_NEG(alpha), one_over_p);
219                     SIMINT_DBLTYPE aop_PQ[3];
220                     aop_PQ[0] = SIMINT_MUL(a_over_p, PQ[0]);
221                     aop_PQ[1] = SIMINT_MUL(a_over_p, PQ[1]);
222                     aop_PQ[2] = SIMINT_MUL(a_over_p, PQ[2]);
223 
224                     SIMINT_DBLTYPE a_over_q = SIMINT_MUL(alpha, one_over_q);
225                     SIMINT_DBLTYPE aoq_PQ[3];
226                     aoq_PQ[0] = SIMINT_MUL(a_over_q, PQ[0]);
227                     aoq_PQ[1] = SIMINT_MUL(a_over_q, PQ[1]);
228                     aoq_PQ[2] = SIMINT_MUL(a_over_q, PQ[2]);
229                     // Put a minus sign here so we don't have to in RR routines
230                     a_over_q = SIMINT_NEG(a_over_q);
231 
232 
233                     //////////////////////////////////////////////
234                     // Fjt function section
235                     // Maximum v value: 11
236                     //////////////////////////////////////////////
237                     // The parameter to the Fjt function
238                     const SIMINT_DBLTYPE F_x = SIMINT_MUL(R2, alpha);
239 
240 
241                     const SIMINT_DBLTYPE Q_prefac = mask_load(nlane, Q.prefac + j);
242 
243 
244                     boys_F_split(PRIM_INT__s_s_s_s, F_x, 11);
245                     SIMINT_DBLTYPE prefac = SIMINT_SQRT(one_over_PQalpha_sum);
246                     prefac = SIMINT_MUL(SIMINT_MUL(P_prefac, Q_prefac), prefac);
247                     for(n = 0; n <= 11; n++)
248                         PRIM_INT__s_s_s_s[n] = SIMINT_MUL(PRIM_INT__s_s_s_s[n], prefac);
249 
250                     //////////////////////////////////////////////
251                     // Primitive integrals: Vertical recurrance
252                     //////////////////////////////////////////////
253 
254                     const SIMINT_DBLTYPE vrr_const_1_over_2p = one_over_2p;
255                     const SIMINT_DBLTYPE vrr_const_2_over_2p = SIMINT_MUL(const_2, one_over_2p);
256                     const SIMINT_DBLTYPE vrr_const_3_over_2p = SIMINT_MUL(const_3, one_over_2p);
257                     const SIMINT_DBLTYPE vrr_const_4_over_2p = SIMINT_MUL(const_4, one_over_2p);
258                     const SIMINT_DBLTYPE vrr_const_5_over_2p = SIMINT_MUL(const_5, one_over_2p);
259                     const SIMINT_DBLTYPE vrr_const_6_over_2p = SIMINT_MUL(const_6, one_over_2p);
260                     const SIMINT_DBLTYPE vrr_const_7_over_2p = SIMINT_MUL(const_7, one_over_2p);
261                     const SIMINT_DBLTYPE vrr_const_1_over_2q = one_over_2q;
262                     const SIMINT_DBLTYPE vrr_const_2_over_2q = SIMINT_MUL(const_2, one_over_2q);
263                     const SIMINT_DBLTYPE vrr_const_1_over_2pq = one_over_2pq;
264                     const SIMINT_DBLTYPE vrr_const_2_over_2pq = SIMINT_MUL(const_2, one_over_2pq);
265                     const SIMINT_DBLTYPE vrr_const_3_over_2pq = SIMINT_MUL(const_3, one_over_2pq);
266                     const SIMINT_DBLTYPE vrr_const_4_over_2pq = SIMINT_MUL(const_4, one_over_2pq);
267                     const SIMINT_DBLTYPE vrr_const_5_over_2pq = SIMINT_MUL(const_5, one_over_2pq);
268                     const SIMINT_DBLTYPE vrr_const_6_over_2pq = SIMINT_MUL(const_6, one_over_2pq);
269                     const SIMINT_DBLTYPE vrr_const_7_over_2pq = SIMINT_MUL(const_7, one_over_2pq);
270                     const SIMINT_DBLTYPE vrr_const_8_over_2pq = SIMINT_MUL(const_8, one_over_2pq);
271 
272 
273 
274                     // Forming PRIM_INT__p_s_s_s[11 * 3];
275                     for(n = 0; n < 11; ++n)  // loop over orders of auxiliary function
276                     {
277 
278                         PRIM_INT__p_s_s_s[n * 3 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_s_s[n * 1 + 0]);
279                         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]);
280 
281                         PRIM_INT__p_s_s_s[n * 3 + 1] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_s_s[n * 1 + 0]);
282                         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]);
283 
284                         PRIM_INT__p_s_s_s[n * 3 + 2] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_s_s[n * 1 + 0]);
285                         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]);
286 
287                     }
288 
289 
290 
291                     // Forming PRIM_INT__d_s_s_s[10 * 6];
292                     for(n = 0; n < 10; ++n)  // loop over orders of auxiliary function
293                     {
294 
295                         PRIM_INT__d_s_s_s[n * 6 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__p_s_s_s[n * 3 + 0]);
296                         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]);
297                         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]);
298 
299                         PRIM_INT__d_s_s_s[n * 6 + 1] = SIMINT_MUL(P_PA[1], PRIM_INT__p_s_s_s[n * 3 + 0]);
300                         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]);
301 
302                         PRIM_INT__d_s_s_s[n * 6 + 2] = SIMINT_MUL(P_PA[2], PRIM_INT__p_s_s_s[n * 3 + 0]);
303                         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]);
304 
305                         PRIM_INT__d_s_s_s[n * 6 + 3] = SIMINT_MUL(P_PA[1], PRIM_INT__p_s_s_s[n * 3 + 1]);
306                         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]);
307                         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]);
308 
309                         PRIM_INT__d_s_s_s[n * 6 + 4] = SIMINT_MUL(P_PA[2], PRIM_INT__p_s_s_s[n * 3 + 1]);
310                         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]);
311 
312                         PRIM_INT__d_s_s_s[n * 6 + 5] = SIMINT_MUL(P_PA[2], PRIM_INT__p_s_s_s[n * 3 + 2]);
313                         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]);
314                         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]);
315 
316                     }
317 
318 
319 
320                     // Forming PRIM_INT__f_s_s_s[9 * 10];
321                     for(n = 0; n < 9; ++n)  // loop over orders of auxiliary function
322                     {
323 
324                         PRIM_INT__f_s_s_s[n * 10 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__d_s_s_s[n * 6 + 0]);
325                         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]);
326                         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]);
327 
328                         PRIM_INT__f_s_s_s[n * 10 + 1] = SIMINT_MUL(P_PA[1], PRIM_INT__d_s_s_s[n * 6 + 0]);
329                         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]);
330 
331                         PRIM_INT__f_s_s_s[n * 10 + 2] = SIMINT_MUL(P_PA[2], PRIM_INT__d_s_s_s[n * 6 + 0]);
332                         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]);
333 
334                         PRIM_INT__f_s_s_s[n * 10 + 3] = SIMINT_MUL(P_PA[0], PRIM_INT__d_s_s_s[n * 6 + 3]);
335                         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]);
336 
337                         PRIM_INT__f_s_s_s[n * 10 + 4] = SIMINT_MUL(P_PA[2], PRIM_INT__d_s_s_s[n * 6 + 1]);
338                         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]);
339 
340                         PRIM_INT__f_s_s_s[n * 10 + 5] = SIMINT_MUL(P_PA[0], PRIM_INT__d_s_s_s[n * 6 + 5]);
341                         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]);
342 
343                         PRIM_INT__f_s_s_s[n * 10 + 6] = SIMINT_MUL(P_PA[1], PRIM_INT__d_s_s_s[n * 6 + 3]);
344                         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]);
345                         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]);
346 
347                         PRIM_INT__f_s_s_s[n * 10 + 7] = SIMINT_MUL(P_PA[2], PRIM_INT__d_s_s_s[n * 6 + 3]);
348                         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]);
349 
350                         PRIM_INT__f_s_s_s[n * 10 + 8] = SIMINT_MUL(P_PA[1], PRIM_INT__d_s_s_s[n * 6 + 5]);
351                         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]);
352 
353                         PRIM_INT__f_s_s_s[n * 10 + 9] = SIMINT_MUL(P_PA[2], PRIM_INT__d_s_s_s[n * 6 + 5]);
354                         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]);
355                         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]);
356 
357                     }
358 
359 
360                     VRR_I_g_s_s_s(
361                             PRIM_INT__g_s_s_s,
362                             PRIM_INT__f_s_s_s,
363                             PRIM_INT__d_s_s_s,
364                             P_PA,
365                             a_over_p,
366                             aop_PQ,
367                             one_over_2p,
368                             8);
369 
370 
371                     VRR_K_g_s_p_s(
372                             PRIM_INT__g_s_p_s,
373                             PRIM_INT__g_s_s_s,
374                             PRIM_INT__f_s_s_s,
375                             Q_PA,
376                             aoq_PQ,
377                             one_over_2pq,
378                             3);
379 
380 
381                     VRR_K_f_s_p_s(
382                             PRIM_INT__f_s_p_s,
383                             PRIM_INT__f_s_s_s,
384                             PRIM_INT__d_s_s_s,
385                             Q_PA,
386                             aoq_PQ,
387                             one_over_2pq,
388                             3);
389 
390 
391                     ostei_general_vrr_K(4, 0, 2, 0, 2,
392                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
393                             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);
394 
395 
396 
397                     // Forming PRIM_INT__d_s_p_s[3 * 18];
398                     for(n = 0; n < 3; ++n)  // loop over orders of auxiliary function
399                     {
400 
401                         PRIM_INT__d_s_p_s[n * 18 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__d_s_s_s[n * 6 + 0]);
402                         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]);
403                         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]);
404 
405                         PRIM_INT__d_s_p_s[n * 18 + 1] = SIMINT_MUL(Q_PA[1], PRIM_INT__d_s_s_s[n * 6 + 0]);
406                         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]);
407 
408                         PRIM_INT__d_s_p_s[n * 18 + 2] = SIMINT_MUL(Q_PA[2], PRIM_INT__d_s_s_s[n * 6 + 0]);
409                         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]);
410 
411                         PRIM_INT__d_s_p_s[n * 18 + 3] = SIMINT_MUL(Q_PA[0], PRIM_INT__d_s_s_s[n * 6 + 1]);
412                         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]);
413                         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]);
414 
415                         PRIM_INT__d_s_p_s[n * 18 + 4] = SIMINT_MUL(Q_PA[1], PRIM_INT__d_s_s_s[n * 6 + 1]);
416                         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]);
417                         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]);
418 
419                         PRIM_INT__d_s_p_s[n * 18 + 5] = SIMINT_MUL(Q_PA[2], PRIM_INT__d_s_s_s[n * 6 + 1]);
420                         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]);
421 
422                         PRIM_INT__d_s_p_s[n * 18 + 6] = SIMINT_MUL(Q_PA[0], PRIM_INT__d_s_s_s[n * 6 + 2]);
423                         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]);
424                         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]);
425 
426                         PRIM_INT__d_s_p_s[n * 18 + 7] = SIMINT_MUL(Q_PA[1], PRIM_INT__d_s_s_s[n * 6 + 2]);
427                         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]);
428 
429                         PRIM_INT__d_s_p_s[n * 18 + 8] = SIMINT_MUL(Q_PA[2], PRIM_INT__d_s_s_s[n * 6 + 2]);
430                         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]);
431                         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]);
432 
433                         PRIM_INT__d_s_p_s[n * 18 + 9] = SIMINT_MUL(Q_PA[0], PRIM_INT__d_s_s_s[n * 6 + 3]);
434                         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]);
435 
436                         PRIM_INT__d_s_p_s[n * 18 + 10] = SIMINT_MUL(Q_PA[1], PRIM_INT__d_s_s_s[n * 6 + 3]);
437                         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]);
438                         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]);
439 
440                         PRIM_INT__d_s_p_s[n * 18 + 11] = SIMINT_MUL(Q_PA[2], PRIM_INT__d_s_s_s[n * 6 + 3]);
441                         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]);
442 
443                         PRIM_INT__d_s_p_s[n * 18 + 12] = SIMINT_MUL(Q_PA[0], PRIM_INT__d_s_s_s[n * 6 + 4]);
444                         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]);
445 
446                         PRIM_INT__d_s_p_s[n * 18 + 13] = SIMINT_MUL(Q_PA[1], PRIM_INT__d_s_s_s[n * 6 + 4]);
447                         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]);
448                         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]);
449 
450                         PRIM_INT__d_s_p_s[n * 18 + 14] = SIMINT_MUL(Q_PA[2], PRIM_INT__d_s_s_s[n * 6 + 4]);
451                         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]);
452                         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]);
453 
454                         PRIM_INT__d_s_p_s[n * 18 + 15] = SIMINT_MUL(Q_PA[0], PRIM_INT__d_s_s_s[n * 6 + 5]);
455                         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]);
456 
457                         PRIM_INT__d_s_p_s[n * 18 + 16] = SIMINT_MUL(Q_PA[1], PRIM_INT__d_s_s_s[n * 6 + 5]);
458                         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]);
459 
460                         PRIM_INT__d_s_p_s[n * 18 + 17] = SIMINT_MUL(Q_PA[2], PRIM_INT__d_s_s_s[n * 6 + 5]);
461                         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]);
462                         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]);
463 
464                     }
465 
466 
467                     VRR_K_f_s_d_s(
468                             PRIM_INT__f_s_d_s,
469                             PRIM_INT__f_s_p_s,
470                             PRIM_INT__f_s_s_s,
471                             PRIM_INT__d_s_p_s,
472                             Q_PA,
473                             a_over_q,
474                             aoq_PQ,
475                             one_over_2pq,
476                             one_over_2q,
477                             2);
478 
479 
480                     ostei_general_vrr_K(4, 0, 3, 0, 1,
481                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
482                             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);
483 
484 
485                     VRR_I_h_s_s_s(
486                             PRIM_INT__h_s_s_s,
487                             PRIM_INT__g_s_s_s,
488                             PRIM_INT__f_s_s_s,
489                             P_PA,
490                             a_over_p,
491                             aop_PQ,
492                             one_over_2p,
493                             7);
494 
495 
496                     ostei_general_vrr_K(5, 0, 1, 0, 3,
497                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
498                             PRIM_INT__h_s_s_s, NULL, NULL, PRIM_INT__g_s_s_s, NULL, PRIM_INT__h_s_p_s);
499 
500 
501                     ostei_general_vrr_K(5, 0, 2, 0, 2,
502                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
503                             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);
504 
505 
506                     ostei_general_vrr_K(5, 0, 3, 0, 1,
507                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
508                             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);
509 
510 
511                     ostei_general_vrr1_I(6, 6,
512                             one_over_2p, a_over_p, aop_PQ, P_PA,
513                             PRIM_INT__h_s_s_s, PRIM_INT__g_s_s_s, PRIM_INT__i_s_s_s);
514 
515 
516                     ostei_general_vrr_K(6, 0, 1, 0, 3,
517                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
518                             PRIM_INT__i_s_s_s, NULL, NULL, PRIM_INT__h_s_s_s, NULL, PRIM_INT__i_s_p_s);
519 
520 
521                     ostei_general_vrr_K(6, 0, 2, 0, 2,
522                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
523                             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);
524 
525 
526                     ostei_general_vrr_K(6, 0, 3, 0, 1,
527                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
528                             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);
529 
530 
531                     ostei_general_vrr1_I(7, 5,
532                             one_over_2p, a_over_p, aop_PQ, P_PA,
533                             PRIM_INT__i_s_s_s, PRIM_INT__h_s_s_s, PRIM_INT__k_s_s_s);
534 
535 
536                     ostei_general_vrr_K(7, 0, 1, 0, 3,
537                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
538                             PRIM_INT__k_s_s_s, NULL, NULL, PRIM_INT__i_s_s_s, NULL, PRIM_INT__k_s_p_s);
539 
540 
541                     ostei_general_vrr_K(7, 0, 2, 0, 2,
542                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
543                             PRIM_INT__k_s_p_s, PRIM_INT__k_s_s_s, NULL, PRIM_INT__i_s_p_s, NULL, PRIM_INT__k_s_d_s);
544 
545 
546                     ostei_general_vrr_K(7, 0, 3, 0, 1,
547                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
548                             PRIM_INT__k_s_d_s, PRIM_INT__k_s_p_s, NULL, PRIM_INT__i_s_d_s, NULL, PRIM_INT__k_s_f_s);
549 
550 
551                     ostei_general_vrr1_I(8, 4,
552                             one_over_2p, a_over_p, aop_PQ, P_PA,
553                             PRIM_INT__k_s_s_s, PRIM_INT__i_s_s_s, PRIM_INT__l_s_s_s);
554 
555 
556                     ostei_general_vrr_K(8, 0, 1, 0, 3,
557                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
558                             PRIM_INT__l_s_s_s, NULL, NULL, PRIM_INT__k_s_s_s, NULL, PRIM_INT__l_s_p_s);
559 
560 
561                     ostei_general_vrr_K(8, 0, 2, 0, 2,
562                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
563                             PRIM_INT__l_s_p_s, PRIM_INT__l_s_s_s, NULL, PRIM_INT__k_s_p_s, NULL, PRIM_INT__l_s_d_s);
564 
565 
566                     ostei_general_vrr_K(8, 0, 3, 0, 1,
567                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PA,
568                             PRIM_INT__l_s_d_s, PRIM_INT__l_s_p_s, NULL, PRIM_INT__k_s_d_s, NULL, PRIM_INT__l_s_f_s);
569 
570 
571 
572 
573                     ////////////////////////////////////
574                     // Accumulate contracted integrals
575                     ////////////////////////////////////
576                     if(lastoffset == 0)
577                     {
578                         contract_all(150, PRIM_INT__g_s_f_s, PRIM_PTR_INT__g_s_f_s);
579                         contract_all(210, PRIM_INT__h_s_f_s, PRIM_PTR_INT__h_s_f_s);
580                         contract_all(280, PRIM_INT__i_s_f_s, PRIM_PTR_INT__i_s_f_s);
581                         contract_all(360, PRIM_INT__k_s_f_s, PRIM_PTR_INT__k_s_f_s);
582                         contract_all(450, PRIM_INT__l_s_f_s, PRIM_PTR_INT__l_s_f_s);
583                     }
584                     else
585                     {
586                         contract(150, shelloffsets, PRIM_INT__g_s_f_s, PRIM_PTR_INT__g_s_f_s);
587                         contract(210, shelloffsets, PRIM_INT__h_s_f_s, PRIM_PTR_INT__h_s_f_s);
588                         contract(280, shelloffsets, PRIM_INT__i_s_f_s, PRIM_PTR_INT__i_s_f_s);
589                         contract(360, shelloffsets, PRIM_INT__k_s_f_s, PRIM_PTR_INT__k_s_f_s);
590                         contract(450, shelloffsets, PRIM_INT__l_s_f_s, PRIM_PTR_INT__l_s_f_s);
591                         PRIM_PTR_INT__g_s_f_s += lastoffset*150;
592                         PRIM_PTR_INT__h_s_f_s += lastoffset*210;
593                         PRIM_PTR_INT__i_s_f_s += lastoffset*280;
594                         PRIM_PTR_INT__k_s_f_s += lastoffset*360;
595                         PRIM_PTR_INT__l_s_f_s += lastoffset*450;
596                     }
597 
598                 }  // close loop over j
599             }  // close loop over i
600 
601             //Advance to the next batch
602             jstart = SIMINT_SIMD_ROUND(jend);
603 
604             //////////////////////////////////////////////
605             // Contracted integrals: Horizontal recurrance
606             //////////////////////////////////////////////
607 
608 
609             const double hAB[3] = { P.AB_x[ab], P.AB_y[ab], P.AB_z[ab] };
610 
611 
612             for(abcd = 0; abcd < nshellbatch; ++abcd, ++real_abcd)
613             {
614 
615                 // set up HRR pointers
616                 double const * restrict HRR_INT__g_s_f_s = INT__g_s_f_s + abcd * 150;
617                 double const * restrict HRR_INT__h_s_f_s = INT__h_s_f_s + abcd * 210;
618                 double const * restrict HRR_INT__i_s_f_s = INT__i_s_f_s + abcd * 280;
619                 double const * restrict HRR_INT__k_s_f_s = INT__k_s_f_s + abcd * 360;
620                 double const * restrict HRR_INT__l_s_f_s = INT__l_s_f_s + abcd * 450;
621                 double * restrict HRR_INT__g_g_f_s = INT__g_g_f_s + real_abcd * 2250;
622 
623                 // form INT__g_p_f_s
624                 HRR_J_g_p(
625                     HRR_INT__g_p_f_s,
626                     HRR_INT__g_s_f_s,
627                     HRR_INT__h_s_f_s,
628                     hAB, 10);
629 
630                 // form INT__h_p_f_s
631                 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);
632 
633                 // form INT__i_p_f_s
634                 ostei_general_hrr_J(6, 1, 3, 0, hAB, HRR_INT__k_s_f_s, HRR_INT__i_s_f_s, HRR_INT__i_p_f_s);
635 
636                 // form INT__k_p_f_s
637                 ostei_general_hrr_J(7, 1, 3, 0, hAB, HRR_INT__l_s_f_s, HRR_INT__k_s_f_s, HRR_INT__k_p_f_s);
638 
639                 // form INT__g_d_f_s
640                 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);
641 
642                 // form INT__h_d_f_s
643                 ostei_general_hrr_J(5, 2, 3, 0, hAB, HRR_INT__i_p_f_s, HRR_INT__h_p_f_s, HRR_INT__h_d_f_s);
644 
645                 // form INT__i_d_f_s
646                 ostei_general_hrr_J(6, 2, 3, 0, hAB, HRR_INT__k_p_f_s, HRR_INT__i_p_f_s, HRR_INT__i_d_f_s);
647 
648                 // form INT__g_f_f_s
649                 ostei_general_hrr_J(4, 3, 3, 0, hAB, HRR_INT__h_d_f_s, HRR_INT__g_d_f_s, HRR_INT__g_f_f_s);
650 
651                 // form INT__h_f_f_s
652                 ostei_general_hrr_J(5, 3, 3, 0, hAB, HRR_INT__i_d_f_s, HRR_INT__h_d_f_s, HRR_INT__h_f_f_s);
653 
654                 // form INT__g_g_f_s
655                 ostei_general_hrr_J(4, 4, 3, 0, hAB, HRR_INT__h_f_f_s, HRR_INT__g_f_f_s, HRR_INT__g_g_f_s);
656 
657 
658             }  // close HRR loop
659 
660 
661         }   // close loop cdbatch
662 
663         istart = iend;
664     }  // close loop over ab
665 
666     return P.nshell12_clip * Q.nshell12_clip;
667 }
668 
ostei_g_g_s_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_g_s_f)669 int ostei_g_g_s_f(struct simint_multi_shellpair const P,
670                   struct simint_multi_shellpair const Q,
671                   double screen_tol,
672                   double * const restrict work,
673                   double * const restrict INT__g_g_s_f)
674 {
675     double Q_AB[3*Q.nshell12];
676     struct simint_multi_shellpair Q_tmp = Q;
677     Q_tmp.PA_x = Q.PB_x;  Q_tmp.PA_y = Q.PB_y;  Q_tmp.PA_z = Q.PB_z;
678     Q_tmp.PB_x = Q.PA_x;  Q_tmp.PB_y = Q.PA_y;  Q_tmp.PB_z = Q.PA_z;
679     Q_tmp.AB_x = Q_AB;
680     Q_tmp.AB_y = Q_AB + Q.nshell12;
681     Q_tmp.AB_z = Q_AB + 2*Q.nshell12;
682 
683     for(int i = 0; i < Q.nshell12; i++)
684     {
685         Q_tmp.AB_x[i] = -Q.AB_x[i];
686         Q_tmp.AB_y[i] = -Q.AB_y[i];
687         Q_tmp.AB_z[i] = -Q.AB_z[i];
688     }
689 
690     int ret = ostei_g_g_f_s(P, Q_tmp, screen_tol, work, INT__g_g_s_f);
691     double buffer[2250] SIMINT_ALIGN_ARRAY_DBL;
692 
693     for(int q = 0; q < ret; q++)
694     {
695         int idx = 0;
696         for(int a = 0; a < 15; ++a)
697         for(int b = 0; b < 15; ++b)
698         for(int c = 0; c < 1; ++c)
699         for(int d = 0; d < 10; ++d)
700             buffer[idx++] = INT__g_g_s_f[q*2250+a*150+b*10+d*1+c];
701 
702         memcpy(INT__g_g_s_f+q*2250, buffer, 2250*sizeof(double));
703     }
704 
705     return ret;
706 }
707 
708