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_s_s_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__s_s_f_d)8 int ostei_s_s_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__s_s_f_d)
13 {
14 
15     SIMINT_ASSUME_ALIGN_DBL(work);
16     SIMINT_ASSUME_ALIGN_DBL(INT__s_s_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 ibra;
26 
27     // partition workspace
28     double * const INT__s_s_f_s = work + (SIMINT_NSHELL_SIMD * 0);
29     double * const INT__s_s_g_s = work + (SIMINT_NSHELL_SIMD * 10);
30     double * const INT__s_s_h_s = work + (SIMINT_NSHELL_SIMD * 25);
31     SIMINT_DBLTYPE * const primwork = (SIMINT_DBLTYPE *)(work + SIMINT_NSHELL_SIMD*46);
32     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_s_s = primwork + 0;
33     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_p_s = primwork + 6;
34     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_d_s = primwork + 21;
35     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_f_s = primwork + 45;
36     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_g_s = primwork + 75;
37     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_h_s = primwork + 105;
38     double * const hrrwork = (double *)(primwork + 126);
39     double * const HRR_INT__s_s_f_p = hrrwork + 0;
40     double * const HRR_INT__s_s_g_p = hrrwork + 30;
41 
42 
43     // Create constants
44     const SIMINT_DBLTYPE const_1 = SIMINT_DBLSET1(1);
45     const SIMINT_DBLTYPE const_2 = SIMINT_DBLSET1(2);
46     const SIMINT_DBLTYPE const_3 = SIMINT_DBLSET1(3);
47     const SIMINT_DBLTYPE const_4 = SIMINT_DBLSET1(4);
48     const SIMINT_DBLTYPE one_half = SIMINT_DBLSET1(0.5);
49 
50 
51     ////////////////////////////////////////
52     // Loop over shells and primitives
53     ////////////////////////////////////////
54 
55     real_abcd = 0;
56     istart = 0;
57     for(ab = 0; ab < P.nshell12_clip; ++ab)
58     {
59         const int iend = istart + P.nprim12[ab];
60 
61         cd = 0;
62         jstart = 0;
63 
64         for(cd = 0; cd < Q.nshell12_clip; cd += SIMINT_NSHELL_SIMD)
65         {
66             const int nshellbatch = ((cd + SIMINT_NSHELL_SIMD) > Q.nshell12_clip) ? Q.nshell12_clip - cd : SIMINT_NSHELL_SIMD;
67             int jend = jstart;
68             for(i = 0; i < nshellbatch; i++)
69                 jend += Q.nprim12[cd+i];
70 
71             // Clear the beginning of the workspace (where we are accumulating integrals)
72             memset(work, 0, SIMINT_NSHELL_SIMD * 46 * sizeof(double));
73             abcd = 0;
74 
75 
76             for(i = istart; i < iend; ++i)
77             {
78                 SIMINT_DBLTYPE bra_screen_max;  // only used if check_screen
79 
80                 if(check_screen)
81                 {
82                     // Skip this whole thing if always insignificant
83                     if((P.screen[i] * Q.screen_max) < screen_tol)
84                         continue;
85                     bra_screen_max = SIMINT_DBLSET1(P.screen[i]);
86                 }
87 
88                 icd = 0;
89                 iprimcd = 0;
90                 nprim_icd = Q.nprim12[cd];
91                 double * restrict PRIM_PTR_INT__s_s_f_s = INT__s_s_f_s + abcd * 10;
92                 double * restrict PRIM_PTR_INT__s_s_g_s = INT__s_s_g_s + abcd * 15;
93                 double * restrict PRIM_PTR_INT__s_s_h_s = INT__s_s_h_s + abcd * 21;
94 
95 
96 
97                 // Load these one per loop over i
98                 const SIMINT_DBLTYPE P_alpha = SIMINT_DBLSET1(P.alpha[i]);
99                 const SIMINT_DBLTYPE P_prefac = SIMINT_DBLSET1(P.prefac[i]);
100                 const SIMINT_DBLTYPE Pxyz[3] = { SIMINT_DBLSET1(P.x[i]), SIMINT_DBLSET1(P.y[i]), SIMINT_DBLSET1(P.z[i]) };
101 
102 
103                 for(j = jstart; j < jend; j += SIMINT_SIMD_LEN)
104                 {
105                     // calculate the shell offsets
106                     // these are the offset from the shell pointed to by cd
107                     // for each element
108                     int shelloffsets[SIMINT_SIMD_LEN] = {0};
109                     int lastoffset = 0;
110                     const int nlane = ( ((j + SIMINT_SIMD_LEN) < jend) ? SIMINT_SIMD_LEN : (jend - j));
111 
112                     if((iprimcd + SIMINT_SIMD_LEN) >= nprim_icd)
113                     {
114                         // Handle if the first element of the vector is a new shell
115                         if(iprimcd >= nprim_icd && ((icd+1) < nshellbatch))
116                         {
117                             nprim_icd += Q.nprim12[cd + (++icd)];
118                             PRIM_PTR_INT__s_s_f_s += 10;
119                             PRIM_PTR_INT__s_s_g_s += 15;
120                             PRIM_PTR_INT__s_s_h_s += 21;
121                         }
122                         iprimcd++;
123                         for(n = 1; n < SIMINT_SIMD_LEN; ++n)
124                         {
125                             if(iprimcd >= nprim_icd && ((icd+1) < nshellbatch))
126                             {
127                                 shelloffsets[n] = shelloffsets[n-1] + 1;
128                                 lastoffset++;
129                                 nprim_icd += Q.nprim12[cd + (++icd)];
130                             }
131                             else
132                                 shelloffsets[n] = shelloffsets[n-1];
133                             iprimcd++;
134                         }
135                     }
136                     else
137                         iprimcd += SIMINT_SIMD_LEN;
138 
139                     // Do we have to compute this vector (or has it been screened out)?
140                     // (not_screened != 0 means we have to do this vector)
141                     if(check_screen)
142                     {
143                         const double vmax = vector_max(SIMINT_MUL(bra_screen_max, SIMINT_DBLLOAD(Q.screen, j)));
144                         if(vmax < screen_tol)
145                         {
146                             PRIM_PTR_INT__s_s_f_s += lastoffset*10;
147                             PRIM_PTR_INT__s_s_g_s += lastoffset*15;
148                             PRIM_PTR_INT__s_s_h_s += lastoffset*21;
149                             continue;
150                         }
151                     }
152 
153                     const SIMINT_DBLTYPE Q_alpha = SIMINT_DBLLOAD(Q.alpha, j);
154                     const SIMINT_DBLTYPE PQalpha_mul = SIMINT_MUL(P_alpha, Q_alpha);
155                     const SIMINT_DBLTYPE PQalpha_sum = SIMINT_ADD(P_alpha, Q_alpha);
156                     const SIMINT_DBLTYPE one_over_PQalpha_sum = SIMINT_DIV(const_1, PQalpha_sum);
157 
158 
159                     /* construct R2 = (Px - Qx)**2 + (Py - Qy)**2 + (Pz -Qz)**2 */
160                     SIMINT_DBLTYPE PQ[3];
161                     PQ[0] = SIMINT_SUB(Pxyz[0], SIMINT_DBLLOAD(Q.x, j));
162                     PQ[1] = SIMINT_SUB(Pxyz[1], SIMINT_DBLLOAD(Q.y, j));
163                     PQ[2] = SIMINT_SUB(Pxyz[2], SIMINT_DBLLOAD(Q.z, j));
164                     SIMINT_DBLTYPE R2 = SIMINT_MUL(PQ[0], PQ[0]);
165                     R2 = SIMINT_FMADD(PQ[1], PQ[1], R2);
166                     R2 = SIMINT_FMADD(PQ[2], PQ[2], R2);
167 
168                     const SIMINT_DBLTYPE alpha = SIMINT_MUL(PQalpha_mul, one_over_PQalpha_sum); // alpha from MEST
169                     const SIMINT_DBLTYPE one_over_p = SIMINT_DIV(const_1, P_alpha);
170                     const SIMINT_DBLTYPE one_over_q = SIMINT_DIV(const_1, Q_alpha);
171                     const SIMINT_DBLTYPE one_over_2p = SIMINT_MUL(one_half, one_over_p);
172                     const SIMINT_DBLTYPE one_over_2q = SIMINT_MUL(one_half, one_over_q);
173                     const SIMINT_DBLTYPE one_over_2pq = SIMINT_MUL(one_half, one_over_PQalpha_sum);
174                     const SIMINT_DBLTYPE Q_PA[3] = { SIMINT_DBLLOAD(Q.PA_x, j), SIMINT_DBLLOAD(Q.PA_y, j), SIMINT_DBLLOAD(Q.PA_z, j) };
175 
176                     SIMINT_DBLTYPE a_over_q = SIMINT_MUL(alpha, one_over_q);
177                     SIMINT_DBLTYPE aoq_PQ[3];
178                     aoq_PQ[0] = SIMINT_MUL(a_over_q, PQ[0]);
179                     aoq_PQ[1] = SIMINT_MUL(a_over_q, PQ[1]);
180                     aoq_PQ[2] = SIMINT_MUL(a_over_q, PQ[2]);
181                     // Put a minus sign here so we don't have to in RR routines
182                     a_over_q = SIMINT_NEG(a_over_q);
183 
184 
185                     //////////////////////////////////////////////
186                     // Fjt function section
187                     // Maximum v value: 5
188                     //////////////////////////////////////////////
189                     // The parameter to the Fjt function
190                     const SIMINT_DBLTYPE F_x = SIMINT_MUL(R2, alpha);
191 
192 
193                     const SIMINT_DBLTYPE Q_prefac = mask_load(nlane, Q.prefac + j);
194 
195 
196                     boys_F_split(PRIM_INT__s_s_s_s, F_x, 5);
197                     SIMINT_DBLTYPE prefac = SIMINT_SQRT(one_over_PQalpha_sum);
198                     prefac = SIMINT_MUL(SIMINT_MUL(P_prefac, Q_prefac), prefac);
199                     for(n = 0; n <= 5; n++)
200                         PRIM_INT__s_s_s_s[n] = SIMINT_MUL(PRIM_INT__s_s_s_s[n], prefac);
201 
202                     //////////////////////////////////////////////
203                     // Primitive integrals: Vertical recurrance
204                     //////////////////////////////////////////////
205 
206                     const SIMINT_DBLTYPE vrr_const_1_over_2q = one_over_2q;
207                     const SIMINT_DBLTYPE vrr_const_2_over_2q = SIMINT_MUL(const_2, one_over_2q);
208                     const SIMINT_DBLTYPE vrr_const_3_over_2q = SIMINT_MUL(const_3, one_over_2q);
209                     const SIMINT_DBLTYPE vrr_const_4_over_2q = SIMINT_MUL(const_4, one_over_2q);
210 
211 
212 
213                     // Forming PRIM_INT__s_s_p_s[5 * 3];
214                     for(n = 0; n < 5; ++n)  // loop over orders of auxiliary function
215                     {
216 
217                         PRIM_INT__s_s_p_s[n * 3 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__s_s_s_s[n * 1 + 0]);
218                         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]);
219 
220                         PRIM_INT__s_s_p_s[n * 3 + 1] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_s_s[n * 1 + 0]);
221                         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]);
222 
223                         PRIM_INT__s_s_p_s[n * 3 + 2] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_s_s[n * 1 + 0]);
224                         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]);
225 
226                     }
227 
228 
229 
230                     // Forming PRIM_INT__s_s_d_s[4 * 6];
231                     for(n = 0; n < 4; ++n)  // loop over orders of auxiliary function
232                     {
233 
234                         PRIM_INT__s_s_d_s[n * 6 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__s_s_p_s[n * 3 + 0]);
235                         PRIM_INT__s_s_d_s[n * 6 + 0] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__s_s_p_s[(n+1) * 3 + 0], PRIM_INT__s_s_d_s[n * 6 + 0]);
236                         PRIM_INT__s_s_d_s[n * 6 + 0] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__s_s_s_s[n * 1 + 0]), PRIM_INT__s_s_d_s[n * 6 + 0]);
237 
238                         PRIM_INT__s_s_d_s[n * 6 + 1] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_p_s[n * 3 + 0]);
239                         PRIM_INT__s_s_d_s[n * 6 + 1] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__s_s_p_s[(n+1) * 3 + 0], PRIM_INT__s_s_d_s[n * 6 + 1]);
240 
241                         PRIM_INT__s_s_d_s[n * 6 + 3] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_p_s[n * 3 + 1]);
242                         PRIM_INT__s_s_d_s[n * 6 + 3] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__s_s_p_s[(n+1) * 3 + 1], PRIM_INT__s_s_d_s[n * 6 + 3]);
243                         PRIM_INT__s_s_d_s[n * 6 + 3] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__s_s_s_s[n * 1 + 0]), PRIM_INT__s_s_d_s[n * 6 + 3]);
244 
245                         PRIM_INT__s_s_d_s[n * 6 + 5] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_p_s[n * 3 + 2]);
246                         PRIM_INT__s_s_d_s[n * 6 + 5] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__s_s_p_s[(n+1) * 3 + 2], PRIM_INT__s_s_d_s[n * 6 + 5]);
247                         PRIM_INT__s_s_d_s[n * 6 + 5] = SIMINT_FMADD( vrr_const_1_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__s_s_s_s[n * 1 + 0]), PRIM_INT__s_s_d_s[n * 6 + 5]);
248 
249                     }
250 
251 
252 
253                     // Forming PRIM_INT__s_s_f_s[3 * 10];
254                     for(n = 0; n < 3; ++n)  // loop over orders of auxiliary function
255                     {
256 
257                         PRIM_INT__s_s_f_s[n * 10 + 0] = SIMINT_MUL(Q_PA[0], PRIM_INT__s_s_d_s[n * 6 + 0]);
258                         PRIM_INT__s_s_f_s[n * 10 + 0] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__s_s_d_s[(n+1) * 6 + 0], PRIM_INT__s_s_f_s[n * 10 + 0]);
259                         PRIM_INT__s_s_f_s[n * 10 + 0] = SIMINT_FMADD( vrr_const_2_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__s_s_p_s[(n+1) * 3 + 0], PRIM_INT__s_s_p_s[n * 3 + 0]), PRIM_INT__s_s_f_s[n * 10 + 0]);
260 
261                         PRIM_INT__s_s_f_s[n * 10 + 1] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_d_s[n * 6 + 0]);
262                         PRIM_INT__s_s_f_s[n * 10 + 1] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__s_s_d_s[(n+1) * 6 + 0], PRIM_INT__s_s_f_s[n * 10 + 1]);
263 
264                         PRIM_INT__s_s_f_s[n * 10 + 2] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_d_s[n * 6 + 0]);
265                         PRIM_INT__s_s_f_s[n * 10 + 2] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__s_s_d_s[(n+1) * 6 + 0], PRIM_INT__s_s_f_s[n * 10 + 2]);
266 
267                         PRIM_INT__s_s_f_s[n * 10 + 3] = SIMINT_MUL(Q_PA[0], PRIM_INT__s_s_d_s[n * 6 + 3]);
268                         PRIM_INT__s_s_f_s[n * 10 + 3] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__s_s_d_s[(n+1) * 6 + 3], PRIM_INT__s_s_f_s[n * 10 + 3]);
269 
270                         PRIM_INT__s_s_f_s[n * 10 + 4] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_d_s[n * 6 + 1]);
271                         PRIM_INT__s_s_f_s[n * 10 + 4] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__s_s_d_s[(n+1) * 6 + 1], PRIM_INT__s_s_f_s[n * 10 + 4]);
272 
273                         PRIM_INT__s_s_f_s[n * 10 + 5] = SIMINT_MUL(Q_PA[0], PRIM_INT__s_s_d_s[n * 6 + 5]);
274                         PRIM_INT__s_s_f_s[n * 10 + 5] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__s_s_d_s[(n+1) * 6 + 5], PRIM_INT__s_s_f_s[n * 10 + 5]);
275 
276                         PRIM_INT__s_s_f_s[n * 10 + 6] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_d_s[n * 6 + 3]);
277                         PRIM_INT__s_s_f_s[n * 10 + 6] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__s_s_d_s[(n+1) * 6 + 3], PRIM_INT__s_s_f_s[n * 10 + 6]);
278                         PRIM_INT__s_s_f_s[n * 10 + 6] = SIMINT_FMADD( vrr_const_2_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__s_s_p_s[(n+1) * 3 + 1], PRIM_INT__s_s_p_s[n * 3 + 1]), PRIM_INT__s_s_f_s[n * 10 + 6]);
279 
280                         PRIM_INT__s_s_f_s[n * 10 + 7] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_d_s[n * 6 + 3]);
281                         PRIM_INT__s_s_f_s[n * 10 + 7] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__s_s_d_s[(n+1) * 6 + 3], PRIM_INT__s_s_f_s[n * 10 + 7]);
282 
283                         PRIM_INT__s_s_f_s[n * 10 + 8] = SIMINT_MUL(Q_PA[1], PRIM_INT__s_s_d_s[n * 6 + 5]);
284                         PRIM_INT__s_s_f_s[n * 10 + 8] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__s_s_d_s[(n+1) * 6 + 5], PRIM_INT__s_s_f_s[n * 10 + 8]);
285 
286                         PRIM_INT__s_s_f_s[n * 10 + 9] = SIMINT_MUL(Q_PA[2], PRIM_INT__s_s_d_s[n * 6 + 5]);
287                         PRIM_INT__s_s_f_s[n * 10 + 9] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__s_s_d_s[(n+1) * 6 + 5], PRIM_INT__s_s_f_s[n * 10 + 9]);
288                         PRIM_INT__s_s_f_s[n * 10 + 9] = SIMINT_FMADD( vrr_const_2_over_2q, SIMINT_FMADD(a_over_q, PRIM_INT__s_s_p_s[(n+1) * 3 + 2], PRIM_INT__s_s_p_s[n * 3 + 2]), PRIM_INT__s_s_f_s[n * 10 + 9]);
289 
290                     }
291 
292 
293                     VRR_K_s_s_g_s(
294                             PRIM_INT__s_s_g_s,
295                             PRIM_INT__s_s_f_s,
296                             PRIM_INT__s_s_d_s,
297                             Q_PA,
298                             a_over_q,
299                             aoq_PQ,
300                             one_over_2q,
301                             2);
302 
303 
304                     VRR_K_s_s_h_s(
305                             PRIM_INT__s_s_h_s,
306                             PRIM_INT__s_s_g_s,
307                             PRIM_INT__s_s_f_s,
308                             Q_PA,
309                             a_over_q,
310                             aoq_PQ,
311                             one_over_2q,
312                             1);
313 
314 
315 
316 
317                     ////////////////////////////////////
318                     // Accumulate contracted integrals
319                     ////////////////////////////////////
320                     if(lastoffset == 0)
321                     {
322                         contract_all(10, PRIM_INT__s_s_f_s, PRIM_PTR_INT__s_s_f_s);
323                         contract_all(15, PRIM_INT__s_s_g_s, PRIM_PTR_INT__s_s_g_s);
324                         contract_all(21, PRIM_INT__s_s_h_s, PRIM_PTR_INT__s_s_h_s);
325                     }
326                     else
327                     {
328                         contract(10, shelloffsets, PRIM_INT__s_s_f_s, PRIM_PTR_INT__s_s_f_s);
329                         contract(15, shelloffsets, PRIM_INT__s_s_g_s, PRIM_PTR_INT__s_s_g_s);
330                         contract(21, shelloffsets, PRIM_INT__s_s_h_s, PRIM_PTR_INT__s_s_h_s);
331                         PRIM_PTR_INT__s_s_f_s += lastoffset*10;
332                         PRIM_PTR_INT__s_s_g_s += lastoffset*15;
333                         PRIM_PTR_INT__s_s_h_s += lastoffset*21;
334                     }
335 
336                 }  // close loop over j
337             }  // close loop over i
338 
339             //Advance to the next batch
340             jstart = SIMINT_SIMD_ROUND(jend);
341 
342             //////////////////////////////////////////////
343             // Contracted integrals: Horizontal recurrance
344             //////////////////////////////////////////////
345 
346 
347 
348 
349             for(abcd = 0; abcd < nshellbatch; ++abcd, ++real_abcd)
350             {
351                 const double hCD[3] = { Q.AB_x[cd+abcd], Q.AB_y[cd+abcd], Q.AB_z[cd+abcd] };
352 
353                 // set up HRR pointers
354                 double const * restrict HRR_INT__s_s_f_s = INT__s_s_f_s + abcd * 10;
355                 double const * restrict HRR_INT__s_s_g_s = INT__s_s_g_s + abcd * 15;
356                 double const * restrict HRR_INT__s_s_h_s = INT__s_s_h_s + abcd * 21;
357                 double * restrict HRR_INT__s_s_f_d = INT__s_s_f_d + real_abcd * 60;
358 
359                 // form INT__s_s_f_p
360                 HRR_L_f_p(
361                     HRR_INT__s_s_f_p,
362                     HRR_INT__s_s_f_s,
363                     HRR_INT__s_s_g_s,
364                     hCD, 1);
365 
366                 // form INT__s_s_g_p
367                 HRR_L_g_p(
368                     HRR_INT__s_s_g_p,
369                     HRR_INT__s_s_g_s,
370                     HRR_INT__s_s_h_s,
371                     hCD, 1);
372 
373                 // form INT__s_s_f_d
374                 HRR_L_f_d(
375                     HRR_INT__s_s_f_d,
376                     HRR_INT__s_s_f_p,
377                     HRR_INT__s_s_g_p,
378                     hCD, 1);
379 
380 
381             }  // close HRR loop
382 
383 
384         }   // close loop cdbatch
385 
386         istart = iend;
387     }  // close loop over ab
388 
389     return P.nshell12_clip * Q.nshell12_clip;
390 }
391 
392