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_f_f_p_f(struct simint_multi_shellpair const P,struct simint_multi_shellpair const Q,double screen_tol,double * const restrict work,double * const restrict INT__f_f_p_f)8 int ostei_f_f_p_f(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__f_f_p_f)
13 {
14 
15     SIMINT_ASSUME_ALIGN_DBL(work);
16     SIMINT_ASSUME_ALIGN_DBL(INT__f_f_p_f);
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__f_s_s_f = work + (SIMINT_NSHELL_SIMD * 0);
30     double * const INT__f_s_s_g = work + (SIMINT_NSHELL_SIMD * 100);
31     double * const INT__g_s_s_f = work + (SIMINT_NSHELL_SIMD * 250);
32     double * const INT__g_s_s_g = work + (SIMINT_NSHELL_SIMD * 400);
33     double * const INT__h_s_s_f = work + (SIMINT_NSHELL_SIMD * 625);
34     double * const INT__h_s_s_g = work + (SIMINT_NSHELL_SIMD * 835);
35     double * const INT__i_s_s_f = work + (SIMINT_NSHELL_SIMD * 1150);
36     double * const INT__i_s_s_g = work + (SIMINT_NSHELL_SIMD * 1430);
37     SIMINT_DBLTYPE * const primwork = (SIMINT_DBLTYPE *)(work + SIMINT_NSHELL_SIMD*1850);
38     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_s_s = primwork + 0;
39     SIMINT_DBLTYPE * const restrict PRIM_INT__s_s_s_p = primwork + 11;
40     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_s_s = primwork + 23;
41     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_s_p = primwork + 53;
42     SIMINT_DBLTYPE * const restrict PRIM_INT__p_s_s_d = primwork + 89;
43     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_s_s = primwork + 143;
44     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_s_p = primwork + 197;
45     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_s_d = primwork + 269;
46     SIMINT_DBLTYPE * const restrict PRIM_INT__d_s_s_f = primwork + 377;
47     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_s_s = primwork + 497;
48     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_s_p = primwork + 577;
49     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_s_d = primwork + 697;
50     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_s_f = primwork + 877;
51     SIMINT_DBLTYPE * const restrict PRIM_INT__f_s_s_g = primwork + 1077;
52     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_s_s = primwork + 1227;
53     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_s_p = primwork + 1332;
54     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_s_d = primwork + 1512;
55     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_s_f = primwork + 1782;
56     SIMINT_DBLTYPE * const restrict PRIM_INT__g_s_s_g = primwork + 2082;
57     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_s_s = primwork + 2307;
58     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_s_p = primwork + 2433;
59     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_s_d = primwork + 2685;
60     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_s_f = primwork + 3063;
61     SIMINT_DBLTYPE * const restrict PRIM_INT__h_s_s_g = primwork + 3483;
62     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_s_s = primwork + 3798;
63     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_s_p = primwork + 3938;
64     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_s_d = primwork + 4274;
65     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_s_f = primwork + 4778;
66     SIMINT_DBLTYPE * const restrict PRIM_INT__i_s_s_g = primwork + 5338;
67     double * const hrrwork = (double *)(primwork + 5758);
68     double * const HRR_INT__f_p_s_f = hrrwork + 0;
69     double * const HRR_INT__f_p_s_g = hrrwork + 300;
70     double * const HRR_INT__f_d_s_f = hrrwork + 750;
71     double * const HRR_INT__f_d_s_g = hrrwork + 1350;
72     double * const HRR_INT__f_f_s_f = hrrwork + 2250;
73     double * const HRR_INT__f_f_s_g = hrrwork + 3250;
74     double * const HRR_INT__g_p_s_f = hrrwork + 4750;
75     double * const HRR_INT__g_p_s_g = hrrwork + 5200;
76     double * const HRR_INT__g_d_s_f = hrrwork + 5875;
77     double * const HRR_INT__g_d_s_g = hrrwork + 6775;
78     double * const HRR_INT__h_p_s_f = hrrwork + 8125;
79     double * const HRR_INT__h_p_s_g = hrrwork + 8755;
80 
81 
82     // Create constants
83     const SIMINT_DBLTYPE const_1 = SIMINT_DBLSET1(1);
84     const SIMINT_DBLTYPE const_2 = SIMINT_DBLSET1(2);
85     const SIMINT_DBLTYPE const_3 = SIMINT_DBLSET1(3);
86     const SIMINT_DBLTYPE const_4 = SIMINT_DBLSET1(4);
87     const SIMINT_DBLTYPE const_5 = SIMINT_DBLSET1(5);
88     const SIMINT_DBLTYPE const_6 = SIMINT_DBLSET1(6);
89     const SIMINT_DBLTYPE one_half = SIMINT_DBLSET1(0.5);
90 
91 
92     ////////////////////////////////////////
93     // Loop over shells and primitives
94     ////////////////////////////////////////
95 
96     real_abcd = 0;
97     istart = 0;
98     for(ab = 0; ab < P.nshell12_clip; ++ab)
99     {
100         const int iend = istart + P.nprim12[ab];
101 
102         cd = 0;
103         jstart = 0;
104 
105         for(cd = 0; cd < Q.nshell12_clip; cd += SIMINT_NSHELL_SIMD)
106         {
107             const int nshellbatch = ((cd + SIMINT_NSHELL_SIMD) > Q.nshell12_clip) ? Q.nshell12_clip - cd : SIMINT_NSHELL_SIMD;
108             int jend = jstart;
109             for(i = 0; i < nshellbatch; i++)
110                 jend += Q.nprim12[cd+i];
111 
112             // Clear the beginning of the workspace (where we are accumulating integrals)
113             memset(work, 0, SIMINT_NSHELL_SIMD * 1850 * sizeof(double));
114             abcd = 0;
115 
116 
117             for(i = istart; i < iend; ++i)
118             {
119                 SIMINT_DBLTYPE bra_screen_max;  // only used if check_screen
120 
121                 if(check_screen)
122                 {
123                     // Skip this whole thing if always insignificant
124                     if((P.screen[i] * Q.screen_max) < screen_tol)
125                         continue;
126                     bra_screen_max = SIMINT_DBLSET1(P.screen[i]);
127                 }
128 
129                 icd = 0;
130                 iprimcd = 0;
131                 nprim_icd = Q.nprim12[cd];
132                 double * restrict PRIM_PTR_INT__f_s_s_f = INT__f_s_s_f + abcd * 100;
133                 double * restrict PRIM_PTR_INT__f_s_s_g = INT__f_s_s_g + abcd * 150;
134                 double * restrict PRIM_PTR_INT__g_s_s_f = INT__g_s_s_f + abcd * 150;
135                 double * restrict PRIM_PTR_INT__g_s_s_g = INT__g_s_s_g + abcd * 225;
136                 double * restrict PRIM_PTR_INT__h_s_s_f = INT__h_s_s_f + abcd * 210;
137                 double * restrict PRIM_PTR_INT__h_s_s_g = INT__h_s_s_g + abcd * 315;
138                 double * restrict PRIM_PTR_INT__i_s_s_f = INT__i_s_s_f + abcd * 280;
139                 double * restrict PRIM_PTR_INT__i_s_s_g = INT__i_s_s_g + abcd * 420;
140 
141 
142 
143                 // Load these one per loop over i
144                 const SIMINT_DBLTYPE P_alpha = SIMINT_DBLSET1(P.alpha[i]);
145                 const SIMINT_DBLTYPE P_prefac = SIMINT_DBLSET1(P.prefac[i]);
146                 const SIMINT_DBLTYPE Pxyz[3] = { SIMINT_DBLSET1(P.x[i]), SIMINT_DBLSET1(P.y[i]), SIMINT_DBLSET1(P.z[i]) };
147 
148                 const SIMINT_DBLTYPE P_PA[3] = { SIMINT_DBLSET1(P.PA_x[i]), SIMINT_DBLSET1(P.PA_y[i]), SIMINT_DBLSET1(P.PA_z[i]) };
149 
150                 for(j = jstart; j < jend; j += SIMINT_SIMD_LEN)
151                 {
152                     // calculate the shell offsets
153                     // these are the offset from the shell pointed to by cd
154                     // for each element
155                     int shelloffsets[SIMINT_SIMD_LEN] = {0};
156                     int lastoffset = 0;
157                     const int nlane = ( ((j + SIMINT_SIMD_LEN) < jend) ? SIMINT_SIMD_LEN : (jend - j));
158 
159                     if((iprimcd + SIMINT_SIMD_LEN) >= nprim_icd)
160                     {
161                         // Handle if the first element of the vector is a new shell
162                         if(iprimcd >= nprim_icd && ((icd+1) < nshellbatch))
163                         {
164                             nprim_icd += Q.nprim12[cd + (++icd)];
165                             PRIM_PTR_INT__f_s_s_f += 100;
166                             PRIM_PTR_INT__f_s_s_g += 150;
167                             PRIM_PTR_INT__g_s_s_f += 150;
168                             PRIM_PTR_INT__g_s_s_g += 225;
169                             PRIM_PTR_INT__h_s_s_f += 210;
170                             PRIM_PTR_INT__h_s_s_g += 315;
171                             PRIM_PTR_INT__i_s_s_f += 280;
172                             PRIM_PTR_INT__i_s_s_g += 420;
173                         }
174                         iprimcd++;
175                         for(n = 1; n < SIMINT_SIMD_LEN; ++n)
176                         {
177                             if(iprimcd >= nprim_icd && ((icd+1) < nshellbatch))
178                             {
179                                 shelloffsets[n] = shelloffsets[n-1] + 1;
180                                 lastoffset++;
181                                 nprim_icd += Q.nprim12[cd + (++icd)];
182                             }
183                             else
184                                 shelloffsets[n] = shelloffsets[n-1];
185                             iprimcd++;
186                         }
187                     }
188                     else
189                         iprimcd += SIMINT_SIMD_LEN;
190 
191                     // Do we have to compute this vector (or has it been screened out)?
192                     // (not_screened != 0 means we have to do this vector)
193                     if(check_screen)
194                     {
195                         const double vmax = vector_max(SIMINT_MUL(bra_screen_max, SIMINT_DBLLOAD(Q.screen, j)));
196                         if(vmax < screen_tol)
197                         {
198                             PRIM_PTR_INT__f_s_s_f += lastoffset*100;
199                             PRIM_PTR_INT__f_s_s_g += lastoffset*150;
200                             PRIM_PTR_INT__g_s_s_f += lastoffset*150;
201                             PRIM_PTR_INT__g_s_s_g += lastoffset*225;
202                             PRIM_PTR_INT__h_s_s_f += lastoffset*210;
203                             PRIM_PTR_INT__h_s_s_g += lastoffset*315;
204                             PRIM_PTR_INT__i_s_s_f += lastoffset*280;
205                             PRIM_PTR_INT__i_s_s_g += lastoffset*420;
206                             continue;
207                         }
208                     }
209 
210                     const SIMINT_DBLTYPE Q_alpha = SIMINT_DBLLOAD(Q.alpha, j);
211                     const SIMINT_DBLTYPE PQalpha_mul = SIMINT_MUL(P_alpha, Q_alpha);
212                     const SIMINT_DBLTYPE PQalpha_sum = SIMINT_ADD(P_alpha, Q_alpha);
213                     const SIMINT_DBLTYPE one_over_PQalpha_sum = SIMINT_DIV(const_1, PQalpha_sum);
214 
215 
216                     /* construct R2 = (Px - Qx)**2 + (Py - Qy)**2 + (Pz -Qz)**2 */
217                     SIMINT_DBLTYPE PQ[3];
218                     PQ[0] = SIMINT_SUB(Pxyz[0], SIMINT_DBLLOAD(Q.x, j));
219                     PQ[1] = SIMINT_SUB(Pxyz[1], SIMINT_DBLLOAD(Q.y, j));
220                     PQ[2] = SIMINT_SUB(Pxyz[2], SIMINT_DBLLOAD(Q.z, j));
221                     SIMINT_DBLTYPE R2 = SIMINT_MUL(PQ[0], PQ[0]);
222                     R2 = SIMINT_FMADD(PQ[1], PQ[1], R2);
223                     R2 = SIMINT_FMADD(PQ[2], PQ[2], R2);
224 
225                     const SIMINT_DBLTYPE alpha = SIMINT_MUL(PQalpha_mul, one_over_PQalpha_sum); // alpha from MEST
226                     const SIMINT_DBLTYPE one_over_p = SIMINT_DIV(const_1, P_alpha);
227                     const SIMINT_DBLTYPE one_over_q = SIMINT_DIV(const_1, Q_alpha);
228                     const SIMINT_DBLTYPE one_over_2p = SIMINT_MUL(one_half, one_over_p);
229                     const SIMINT_DBLTYPE one_over_2q = SIMINT_MUL(one_half, one_over_q);
230                     const SIMINT_DBLTYPE one_over_2pq = SIMINT_MUL(one_half, one_over_PQalpha_sum);
231                     const SIMINT_DBLTYPE Q_PB[3] = { SIMINT_DBLLOAD(Q.PB_x, j), SIMINT_DBLLOAD(Q.PB_y, j), SIMINT_DBLLOAD(Q.PB_z, j) };
232 
233                     // NOTE: Minus sign!
234                     const SIMINT_DBLTYPE a_over_p = SIMINT_MUL(SIMINT_NEG(alpha), one_over_p);
235                     SIMINT_DBLTYPE aop_PQ[3];
236                     aop_PQ[0] = SIMINT_MUL(a_over_p, PQ[0]);
237                     aop_PQ[1] = SIMINT_MUL(a_over_p, PQ[1]);
238                     aop_PQ[2] = SIMINT_MUL(a_over_p, PQ[2]);
239 
240                     SIMINT_DBLTYPE a_over_q = SIMINT_MUL(alpha, one_over_q);
241                     SIMINT_DBLTYPE aoq_PQ[3];
242                     aoq_PQ[0] = SIMINT_MUL(a_over_q, PQ[0]);
243                     aoq_PQ[1] = SIMINT_MUL(a_over_q, PQ[1]);
244                     aoq_PQ[2] = SIMINT_MUL(a_over_q, PQ[2]);
245                     // Put a minus sign here so we don't have to in RR routines
246                     a_over_q = SIMINT_NEG(a_over_q);
247 
248 
249                     //////////////////////////////////////////////
250                     // Fjt function section
251                     // Maximum v value: 10
252                     //////////////////////////////////////////////
253                     // The parameter to the Fjt function
254                     const SIMINT_DBLTYPE F_x = SIMINT_MUL(R2, alpha);
255 
256 
257                     const SIMINT_DBLTYPE Q_prefac = mask_load(nlane, Q.prefac + j);
258 
259 
260                     boys_F_split(PRIM_INT__s_s_s_s, F_x, 10);
261                     SIMINT_DBLTYPE prefac = SIMINT_SQRT(one_over_PQalpha_sum);
262                     prefac = SIMINT_MUL(SIMINT_MUL(P_prefac, Q_prefac), prefac);
263                     for(n = 0; n <= 10; n++)
264                         PRIM_INT__s_s_s_s[n] = SIMINT_MUL(PRIM_INT__s_s_s_s[n], prefac);
265 
266                     //////////////////////////////////////////////
267                     // Primitive integrals: Vertical recurrance
268                     //////////////////////////////////////////////
269 
270                     const SIMINT_DBLTYPE vrr_const_1_over_2p = one_over_2p;
271                     const SIMINT_DBLTYPE vrr_const_2_over_2p = SIMINT_MUL(const_2, one_over_2p);
272                     const SIMINT_DBLTYPE vrr_const_3_over_2p = SIMINT_MUL(const_3, one_over_2p);
273                     const SIMINT_DBLTYPE vrr_const_4_over_2p = SIMINT_MUL(const_4, one_over_2p);
274                     const SIMINT_DBLTYPE vrr_const_5_over_2p = SIMINT_MUL(const_5, one_over_2p);
275                     const SIMINT_DBLTYPE vrr_const_1_over_2q = one_over_2q;
276                     const SIMINT_DBLTYPE vrr_const_2_over_2q = SIMINT_MUL(const_2, one_over_2q);
277                     const SIMINT_DBLTYPE vrr_const_3_over_2q = SIMINT_MUL(const_3, one_over_2q);
278                     const SIMINT_DBLTYPE vrr_const_1_over_2pq = one_over_2pq;
279                     const SIMINT_DBLTYPE vrr_const_2_over_2pq = SIMINT_MUL(const_2, one_over_2pq);
280                     const SIMINT_DBLTYPE vrr_const_3_over_2pq = SIMINT_MUL(const_3, one_over_2pq);
281                     const SIMINT_DBLTYPE vrr_const_4_over_2pq = SIMINT_MUL(const_4, one_over_2pq);
282                     const SIMINT_DBLTYPE vrr_const_5_over_2pq = SIMINT_MUL(const_5, one_over_2pq);
283                     const SIMINT_DBLTYPE vrr_const_6_over_2pq = SIMINT_MUL(const_6, one_over_2pq);
284 
285 
286 
287                     // Forming PRIM_INT__p_s_s_s[10 * 3];
288                     for(n = 0; n < 10; ++n)  // loop over orders of auxiliary function
289                     {
290 
291                         PRIM_INT__p_s_s_s[n * 3 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__s_s_s_s[n * 1 + 0]);
292                         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]);
293 
294                         PRIM_INT__p_s_s_s[n * 3 + 1] = SIMINT_MUL(P_PA[1], PRIM_INT__s_s_s_s[n * 1 + 0]);
295                         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]);
296 
297                         PRIM_INT__p_s_s_s[n * 3 + 2] = SIMINT_MUL(P_PA[2], PRIM_INT__s_s_s_s[n * 1 + 0]);
298                         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]);
299 
300                     }
301 
302 
303 
304                     // Forming PRIM_INT__d_s_s_s[9 * 6];
305                     for(n = 0; n < 9; ++n)  // loop over orders of auxiliary function
306                     {
307 
308                         PRIM_INT__d_s_s_s[n * 6 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__p_s_s_s[n * 3 + 0]);
309                         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]);
310                         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]);
311 
312                         PRIM_INT__d_s_s_s[n * 6 + 1] = SIMINT_MUL(P_PA[1], PRIM_INT__p_s_s_s[n * 3 + 0]);
313                         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]);
314 
315                         PRIM_INT__d_s_s_s[n * 6 + 2] = SIMINT_MUL(P_PA[2], PRIM_INT__p_s_s_s[n * 3 + 0]);
316                         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]);
317 
318                         PRIM_INT__d_s_s_s[n * 6 + 3] = SIMINT_MUL(P_PA[1], PRIM_INT__p_s_s_s[n * 3 + 1]);
319                         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]);
320                         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]);
321 
322                         PRIM_INT__d_s_s_s[n * 6 + 4] = SIMINT_MUL(P_PA[2], PRIM_INT__p_s_s_s[n * 3 + 1]);
323                         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]);
324 
325                         PRIM_INT__d_s_s_s[n * 6 + 5] = SIMINT_MUL(P_PA[2], PRIM_INT__p_s_s_s[n * 3 + 2]);
326                         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]);
327                         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]);
328 
329                     }
330 
331 
332 
333                     // Forming PRIM_INT__f_s_s_s[8 * 10];
334                     for(n = 0; n < 8; ++n)  // loop over orders of auxiliary function
335                     {
336 
337                         PRIM_INT__f_s_s_s[n * 10 + 0] = SIMINT_MUL(P_PA[0], PRIM_INT__d_s_s_s[n * 6 + 0]);
338                         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]);
339                         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]);
340 
341                         PRIM_INT__f_s_s_s[n * 10 + 1] = SIMINT_MUL(P_PA[1], PRIM_INT__d_s_s_s[n * 6 + 0]);
342                         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]);
343 
344                         PRIM_INT__f_s_s_s[n * 10 + 2] = SIMINT_MUL(P_PA[2], PRIM_INT__d_s_s_s[n * 6 + 0]);
345                         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]);
346 
347                         PRIM_INT__f_s_s_s[n * 10 + 3] = SIMINT_MUL(P_PA[0], PRIM_INT__d_s_s_s[n * 6 + 3]);
348                         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]);
349 
350                         PRIM_INT__f_s_s_s[n * 10 + 4] = SIMINT_MUL(P_PA[2], PRIM_INT__d_s_s_s[n * 6 + 1]);
351                         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]);
352 
353                         PRIM_INT__f_s_s_s[n * 10 + 5] = SIMINT_MUL(P_PA[0], PRIM_INT__d_s_s_s[n * 6 + 5]);
354                         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]);
355 
356                         PRIM_INT__f_s_s_s[n * 10 + 6] = SIMINT_MUL(P_PA[1], PRIM_INT__d_s_s_s[n * 6 + 3]);
357                         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]);
358                         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]);
359 
360                         PRIM_INT__f_s_s_s[n * 10 + 7] = SIMINT_MUL(P_PA[2], PRIM_INT__d_s_s_s[n * 6 + 3]);
361                         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]);
362 
363                         PRIM_INT__f_s_s_s[n * 10 + 8] = SIMINT_MUL(P_PA[1], PRIM_INT__d_s_s_s[n * 6 + 5]);
364                         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]);
365 
366                         PRIM_INT__f_s_s_s[n * 10 + 9] = SIMINT_MUL(P_PA[2], PRIM_INT__d_s_s_s[n * 6 + 5]);
367                         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]);
368                         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]);
369 
370                     }
371 
372 
373                     VRR_L_f_s_s_p(
374                             PRIM_INT__f_s_s_p,
375                             PRIM_INT__f_s_s_s,
376                             PRIM_INT__d_s_s_s,
377                             Q_PB,
378                             aoq_PQ,
379                             one_over_2pq,
380                             4);
381 
382 
383 
384                     // Forming PRIM_INT__d_s_s_p[4 * 18];
385                     for(n = 0; n < 4; ++n)  // loop over orders of auxiliary function
386                     {
387 
388                         PRIM_INT__d_s_s_p[n * 18 + 0] = SIMINT_MUL(Q_PB[0], PRIM_INT__d_s_s_s[n * 6 + 0]);
389                         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]);
390                         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]);
391 
392                         PRIM_INT__d_s_s_p[n * 18 + 1] = SIMINT_MUL(Q_PB[1], PRIM_INT__d_s_s_s[n * 6 + 0]);
393                         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]);
394 
395                         PRIM_INT__d_s_s_p[n * 18 + 2] = SIMINT_MUL(Q_PB[2], PRIM_INT__d_s_s_s[n * 6 + 0]);
396                         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]);
397 
398                         PRIM_INT__d_s_s_p[n * 18 + 3] = SIMINT_MUL(Q_PB[0], PRIM_INT__d_s_s_s[n * 6 + 1]);
399                         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]);
400                         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]);
401 
402                         PRIM_INT__d_s_s_p[n * 18 + 4] = SIMINT_MUL(Q_PB[1], PRIM_INT__d_s_s_s[n * 6 + 1]);
403                         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]);
404                         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]);
405 
406                         PRIM_INT__d_s_s_p[n * 18 + 5] = SIMINT_MUL(Q_PB[2], PRIM_INT__d_s_s_s[n * 6 + 1]);
407                         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]);
408 
409                         PRIM_INT__d_s_s_p[n * 18 + 6] = SIMINT_MUL(Q_PB[0], PRIM_INT__d_s_s_s[n * 6 + 2]);
410                         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]);
411                         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]);
412 
413                         PRIM_INT__d_s_s_p[n * 18 + 7] = SIMINT_MUL(Q_PB[1], PRIM_INT__d_s_s_s[n * 6 + 2]);
414                         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]);
415 
416                         PRIM_INT__d_s_s_p[n * 18 + 8] = SIMINT_MUL(Q_PB[2], PRIM_INT__d_s_s_s[n * 6 + 2]);
417                         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]);
418                         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]);
419 
420                         PRIM_INT__d_s_s_p[n * 18 + 9] = SIMINT_MUL(Q_PB[0], PRIM_INT__d_s_s_s[n * 6 + 3]);
421                         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]);
422 
423                         PRIM_INT__d_s_s_p[n * 18 + 10] = SIMINT_MUL(Q_PB[1], PRIM_INT__d_s_s_s[n * 6 + 3]);
424                         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]);
425                         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]);
426 
427                         PRIM_INT__d_s_s_p[n * 18 + 11] = SIMINT_MUL(Q_PB[2], PRIM_INT__d_s_s_s[n * 6 + 3]);
428                         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]);
429 
430                         PRIM_INT__d_s_s_p[n * 18 + 12] = SIMINT_MUL(Q_PB[0], PRIM_INT__d_s_s_s[n * 6 + 4]);
431                         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]);
432 
433                         PRIM_INT__d_s_s_p[n * 18 + 13] = SIMINT_MUL(Q_PB[1], PRIM_INT__d_s_s_s[n * 6 + 4]);
434                         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]);
435                         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]);
436 
437                         PRIM_INT__d_s_s_p[n * 18 + 14] = SIMINT_MUL(Q_PB[2], PRIM_INT__d_s_s_s[n * 6 + 4]);
438                         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]);
439                         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]);
440 
441                         PRIM_INT__d_s_s_p[n * 18 + 15] = SIMINT_MUL(Q_PB[0], PRIM_INT__d_s_s_s[n * 6 + 5]);
442                         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]);
443 
444                         PRIM_INT__d_s_s_p[n * 18 + 16] = SIMINT_MUL(Q_PB[1], PRIM_INT__d_s_s_s[n * 6 + 5]);
445                         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]);
446 
447                         PRIM_INT__d_s_s_p[n * 18 + 17] = SIMINT_MUL(Q_PB[2], PRIM_INT__d_s_s_s[n * 6 + 5]);
448                         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]);
449                         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]);
450 
451                     }
452 
453 
454                     VRR_L_f_s_s_d(
455                             PRIM_INT__f_s_s_d,
456                             PRIM_INT__f_s_s_p,
457                             PRIM_INT__f_s_s_s,
458                             PRIM_INT__d_s_s_p,
459                             Q_PB,
460                             a_over_q,
461                             aoq_PQ,
462                             one_over_2pq,
463                             one_over_2q,
464                             3);
465 
466 
467 
468                     // Forming PRIM_INT__p_s_s_p[4 * 9];
469                     for(n = 0; n < 4; ++n)  // loop over orders of auxiliary function
470                     {
471 
472                         PRIM_INT__p_s_s_p[n * 9 + 0] = SIMINT_MUL(Q_PB[0], PRIM_INT__p_s_s_s[n * 3 + 0]);
473                         PRIM_INT__p_s_s_p[n * 9 + 0] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__p_s_s_p[n * 9 + 0]);
474                         PRIM_INT__p_s_s_p[n * 9 + 0] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__p_s_s_p[n * 9 + 0]);
475 
476                         PRIM_INT__p_s_s_p[n * 9 + 1] = SIMINT_MUL(Q_PB[1], PRIM_INT__p_s_s_s[n * 3 + 0]);
477                         PRIM_INT__p_s_s_p[n * 9 + 1] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__p_s_s_p[n * 9 + 1]);
478 
479                         PRIM_INT__p_s_s_p[n * 9 + 2] = SIMINT_MUL(Q_PB[2], PRIM_INT__p_s_s_s[n * 3 + 0]);
480                         PRIM_INT__p_s_s_p[n * 9 + 2] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__p_s_s_s[(n+1) * 3 + 0], PRIM_INT__p_s_s_p[n * 9 + 2]);
481 
482                         PRIM_INT__p_s_s_p[n * 9 + 3] = SIMINT_MUL(Q_PB[0], PRIM_INT__p_s_s_s[n * 3 + 1]);
483                         PRIM_INT__p_s_s_p[n * 9 + 3] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__p_s_s_p[n * 9 + 3]);
484 
485                         PRIM_INT__p_s_s_p[n * 9 + 4] = SIMINT_MUL(Q_PB[1], PRIM_INT__p_s_s_s[n * 3 + 1]);
486                         PRIM_INT__p_s_s_p[n * 9 + 4] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__p_s_s_p[n * 9 + 4]);
487                         PRIM_INT__p_s_s_p[n * 9 + 4] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__p_s_s_p[n * 9 + 4]);
488 
489                         PRIM_INT__p_s_s_p[n * 9 + 5] = SIMINT_MUL(Q_PB[2], PRIM_INT__p_s_s_s[n * 3 + 1]);
490                         PRIM_INT__p_s_s_p[n * 9 + 5] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__p_s_s_s[(n+1) * 3 + 1], PRIM_INT__p_s_s_p[n * 9 + 5]);
491 
492                         PRIM_INT__p_s_s_p[n * 9 + 6] = SIMINT_MUL(Q_PB[0], PRIM_INT__p_s_s_s[n * 3 + 2]);
493                         PRIM_INT__p_s_s_p[n * 9 + 6] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__p_s_s_p[n * 9 + 6]);
494 
495                         PRIM_INT__p_s_s_p[n * 9 + 7] = SIMINT_MUL(Q_PB[1], PRIM_INT__p_s_s_s[n * 3 + 2]);
496                         PRIM_INT__p_s_s_p[n * 9 + 7] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__p_s_s_p[n * 9 + 7]);
497 
498                         PRIM_INT__p_s_s_p[n * 9 + 8] = SIMINT_MUL(Q_PB[2], PRIM_INT__p_s_s_s[n * 3 + 2]);
499                         PRIM_INT__p_s_s_p[n * 9 + 8] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__p_s_s_s[(n+1) * 3 + 2], PRIM_INT__p_s_s_p[n * 9 + 8]);
500                         PRIM_INT__p_s_s_p[n * 9 + 8] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__p_s_s_p[n * 9 + 8]);
501 
502                     }
503 
504 
505                     VRR_L_d_s_s_d(
506                             PRIM_INT__d_s_s_d,
507                             PRIM_INT__d_s_s_p,
508                             PRIM_INT__d_s_s_s,
509                             PRIM_INT__p_s_s_p,
510                             Q_PB,
511                             a_over_q,
512                             aoq_PQ,
513                             one_over_2pq,
514                             one_over_2q,
515                             3);
516 
517 
518                     ostei_general_vrr_L(3, 0, 0, 3, 2,
519                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PB,
520                             PRIM_INT__f_s_s_d, NULL, PRIM_INT__f_s_s_p, PRIM_INT__d_s_s_d, NULL, PRIM_INT__f_s_s_f);
521 
522 
523 
524                     // Forming PRIM_INT__s_s_s_p[4 * 3];
525                     for(n = 0; n < 4; ++n)  // loop over orders of auxiliary function
526                     {
527 
528                         PRIM_INT__s_s_s_p[n * 3 + 0] = SIMINT_MUL(Q_PB[0], PRIM_INT__s_s_s_s[n * 1 + 0]);
529                         PRIM_INT__s_s_s_p[n * 3 + 0] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__s_s_s_p[n * 3 + 0]);
530 
531                         PRIM_INT__s_s_s_p[n * 3 + 1] = SIMINT_MUL(Q_PB[1], PRIM_INT__s_s_s_s[n * 1 + 0]);
532                         PRIM_INT__s_s_s_p[n * 3 + 1] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__s_s_s_p[n * 3 + 1]);
533 
534                         PRIM_INT__s_s_s_p[n * 3 + 2] = SIMINT_MUL(Q_PB[2], PRIM_INT__s_s_s_s[n * 1 + 0]);
535                         PRIM_INT__s_s_s_p[n * 3 + 2] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__s_s_s_s[(n+1) * 1 + 0], PRIM_INT__s_s_s_p[n * 3 + 2]);
536 
537                     }
538 
539 
540 
541                     // Forming PRIM_INT__p_s_s_d[3 * 18];
542                     for(n = 0; n < 3; ++n)  // loop over orders of auxiliary function
543                     {
544 
545                         PRIM_INT__p_s_s_d[n * 18 + 0] = SIMINT_MUL(Q_PB[0], PRIM_INT__p_s_s_p[n * 9 + 0]);
546                         PRIM_INT__p_s_s_d[n * 18 + 0] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__p_s_s_p[(n+1) * 9 + 0], PRIM_INT__p_s_s_d[n * 18 + 0]);
547                         PRIM_INT__p_s_s_d[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_s_d[n * 18 + 0]);
548                         PRIM_INT__p_s_s_d[n * 18 + 0] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__s_s_s_p[(n+1) * 3 + 0], PRIM_INT__p_s_s_d[n * 18 + 0]);
549 
550                         PRIM_INT__p_s_s_d[n * 18 + 3] = SIMINT_MUL(Q_PB[1], PRIM_INT__p_s_s_p[n * 9 + 1]);
551                         PRIM_INT__p_s_s_d[n * 18 + 3] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__p_s_s_p[(n+1) * 9 + 1], PRIM_INT__p_s_s_d[n * 18 + 3]);
552                         PRIM_INT__p_s_s_d[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_s_d[n * 18 + 3]);
553 
554                         PRIM_INT__p_s_s_d[n * 18 + 5] = SIMINT_MUL(Q_PB[2], PRIM_INT__p_s_s_p[n * 9 + 2]);
555                         PRIM_INT__p_s_s_d[n * 18 + 5] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__p_s_s_p[(n+1) * 9 + 2], PRIM_INT__p_s_s_d[n * 18 + 5]);
556                         PRIM_INT__p_s_s_d[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_s_d[n * 18 + 5]);
557 
558                         PRIM_INT__p_s_s_d[n * 18 + 6] = SIMINT_MUL(Q_PB[0], PRIM_INT__p_s_s_p[n * 9 + 3]);
559                         PRIM_INT__p_s_s_d[n * 18 + 6] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__p_s_s_p[(n+1) * 9 + 3], PRIM_INT__p_s_s_d[n * 18 + 6]);
560                         PRIM_INT__p_s_s_d[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_s_d[n * 18 + 6]);
561 
562                         PRIM_INT__p_s_s_d[n * 18 + 9] = SIMINT_MUL(Q_PB[1], PRIM_INT__p_s_s_p[n * 9 + 4]);
563                         PRIM_INT__p_s_s_d[n * 18 + 9] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__p_s_s_p[(n+1) * 9 + 4], PRIM_INT__p_s_s_d[n * 18 + 9]);
564                         PRIM_INT__p_s_s_d[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_s_d[n * 18 + 9]);
565                         PRIM_INT__p_s_s_d[n * 18 + 9] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__s_s_s_p[(n+1) * 3 + 1], PRIM_INT__p_s_s_d[n * 18 + 9]);
566 
567                         PRIM_INT__p_s_s_d[n * 18 + 11] = SIMINT_MUL(Q_PB[2], PRIM_INT__p_s_s_p[n * 9 + 5]);
568                         PRIM_INT__p_s_s_d[n * 18 + 11] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__p_s_s_p[(n+1) * 9 + 5], PRIM_INT__p_s_s_d[n * 18 + 11]);
569                         PRIM_INT__p_s_s_d[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_s_d[n * 18 + 11]);
570 
571                         PRIM_INT__p_s_s_d[n * 18 + 12] = SIMINT_MUL(Q_PB[0], PRIM_INT__p_s_s_p[n * 9 + 6]);
572                         PRIM_INT__p_s_s_d[n * 18 + 12] = SIMINT_FMADD( aoq_PQ[0], PRIM_INT__p_s_s_p[(n+1) * 9 + 6], PRIM_INT__p_s_s_d[n * 18 + 12]);
573                         PRIM_INT__p_s_s_d[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_s_d[n * 18 + 12]);
574 
575                         PRIM_INT__p_s_s_d[n * 18 + 15] = SIMINT_MUL(Q_PB[1], PRIM_INT__p_s_s_p[n * 9 + 7]);
576                         PRIM_INT__p_s_s_d[n * 18 + 15] = SIMINT_FMADD( aoq_PQ[1], PRIM_INT__p_s_s_p[(n+1) * 9 + 7], PRIM_INT__p_s_s_d[n * 18 + 15]);
577                         PRIM_INT__p_s_s_d[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_s_d[n * 18 + 15]);
578 
579                         PRIM_INT__p_s_s_d[n * 18 + 17] = SIMINT_MUL(Q_PB[2], PRIM_INT__p_s_s_p[n * 9 + 8]);
580                         PRIM_INT__p_s_s_d[n * 18 + 17] = SIMINT_FMADD( aoq_PQ[2], PRIM_INT__p_s_s_p[(n+1) * 9 + 8], PRIM_INT__p_s_s_d[n * 18 + 17]);
581                         PRIM_INT__p_s_s_d[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_s_d[n * 18 + 17]);
582                         PRIM_INT__p_s_s_d[n * 18 + 17] = SIMINT_FMADD( vrr_const_1_over_2pq, PRIM_INT__s_s_s_p[(n+1) * 3 + 2], PRIM_INT__p_s_s_d[n * 18 + 17]);
583 
584                     }
585 
586 
587                     VRR_L_d_s_s_f(
588                             PRIM_INT__d_s_s_f,
589                             PRIM_INT__d_s_s_d,
590                             PRIM_INT__d_s_s_p,
591                             PRIM_INT__p_s_s_d,
592                             Q_PB,
593                             a_over_q,
594                             aoq_PQ,
595                             one_over_2pq,
596                             one_over_2q,
597                             2);
598 
599 
600                     ostei_general_vrr_L(3, 0, 0, 4, 1,
601                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PB,
602                             PRIM_INT__f_s_s_f, NULL, PRIM_INT__f_s_s_d, PRIM_INT__d_s_s_f, NULL, PRIM_INT__f_s_s_g);
603 
604 
605                     VRR_I_g_s_s_s(
606                             PRIM_INT__g_s_s_s,
607                             PRIM_INT__f_s_s_s,
608                             PRIM_INT__d_s_s_s,
609                             P_PA,
610                             a_over_p,
611                             aop_PQ,
612                             one_over_2p,
613                             7);
614 
615 
616                     VRR_L_g_s_s_p(
617                             PRIM_INT__g_s_s_p,
618                             PRIM_INT__g_s_s_s,
619                             PRIM_INT__f_s_s_s,
620                             Q_PB,
621                             aoq_PQ,
622                             one_over_2pq,
623                             4);
624 
625 
626                     ostei_general_vrr_L(4, 0, 0, 2, 3,
627                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PB,
628                             PRIM_INT__g_s_s_p, NULL, PRIM_INT__g_s_s_s, PRIM_INT__f_s_s_p, NULL, PRIM_INT__g_s_s_d);
629 
630 
631                     ostei_general_vrr_L(4, 0, 0, 3, 2,
632                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PB,
633                             PRIM_INT__g_s_s_d, NULL, PRIM_INT__g_s_s_p, PRIM_INT__f_s_s_d, NULL, PRIM_INT__g_s_s_f);
634 
635 
636                     ostei_general_vrr_L(4, 0, 0, 4, 1,
637                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PB,
638                             PRIM_INT__g_s_s_f, NULL, PRIM_INT__g_s_s_d, PRIM_INT__f_s_s_f, NULL, PRIM_INT__g_s_s_g);
639 
640 
641                     VRR_I_h_s_s_s(
642                             PRIM_INT__h_s_s_s,
643                             PRIM_INT__g_s_s_s,
644                             PRIM_INT__f_s_s_s,
645                             P_PA,
646                             a_over_p,
647                             aop_PQ,
648                             one_over_2p,
649                             6);
650 
651 
652                     ostei_general_vrr_L(5, 0, 0, 1, 4,
653                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PB,
654                             PRIM_INT__h_s_s_s, NULL, NULL, PRIM_INT__g_s_s_s, NULL, PRIM_INT__h_s_s_p);
655 
656 
657                     ostei_general_vrr_L(5, 0, 0, 2, 3,
658                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PB,
659                             PRIM_INT__h_s_s_p, NULL, PRIM_INT__h_s_s_s, PRIM_INT__g_s_s_p, NULL, PRIM_INT__h_s_s_d);
660 
661 
662                     ostei_general_vrr_L(5, 0, 0, 3, 2,
663                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PB,
664                             PRIM_INT__h_s_s_d, NULL, PRIM_INT__h_s_s_p, PRIM_INT__g_s_s_d, NULL, PRIM_INT__h_s_s_f);
665 
666 
667                     ostei_general_vrr_L(5, 0, 0, 4, 1,
668                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PB,
669                             PRIM_INT__h_s_s_f, NULL, PRIM_INT__h_s_s_d, PRIM_INT__g_s_s_f, NULL, PRIM_INT__h_s_s_g);
670 
671 
672                     ostei_general_vrr1_I(6, 5,
673                             one_over_2p, a_over_p, aop_PQ, P_PA,
674                             PRIM_INT__h_s_s_s, PRIM_INT__g_s_s_s, PRIM_INT__i_s_s_s);
675 
676 
677                     ostei_general_vrr_L(6, 0, 0, 1, 4,
678                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PB,
679                             PRIM_INT__i_s_s_s, NULL, NULL, PRIM_INT__h_s_s_s, NULL, PRIM_INT__i_s_s_p);
680 
681 
682                     ostei_general_vrr_L(6, 0, 0, 2, 3,
683                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PB,
684                             PRIM_INT__i_s_s_p, NULL, PRIM_INT__i_s_s_s, PRIM_INT__h_s_s_p, NULL, PRIM_INT__i_s_s_d);
685 
686 
687                     ostei_general_vrr_L(6, 0, 0, 3, 2,
688                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PB,
689                             PRIM_INT__i_s_s_d, NULL, PRIM_INT__i_s_s_p, PRIM_INT__h_s_s_d, NULL, PRIM_INT__i_s_s_f);
690 
691 
692                     ostei_general_vrr_L(6, 0, 0, 4, 1,
693                             one_over_2q, a_over_q, one_over_2pq, aoq_PQ, Q_PB,
694                             PRIM_INT__i_s_s_f, NULL, PRIM_INT__i_s_s_d, PRIM_INT__h_s_s_f, NULL, PRIM_INT__i_s_s_g);
695 
696 
697 
698 
699                     ////////////////////////////////////
700                     // Accumulate contracted integrals
701                     ////////////////////////////////////
702                     if(lastoffset == 0)
703                     {
704                         contract_all(100, PRIM_INT__f_s_s_f, PRIM_PTR_INT__f_s_s_f);
705                         contract_all(150, PRIM_INT__f_s_s_g, PRIM_PTR_INT__f_s_s_g);
706                         contract_all(150, PRIM_INT__g_s_s_f, PRIM_PTR_INT__g_s_s_f);
707                         contract_all(225, PRIM_INT__g_s_s_g, PRIM_PTR_INT__g_s_s_g);
708                         contract_all(210, PRIM_INT__h_s_s_f, PRIM_PTR_INT__h_s_s_f);
709                         contract_all(315, PRIM_INT__h_s_s_g, PRIM_PTR_INT__h_s_s_g);
710                         contract_all(280, PRIM_INT__i_s_s_f, PRIM_PTR_INT__i_s_s_f);
711                         contract_all(420, PRIM_INT__i_s_s_g, PRIM_PTR_INT__i_s_s_g);
712                     }
713                     else
714                     {
715                         contract(100, shelloffsets, PRIM_INT__f_s_s_f, PRIM_PTR_INT__f_s_s_f);
716                         contract(150, shelloffsets, PRIM_INT__f_s_s_g, PRIM_PTR_INT__f_s_s_g);
717                         contract(150, shelloffsets, PRIM_INT__g_s_s_f, PRIM_PTR_INT__g_s_s_f);
718                         contract(225, shelloffsets, PRIM_INT__g_s_s_g, PRIM_PTR_INT__g_s_s_g);
719                         contract(210, shelloffsets, PRIM_INT__h_s_s_f, PRIM_PTR_INT__h_s_s_f);
720                         contract(315, shelloffsets, PRIM_INT__h_s_s_g, PRIM_PTR_INT__h_s_s_g);
721                         contract(280, shelloffsets, PRIM_INT__i_s_s_f, PRIM_PTR_INT__i_s_s_f);
722                         contract(420, shelloffsets, PRIM_INT__i_s_s_g, PRIM_PTR_INT__i_s_s_g);
723                         PRIM_PTR_INT__f_s_s_f += lastoffset*100;
724                         PRIM_PTR_INT__f_s_s_g += lastoffset*150;
725                         PRIM_PTR_INT__g_s_s_f += lastoffset*150;
726                         PRIM_PTR_INT__g_s_s_g += lastoffset*225;
727                         PRIM_PTR_INT__h_s_s_f += lastoffset*210;
728                         PRIM_PTR_INT__h_s_s_g += lastoffset*315;
729                         PRIM_PTR_INT__i_s_s_f += lastoffset*280;
730                         PRIM_PTR_INT__i_s_s_g += lastoffset*420;
731                     }
732 
733                 }  // close loop over j
734             }  // close loop over i
735 
736             //Advance to the next batch
737             jstart = SIMINT_SIMD_ROUND(jend);
738 
739             //////////////////////////////////////////////
740             // Contracted integrals: Horizontal recurrance
741             //////////////////////////////////////////////
742 
743 
744             const double hAB[3] = { P.AB_x[ab], P.AB_y[ab], P.AB_z[ab] };
745 
746 
747             for(abcd = 0; abcd < nshellbatch; ++abcd, ++real_abcd)
748             {
749                 const double hCD[3] = { Q.AB_x[cd+abcd], Q.AB_y[cd+abcd], Q.AB_z[cd+abcd] };
750 
751                 // set up HRR pointers
752                 double const * restrict HRR_INT__f_s_s_f = INT__f_s_s_f + abcd * 100;
753                 double const * restrict HRR_INT__f_s_s_g = INT__f_s_s_g + abcd * 150;
754                 double const * restrict HRR_INT__g_s_s_f = INT__g_s_s_f + abcd * 150;
755                 double const * restrict HRR_INT__g_s_s_g = INT__g_s_s_g + abcd * 225;
756                 double const * restrict HRR_INT__h_s_s_f = INT__h_s_s_f + abcd * 210;
757                 double const * restrict HRR_INT__h_s_s_g = INT__h_s_s_g + abcd * 315;
758                 double const * restrict HRR_INT__i_s_s_f = INT__i_s_s_f + abcd * 280;
759                 double const * restrict HRR_INT__i_s_s_g = INT__i_s_s_g + abcd * 420;
760                 double * restrict HRR_INT__f_f_p_f = INT__f_f_p_f + real_abcd * 3000;
761 
762                 // form INT__f_p_s_f
763                 HRR_J_f_p(
764                     HRR_INT__f_p_s_f,
765                     HRR_INT__f_s_s_f,
766                     HRR_INT__g_s_s_f,
767                     hAB, 10);
768 
769                 // form INT__f_p_s_g
770                 HRR_J_f_p(
771                     HRR_INT__f_p_s_g,
772                     HRR_INT__f_s_s_g,
773                     HRR_INT__g_s_s_g,
774                     hAB, 15);
775 
776                 // form INT__g_p_s_f
777                 HRR_J_g_p(
778                     HRR_INT__g_p_s_f,
779                     HRR_INT__g_s_s_f,
780                     HRR_INT__h_s_s_f,
781                     hAB, 10);
782 
783                 // form INT__g_p_s_g
784                 HRR_J_g_p(
785                     HRR_INT__g_p_s_g,
786                     HRR_INT__g_s_s_g,
787                     HRR_INT__h_s_s_g,
788                     hAB, 15);
789 
790                 // form INT__h_p_s_f
791                 ostei_general_hrr_J(5, 1, 0, 3, hAB, HRR_INT__i_s_s_f, HRR_INT__h_s_s_f, HRR_INT__h_p_s_f);
792 
793                 // form INT__h_p_s_g
794                 ostei_general_hrr_J(5, 1, 0, 4, hAB, HRR_INT__i_s_s_g, HRR_INT__h_s_s_g, HRR_INT__h_p_s_g);
795 
796                 // form INT__f_d_s_f
797                 HRR_J_f_d(
798                     HRR_INT__f_d_s_f,
799                     HRR_INT__f_p_s_f,
800                     HRR_INT__g_p_s_f,
801                     hAB, 10);
802 
803                 // form INT__f_d_s_g
804                 HRR_J_f_d(
805                     HRR_INT__f_d_s_g,
806                     HRR_INT__f_p_s_g,
807                     HRR_INT__g_p_s_g,
808                     hAB, 15);
809 
810                 // form INT__g_d_s_f
811                 ostei_general_hrr_J(4, 2, 0, 3, hAB, HRR_INT__h_p_s_f, HRR_INT__g_p_s_f, HRR_INT__g_d_s_f);
812 
813                 // form INT__g_d_s_g
814                 ostei_general_hrr_J(4, 2, 0, 4, hAB, HRR_INT__h_p_s_g, HRR_INT__g_p_s_g, HRR_INT__g_d_s_g);
815 
816                 // form INT__f_f_s_f
817                 ostei_general_hrr_J(3, 3, 0, 3, hAB, HRR_INT__g_d_s_f, HRR_INT__f_d_s_f, HRR_INT__f_f_s_f);
818 
819                 // form INT__f_f_s_g
820                 ostei_general_hrr_J(3, 3, 0, 4, hAB, HRR_INT__g_d_s_g, HRR_INT__f_d_s_g, HRR_INT__f_f_s_g);
821 
822                 // form INT__f_f_p_f
823                 HRR_K_p_f(
824                     HRR_INT__f_f_p_f,
825                     HRR_INT__f_f_s_f,
826                     HRR_INT__f_f_s_g,
827                     hCD, 100);
828 
829 
830             }  // close HRR loop
831 
832 
833         }   // close loop cdbatch
834 
835         istart = iend;
836     }  // close loop over ab
837 
838     return P.nshell12_clip * Q.nshell12_clip;
839 }
840 
841