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