3 double&
f,
double*
df,
double& g,
double*
r,
double* dr)
5 const int nSymTen=6,sXX=0,sYY=1,sZZ=2,sYZ=3,sZY=3,sXZ=4,sZX=4,sXY=5,sYX=5;
6 const int SKEY=0,TARGKEY=1,J3KEY=2;
7 double s,ds[nSymTen],f_12,f_13,f_23,g_12,g_13,g_23,
8 targ,dtarg[nSymTen],ddtarg[nSymTen*nSymTen],
9 J3,dJ3[nSymTen],ddJ3[nSymTen*nSymTen],
11 dg_dtmp[3],ddg_dtmp[3*3],theta;
12 const double& stress_xx(stress[sXX]),
13 stress_yy(stress[sYY]),
14 stress_zz(stress[sZZ]),
15 stress_yz(stress[sYZ]),
16 stress_zx(stress[sZX]),
17 stress_xy(stress[sXY]);
19 s = sqrt(3)*(stress_xx + stress_yy + stress_zz)/3;
33 targ = 1.0e-8 + pow(stress_xx - stress_yy, 2) + pow(stress_yy - stress_zz, 2) + pow(stress_zz - stress_xx, 2) + 6*pow(stress_xy, 2) + 6*pow(stress_yz, 2) + 6*pow(stress_zx, 2);
35 dtarg[sXX] = -2*stress_yy - 2*stress_zz + 4*stress_xx;
37 dtarg[sYY] = -2*stress_xx - 2*stress_zz + 4*stress_yy;
39 dtarg[sZZ] = -2*stress_xx - 2*stress_yy + 4*stress_zz;
41 dtarg[sYZ] = 12*stress_yz;
43 dtarg[sZX] = 12*stress_zx;
45 dtarg[sXY] = 12*stress_xy;
47 ddtarg[sXX+ nSymTen*sXX] = 4;
49 ddtarg[sXX+ nSymTen*sYY] = -2;
51 ddtarg[sXX+ nSymTen*sZZ] = -2;
53 ddtarg[sXX+ nSymTen*sYZ] = 0;
55 ddtarg[sXX+ nSymTen*sZX] = 0;
57 ddtarg[sXX+ nSymTen*sXY] = 0;
59 ddtarg[sYY+ nSymTen*sXX] = -2;
61 ddtarg[sYY+ nSymTen*sYY] = 4;
63 ddtarg[sYY+ nSymTen*sZZ] = -2;
65 ddtarg[sYY+ nSymTen*sYZ] = 0;
67 ddtarg[sYY+ nSymTen*sZX] = 0;
69 ddtarg[sYY+ nSymTen*sXY] = 0;
71 ddtarg[sZZ+ nSymTen*sXX] = -2;
73 ddtarg[sZZ+ nSymTen*sYY] = -2;
75 ddtarg[sZZ+ nSymTen*sZZ] = 4;
77 ddtarg[sZZ+ nSymTen*sYZ] = 0;
79 ddtarg[sZZ+ nSymTen*sZX] = 0;
81 ddtarg[sZZ+ nSymTen*sXY] = 0;
83 ddtarg[sYZ+ nSymTen*sXX] = 0;
85 ddtarg[sYZ+ nSymTen*sYY] = 0;
87 ddtarg[sYZ+ nSymTen*sZZ] = 0;
89 ddtarg[sYZ+ nSymTen*sYZ] = 12;
91 ddtarg[sYZ+ nSymTen*sZX] = 0;
93 ddtarg[sYZ+ nSymTen*sXY] = 0;
95 ddtarg[sZX+ nSymTen*sXX] = 0;
97 ddtarg[sZX+ nSymTen*sYY] = 0;
99 ddtarg[sZX+ nSymTen*sZZ] = 0;
101 ddtarg[sZX+ nSymTen*sYZ] = 0;
103 ddtarg[sZX+ nSymTen*sZX] = 12;
105 ddtarg[sZX+ nSymTen*sXY] = 0;
107 ddtarg[sXY+ nSymTen*sXX] = 0;
109 ddtarg[sXY+ nSymTen*sYY] = 0;
111 ddtarg[sXY+ nSymTen*sZZ] = 0;
113 ddtarg[sXY+ nSymTen*sYZ] = 0;
115 ddtarg[sXY+ nSymTen*sZX] = 0;
117 ddtarg[sXY+ nSymTen*sXY] = 12;
119 J3 = -pow(stress_xy, 2)*(-stress_xx/3 - stress_yy/3 + 2*stress_zz/3) - pow(stress_yz, 2)*(-stress_yy/3 - stress_zz/3 + 2*stress_xx/3) - pow(stress_zx, 2)*(-stress_xx/3 - stress_zz/3 + 2*stress_yy/3) + (-stress_xx/3 - stress_zz/3 + 2*stress_yy/3)*(-stress_yy/3 - stress_zz/3 + 2*stress_xx/3)*(-stress_xx/3 - stress_yy/3 + 2*stress_zz/3) + 2*stress_xy*stress_yz*stress_zx;
121 dJ3[sXX] = -(-stress_xx/3 - stress_zz/3 + 2*stress_yy/3)*(-stress_yy/3 - stress_zz/3 + 2*stress_xx/3)/3 - (-stress_yy/3 - stress_zz/3 + 2*stress_xx/3)*(-stress_xx/3 - stress_yy/3 + 2*stress_zz/3)/3 + 2*(-stress_xx/3 - stress_zz/3 + 2*stress_yy/3)*(-stress_xx/3 - stress_yy/3 + 2*stress_zz/3)/3 - 2*pow(stress_yz, 2)/3 + pow(stress_xy, 2)/3 + pow(stress_zx, 2)/3;
123 dJ3[sYY] = -(-stress_xx/3 - stress_zz/3 + 2*stress_yy/3)*(-stress_yy/3 - stress_zz/3 + 2*stress_xx/3)/3 - (-stress_xx/3 - stress_zz/3 + 2*stress_yy/3)*(-stress_xx/3 - stress_yy/3 + 2*stress_zz/3)/3 + 2*(-stress_yy/3 - stress_zz/3 + 2*stress_xx/3)*(-stress_xx/3 - stress_yy/3 + 2*stress_zz/3)/3 - 2*pow(stress_zx, 2)/3 + pow(stress_xy, 2)/3 + pow(stress_yz, 2)/3;
125 dJ3[sZZ] = -(-stress_xx/3 - stress_zz/3 + 2*stress_yy/3)*(-stress_xx/3 - stress_yy/3 + 2*stress_zz/3)/3 - (-stress_yy/3 - stress_zz/3 + 2*stress_xx/3)*(-stress_xx/3 - stress_yy/3 + 2*stress_zz/3)/3 + 2*(-stress_xx/3 - stress_zz/3 + 2*stress_yy/3)*(-stress_yy/3 - stress_zz/3 + 2*stress_xx/3)/3 - 2*pow(stress_xy, 2)/3 + pow(stress_yz, 2)/3 + pow(stress_zx, 2)/3;
127 dJ3[sYZ] = -2*stress_yz*(-stress_yy/3 - stress_zz/3 + 2*stress_xx/3) + 2*stress_xy*stress_zx;
129 dJ3[sZX] = -2*stress_zx*(-stress_xx/3 - stress_zz/3 + 2*stress_yy/3) + 2*stress_xy*stress_yz;
131 dJ3[sXY] = -2*stress_xy*(-stress_xx/3 - stress_yy/3 + 2*stress_zz/3) + 2*stress_yz*stress_zx;
133 ddJ3[sXX+ nSymTen*sXX] = -2*stress_yy/9 - 2*stress_zz/9 + 4*stress_xx/9;
135 ddJ3[sXX+ nSymTen*sYY] = -2*stress_xx/9 - 2*stress_yy/9 + 4*stress_zz/9;
137 ddJ3[sXX+ nSymTen*sZZ] = -2*stress_xx/9 - 2*stress_zz/9 + 4*stress_yy/9;
139 ddJ3[sXX+ nSymTen*sYZ] = -4*stress_yz/3;
141 ddJ3[sXX+ nSymTen*sZX] = 2*stress_zx/3;
143 ddJ3[sXX+ nSymTen*sXY] = 2*stress_xy/3;
145 ddJ3[sYY+ nSymTen*sXX] = -2*stress_xx/9 - 2*stress_yy/9 + 4*stress_zz/9;
147 ddJ3[sYY+ nSymTen*sYY] = -2*stress_xx/9 - 2*stress_zz/9 + 4*stress_yy/9;
149 ddJ3[sYY+ nSymTen*sZZ] = -2*stress_yy/9 - 2*stress_zz/9 + 4*stress_xx/9;
151 ddJ3[sYY+ nSymTen*sYZ] = 2*stress_yz/3;
153 ddJ3[sYY+ nSymTen*sZX] = -4*stress_zx/3;
155 ddJ3[sYY+ nSymTen*sXY] = 2*stress_xy/3;
157 ddJ3[sZZ+ nSymTen*sXX] = -2*stress_xx/9 - 2*stress_zz/9 + 4*stress_yy/9;
159 ddJ3[sZZ+ nSymTen*sYY] = -2*stress_yy/9 - 2*stress_zz/9 + 4*stress_xx/9;
161 ddJ3[sZZ+ nSymTen*sZZ] = -2*stress_xx/9 - 2*stress_yy/9 + 4*stress_zz/9;
163 ddJ3[sZZ+ nSymTen*sYZ] = 2*stress_yz/3;
165 ddJ3[sZZ+ nSymTen*sZX] = 2*stress_zx/3;
167 ddJ3[sZZ+ nSymTen*sXY] = -4*stress_xy/3;
169 ddJ3[sYZ+ nSymTen*sXX] = -4*stress_yz/3;
171 ddJ3[sYZ+ nSymTen*sYY] = 2*stress_yz/3;
173 ddJ3[sYZ+ nSymTen*sZZ] = 2*stress_yz/3;
175 ddJ3[sYZ+ nSymTen*sYZ] = -4*stress_xx/3 + 2*stress_yy/3 + 2*stress_zz/3;
177 ddJ3[sYZ+ nSymTen*sZX] = 2*stress_xy;
179 ddJ3[sYZ+ nSymTen*sXY] = 2*stress_zx;
181 ddJ3[sZX+ nSymTen*sXX] = 2*stress_zx/3;
183 ddJ3[sZX+ nSymTen*sYY] = -4*stress_zx/3;
185 ddJ3[sZX+ nSymTen*sZZ] = 2*stress_zx/3;
187 ddJ3[sZX+ nSymTen*sYZ] = 2*stress_xy;
189 ddJ3[sZX+ nSymTen*sZX] = -4*stress_yy/3 + 2*stress_xx/3 + 2*stress_zz/3;
191 ddJ3[sZX+ nSymTen*sXY] = 2*stress_yz;
193 ddJ3[sXY+ nSymTen*sXX] = 2*stress_xy/3;
195 ddJ3[sXY+ nSymTen*sYY] = 2*stress_xy/3;
197 ddJ3[sXY+ nSymTen*sZZ] = -4*stress_xy/3;
199 ddJ3[sXY+ nSymTen*sYZ] = 2*stress_zx;
201 ddJ3[sXY+ nSymTen*sZX] = 2*stress_yz;
203 ddJ3[sXY+ nSymTen*sXY] = -4*stress_zz/3 + 2*stress_xx/3 + 2*stress_yy/3;
205 theta = -asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3;
207 double stress_1 = -sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 +
s*sqrt(3)/3;
209 double stress_2 = -sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 +
s*sqrt(3)/3;
211 double stress_3 = sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 +
s*sqrt(3)/3;
213 f = -2*
c*sqrt(3)*cos(
phi)/(3 + sin(
phi)) + 2*sqrt(3)*(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 +
s*sqrt(3))*sin(
phi)/(3*(3 + sin(
phi))) + sqrt(pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6 + pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3, 2)/6 + pow(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6);
215 df_dtmp[SKEY] = 2*sin(
phi)/(3 + sin(
phi));
217 df_dtmp[TARGKEY] = ((-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(3*sqrt(targ)) - sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) - 18*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3)*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(3*sqrt(targ)) - 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) - 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12)/sqrt(pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6 + pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3, 2)/6 + pow(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6) + 2*sqrt(3)*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(6*sqrt(targ)) - sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(6*sqrt(targ)) + sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(6*sqrt(targ)) + 9*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 9*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 9*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*sin(
phi)/(3*(3 + sin(
phi)));
219 df_dtmp[J3KEY] = ((-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)/12 + (-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3)/12 + (-12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)/12)/sqrt(pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6 + pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3, 2)/6 + pow(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6) + 2*sqrt(3)*(-6*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 6*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 6*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*sin(
phi)/(3*(3 + sin(
phi)));
221 df[sXX] = df_dtmp[SKEY]*ds[sXX] + df_dtmp[TARGKEY]*dtarg[sXX] + df_dtmp[J3KEY]*dJ3[sXX];
223 df[sYY] = df_dtmp[SKEY]*ds[sYY] + df_dtmp[TARGKEY]*dtarg[sYY] + df_dtmp[J3KEY]*dJ3[sYY];
225 df[sZZ] = df_dtmp[SKEY]*ds[sZZ] + df_dtmp[TARGKEY]*dtarg[sZZ] + df_dtmp[J3KEY]*dJ3[sZZ];
227 df[sYZ] = df_dtmp[SKEY]*ds[sYZ] + df_dtmp[TARGKEY]*dtarg[sYZ] + df_dtmp[J3KEY]*dJ3[sYZ];
229 df[sZX] = df_dtmp[SKEY]*ds[sZX] + df_dtmp[TARGKEY]*dtarg[sZX] + df_dtmp[J3KEY]*dJ3[sZX];
231 df[sXY] = df_dtmp[SKEY]*ds[sXY] + df_dtmp[TARGKEY]*dtarg[sXY] + df_dtmp[J3KEY]*dJ3[sXY];
233 g = -2*
c*sqrt(3)*cos(
psi)/(3 + sin(
psi)) + 2*sqrt(3)*(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 +
s*sqrt(3))*sin(
psi)/(3*(3 + sin(
psi))) + sqrt(pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6 + pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3, 2)/6 + pow(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6);
235 dg_dtmp[SKEY] = 2*sin(
psi)/(3 + sin(
psi));
237 dg_dtmp[TARGKEY] = ((-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(3*sqrt(targ)) - sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) - 18*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3)*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(3*sqrt(targ)) - 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) - 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12)/sqrt(pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6 + pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3, 2)/6 + pow(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6) + 2*sqrt(3)*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(6*sqrt(targ)) - sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(6*sqrt(targ)) + sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(6*sqrt(targ)) + 9*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 9*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 9*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*sin(
psi)/(3*(3 + sin(
psi)));
239 dg_dtmp[J3KEY] = ((-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)/12 + (-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3)/12 + (-12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)/12)/sqrt(pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6 + pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3, 2)/6 + pow(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6) + 2*sqrt(3)*(-6*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 6*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 6*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*sin(
psi)/(3*(3 + sin(
psi)));
241 r[sXX] = dg_dtmp[SKEY]*ds[sXX] + dg_dtmp[TARGKEY]*dtarg[sXX] + dg_dtmp[J3KEY]*dJ3[sXX];
243 r[sYY] = dg_dtmp[SKEY]*ds[sYY] + dg_dtmp[TARGKEY]*dtarg[sYY] + dg_dtmp[J3KEY]*dJ3[sYY];
245 r[sZZ] = dg_dtmp[SKEY]*ds[sZZ] + dg_dtmp[TARGKEY]*dtarg[sZZ] + dg_dtmp[J3KEY]*dJ3[sZZ];
247 r[sYZ] = dg_dtmp[SKEY]*ds[sYZ] + dg_dtmp[TARGKEY]*dtarg[sYZ] + dg_dtmp[J3KEY]*dJ3[sYZ];
249 r[sZX] = dg_dtmp[SKEY]*ds[sZX] + dg_dtmp[TARGKEY]*dtarg[sZX] + dg_dtmp[J3KEY]*dJ3[sZX];
251 r[sXY] = dg_dtmp[SKEY]*ds[sXY] + dg_dtmp[TARGKEY]*dtarg[sXY] + dg_dtmp[J3KEY]*dJ3[sXY];
253 ddg_dtmp[SKEY+3*SKEY] = 0;
255 ddg_dtmp[SKEY+3*TARGKEY] = 0;
257 ddg_dtmp[SKEY+3*J3KEY] = 0;
259 ddg_dtmp[TARGKEY+3*SKEY] = 0;
261 ddg_dtmp[TARGKEY+3*TARGKEY] = ((-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(6*pow(targ, 3.0/2.0)) + sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(6*pow(targ, 3.0/2.0)) - 39366*pow(J3, 3)*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 6)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 27*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 3)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 27*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 3)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 39366*pow(J3, 3)*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 6)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) + 243*sqrt(2)*pow(J3, 2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 9.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 243*sqrt(2)*pow(J3, 2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 9.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3)*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(6*pow(targ, 3.0/2.0)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(6*pow(targ, 3.0/2.0)) - 39366*pow(J3, 3)*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 6)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 27*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 3)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 27*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 3)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 39366*pow(J3, 3)*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 6)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 243*sqrt(2)*pow(J3, 2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 9.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 243*sqrt(2)*pow(J3, 2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 9.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(-sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(6*pow(targ, 3.0/2.0)) - sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(6*pow(targ, 3.0/2.0)) - 39366*pow(J3, 3)*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 6)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 27*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 3)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 27*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 3)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 39366*pow(J3, 3)*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 6)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 243*sqrt(2)*pow(J3, 2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 9.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 243*sqrt(2)*pow(J3, 2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 9.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(3*sqrt(targ)) - 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(6*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(6*sqrt(targ)) - 9*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 9*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(3*sqrt(targ)) - sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) - 18*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(6*sqrt(targ)) - sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(6*sqrt(targ)) - 9*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 9*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(6*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(6*sqrt(targ)) - 9*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 9*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) - 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12)/sqrt(pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6 + pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3, 2)/6 + pow(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6) + (-(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(3*sqrt(targ)) - sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) - 18*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 - (-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3)*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(3*sqrt(targ)) - 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 - (sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) - 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12)*((-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(3*sqrt(targ)) - sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) - 18*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3)*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(3*sqrt(targ)) - 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) - 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12)/pow(pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6 + pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3, 2)/6 + pow(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6, 3.0/2.0) + 2*sqrt(3)*(-sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(12*pow(targ, 3.0/2.0)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(12*pow(targ, 3.0/2.0)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(12*pow(targ, 3.0/2.0)) - 19683*pow(J3, 3)*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 6)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 19683*pow(J3, 3)*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 6)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 19683*pow(J3, 3)*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 6)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 27*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(2*pow(targ, 3)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 27*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(2*pow(targ, 3)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 27*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(2*pow(targ, 3)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 243*sqrt(2)*pow(J3, 2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(2*pow(targ, 9.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 243*sqrt(2)*pow(J3, 2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(2*pow(targ, 9.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 243*sqrt(2)*pow(J3, 2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(2*pow(targ, 9.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))))*sin(
psi)/(3*(3 + sin(
psi)));
263 ddg_dtmp[TARGKEY+3*J3KEY] = ((-6*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 6*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(3*sqrt(targ)) - 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (-6*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 6*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(3*sqrt(targ)) - sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) - 18*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (-6*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 6*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) - 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(-12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 26244*pow(J3, 2)*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 5)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) + 26244*pow(J3, 2)*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 5)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 162*J3*sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 7.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 162*J3*sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 7.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3)*(-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 26244*pow(J3, 2)*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 5)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) + 26244*pow(J3, 2)*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 5)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 162*J3*sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 7.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 162*J3*sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 7.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 26244*pow(J3, 2)*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 5)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) + 26244*pow(J3, 2)*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 5)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) + 162*J3*sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 7.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 162*J3*sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 7.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12)/sqrt(pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6 + pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3, 2)/6 + pow(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6) + (-(-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)/12 - (-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3)/12 - (-12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)/12)*((-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(3*sqrt(targ)) - sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) - 18*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3)*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(3*sqrt(targ)) - 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) - 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12)/pow(pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6 + pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3, 2)/6 + pow(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6, 3.0/2.0) + 2*sqrt(3)*(6*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 6*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 6*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 13122*pow(J3, 2)*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 5)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) + 13122*pow(J3, 2)*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 5)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) + 13122*pow(J3, 2)*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 5)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 81*J3*sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 7.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 81*J3*sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 7.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 81*J3*sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 7.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))))*sin(
psi)/(3*(3 + sin(
psi)));
265 ddg_dtmp[J3KEY+3*SKEY] = 0;
267 ddg_dtmp[J3KEY+3*TARGKEY] = ((-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(6*sqrt(targ)) - sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(6*sqrt(targ)) - 9*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 9*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(6*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(6*sqrt(targ)) - 9*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 9*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (-12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(6*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(6*sqrt(targ)) - 9*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 9*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(-12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 26244*pow(J3, 2)*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 5)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) + 26244*pow(J3, 2)*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 5)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 162*J3*sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 7.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 162*J3*sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 7.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3)*(-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 26244*pow(J3, 2)*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 5)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) + 26244*pow(J3, 2)*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 5)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 162*J3*sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 7.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 162*J3*sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 7.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 26244*pow(J3, 2)*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 5)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) + 26244*pow(J3, 2)*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 5)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) + 162*J3*sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 7.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 162*J3*sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 7.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12)/sqrt(pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6 + pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3, 2)/6 + pow(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6) + (-(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(3*sqrt(targ)) - sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) - 18*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 - (-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3)*(-sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(3*sqrt(targ)) - 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 - (sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) + sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(3*sqrt(targ)) - 18*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 18*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12)*((-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)/12 + (-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3)/12 + (-12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)/12)/pow(pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6 + pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3, 2)/6 + pow(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6, 3.0/2.0) + 2*sqrt(3)*(6*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 6*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 6*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 2)*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 13122*pow(J3, 2)*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 5)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) + 13122*pow(J3, 2)*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 5)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) + 13122*pow(J3, 2)*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 5)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 81*J3*sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 7.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 81*J3*sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 7.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 81*J3*sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 7.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))))*sin(
psi)/(3*(3 + sin(
psi)));
269 ddg_dtmp[J3KEY+3*J3KEY] = ((-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-6*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 6*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-6*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 6*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (-6*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 6*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))/12 + (-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(-17496*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 4)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) + 108*sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 5.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 108*sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 5.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 17496*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 4)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)))/12 + (-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3)*(-17496*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 4)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 108*sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 5.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 108*sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 5.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 17496*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 4)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)))/12 + (sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)*(-17496*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 4)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 108*sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 5.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) - 108*sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 5.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 17496*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 4)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)))/12)/sqrt(pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6 + pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3, 2)/6 + pow(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6) + (-(-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)/12 - (-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3)/12 - (-12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)/12)*((-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)/12 + (-12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3)/12 + (-12*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 12*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(targ*sqrt(1 - 1458*pow(J3, 2)/pow(targ, 3))))*(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3)/12)/pow(pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3 - sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6 + pow(-sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/3, 2)/6 + pow(sqrt(2)*sqrt(targ)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3 + sqrt(2)*sqrt(targ)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/3, 2)/6, 3.0/2.0) + 2*sqrt(3)*(-8748*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 4)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 8748*J3*cos(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 4)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 8748*J3*cos(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 4)*pow(1 - 1458*pow(J3, 2)/pow(targ, 3), 3.0/2.0)) - 54*sqrt(2)*sin(-asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 5.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 54*sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3)/(pow(targ, 5.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))) + 54*sqrt(2)*sin(asin(27*J3*sqrt(2)/pow(targ, 3.0/2.0))/3 + 2*M_PI/3)/(pow(targ, 5.0/2.0)*(1 - 1458*pow(J3, 2)/pow(targ, 3))))*sin(
psi)/(3*(3 + sin(
psi)));
271 dr[sXX+ nSymTen*sXX] = dg_dtmp[TARGKEY]*ddtarg[sXX+nSymTen*sXX] + dg_dtmp[J3KEY]*ddJ3[sXX+nSymTen*sXX]\
272 + ddg_dtmp[SKEY + 3*SKEY]*ds[sXX]*ds[sXX] + ddg_dtmp[SKEY + 3*TARGKEY]*dtarg[sXX]*ds[sXX] + ddg_dtmp[SKEY + 3*J3KEY]*dJ3[sXX]*ds[sXX]\
273 + ddg_dtmp[TARGKEY + 3*SKEY]*ds[sXX]*dtarg[sXX] + ddg_dtmp[TARGKEY + 3*TARGKEY]*dtarg[sXX]*dtarg[sXX] + ddg_dtmp[TARGKEY + 3*J3KEY]*dJ3[sXX]*dtarg[sXX]\
274 + ddg_dtmp[J3KEY + 3*SKEY]*ds[sXX]*dJ3[sXX] + ddg_dtmp[J3KEY + 3*TARGKEY]*dtarg[sXX]*dJ3[sXX] + ddg_dtmp[J3KEY + 3*J3KEY]*dJ3[sXX]*dJ3[sXX];
276 dr[sXX+ nSymTen*sYY] = dg_dtmp[TARGKEY]*ddtarg[sXX+nSymTen*sYY] + dg_dtmp[J3KEY]*ddJ3[sXX+nSymTen*sYY]\
277 + ddg_dtmp[SKEY + 3*SKEY]*ds[sYY]*ds[sXX] + ddg_dtmp[SKEY + 3*TARGKEY]*dtarg[sYY]*ds[sXX] + ddg_dtmp[SKEY + 3*J3KEY]*dJ3[sYY]*ds[sXX]\
278 + ddg_dtmp[TARGKEY + 3*SKEY]*ds[sYY]*dtarg[sXX] + ddg_dtmp[TARGKEY + 3*TARGKEY]*dtarg[sYY]*dtarg[sXX] + ddg_dtmp[TARGKEY + 3*J3KEY]*dJ3[sYY]*dtarg[sXX]\
279 + ddg_dtmp[J3KEY + 3*SKEY]*ds[sYY]*dJ3[sXX] + ddg_dtmp[J3KEY + 3*TARGKEY]*dtar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[sYY];
321 dr[sYY+ nSymTen*sZX] = dg_dtmp[TARGKEY]*ddtarg[sYY+nSymTen*sZX] + dg_dtmp[J3KEY]*ddJ3[sYY+nSymTen*sZX]\
322 + ddg_dtmp[SKEY + 3*SKEY]*ds[sZX]*ds[sYY] + ddg_dtmp[SKEY + 3*TARGKEY]*dtarg[sZX]*ds[sYY] + ddg_dtmp[SKEY + 3*J3KEY]*dJ3[sZX]*ds[sYY]\
323 + ddg_dtmp[TARGKEY + 3*SKEY]*ds[sZX]*dtarg[sYY] + ddg_dtmp[TARGKEY + 3*TARGKEY]*dtarg[sZX]*dtarg[sYY] + ddg_dtmp[TARGKEY + 3*J3KEY]*dJ3[sZX]*dtarg[sYY]\
324 + ddg_dtmp[J3KEY + 3*SKEY]*ds[sZX]*dJ3[sYY] + ddg_dtmp[J3KEY + 3*TARGKEY]*dtarg[sZX]*dJ3[sYY] + ddg_dtmp[J3KEY + 3*J3KEY]*dJ3[sZX]*dJ3[sYY];
326 dr[sYY+ nSymTen*sXY] = dg_dtmp[TARGKEY]*ddtarg[sYY+nSymTen*sXY] + dg_dtmp[J3KEY]*ddJ3[sYY+nSymTen*sXY]\
327 + ddg_dtmp[SKEY + 3*SKEY]*ds[sXY]*ds[sYY] + ddg_dtmp[SKEY + 3*TARGKEY]*dtarg[sXY]*ds[sYY] + ddg_dtmp[SKEY + 3*J3KEY]*dJ3[sXY]*ds[sYY]\
328 + ddg_dtmp[TARGKEY + 3*SKEY]*ds[sXY]*dtarg[sYY] + ddg_dtmp[TARGKEY + 3*TARGKEY]*dtarg[sXY]*dtarg[sYY] + ddg_dtmp[TARGKEY + 3*J3KEY]*dJ3[sXY]*dtarg[sYY]\
329 + ddg_dtmp[J3KEY + 3*SKEY]*ds[sXY]*dJ3[sYY] + ddg_dtmp[J3KEY + 3*TARGKEY]*dtarg[sXY]*dJ3[sYY] + ddg_dtmp[J3KEY + 3*J3KEY]*dJ3[sXY]*dJ3[sYY];
331 dr[sZZ+ nSymTen*sXX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ymTen*sZX] = dg_dtmp[TARGKEY]*ddtarg[sZX+nSymTen*sZX] + dg_dtmp[J3KEY]*ddJ3[sZX+nSymTen*sZX]\
412 + ddg_dtmp[SKEY + 3*SKEY]*ds[sZX]*ds[sZX] + ddg_dtmp[SKEY + 3*TARGKEY]*dtarg[sZX]*ds[sZX] + ddg_dtmp[SKEY + 3*J3KEY]*dJ3[sZX]*ds[sZX]\
413 + ddg_dtmp[TARGKEY + 3*SKEY]*ds[sZX]*dtarg[sZX] + ddg_dtmp[TARGKEY + 3*TARGKEY]*dtarg[sZX]*dtarg[sZX] + ddg_dtmp[TARGKEY + 3*J3KEY]*dJ3[sZX]*dtarg[sZX]\
414 + ddg_dtmp[J3KEY + 3*SKEY]*ds[sZX]*dJ3[sZX] + ddg_dtmp[J3KEY + 3*TARGKEY]*dtarg[sZX]*dJ3[sZX] + ddg_dtmp[J3KEY + 3*J3KEY]*dJ3[sZX]*dJ3[sZX];
416 dr[sZX+ nSymTen*sXY] = dg_dtmp[TARGKEY]*ddtarg[sZX+nSymTen*sXY] + dg_dtmp[J3KEY]*ddJ3[sZX+nSymTen*sXY]\
417 + ddg_dtmp[SKEY + 3*SKEY]*ds[sXY]*ds[sZX] + ddg_dtmp[SKEY + 3*TARGKEY]*dtarg[sXY]*ds[sZX] + ddg_dtmp[SKEY + 3*J3KEY]*dJ3[sXY]*ds[sZX]\
418 + ddg_dtmp[TARGKEY + 3*SKEY]*ds[sXY]*dtarg[sZX] + ddg_dtmp[TARGKEY + 3*TARGKEY]*dtarg[sXY]*dtarg[sZX] + ddg_dtmp[TARGKEY + 3*J3KEY]*dJ3[sXY]*dtarg[sZX]\
419 + ddg_dtmp[J3KEY + 3*SKEY]*ds[sXY]*dJ3[sZX] + ddg_dtmp[J3KEY + 3*TARGKEY]*dtarg[sXY]*dJ3[sZX] + ddg_dtmp[J3KEY + 3*J3KEY]*dJ3[sXY]*dJ3[sZX];
421 dr[sXY+ nSymTen*sXX] = dg_dtmp[TARGKEY]*ddtarg[sXY+nSymTen*sXX] + dg_dtmp[J3KEY]*ddJ3[sXY+nSymTen*sXX]\
422 + ddg_dtmp[SKEY + 3*SKEY]*ds[sXX]*ds[sXY] + ddg_dtmp[SKEY + 3*TARGKEY]*dtarg[sXX]*ds[sXY] + ddg_dtmp[SKEY + 3*J3KEY]*dJ3[sXX]*ds[sXY]\
423 + ddg_dtmp[TARGKEY + 3*SKEY]*ds[sXX]*dtarg[sXY] + ddg_dtmp[TARGKEY + 3*TARGKEY]*dtarg[sXX]*dtarg[sXY] + ddg_dtmp[TARGKEY + 3*J3KEY]*dJ3[sXX]*dtarg[sXY]\
424 + ddg_dtmp[J3KEY + 3*SKEY]*ds[sXX]*dJ3[sXY] + ddg_dtmp[J3KEY + 3*TARGKEY]*dtarg[sXX]*dJ3[sXY] + ddg_dtmp[J3KEY + 3*J3KEY]*dJ3[sXX]*dJ3[sXY];
426 dr[sXY+ nSymTen*sYY] = dg_dtmp[TARGKEY]*ddtarg[sXY+nSymTen*sYY] + dg_dtmp[J3KEY]*ddJ3[sXY+nSymTen*sYY]\
427 + ddg_dtmp[SKEY + 3*SKEY]*ds[sYY]*ds[sXY] + ddg_dtmp[SKEY + 3*TARGKEY]*dtarg[sYY]*ds[sXY] + ddg_dtmp[SKEY + 3*J3KEY]*dJ3[sYY]*ds[sXY]\
428 + ddg_dtmp[TARGKEY + 3*SKEY]*ds[sYY]*dtarg[sXY] + ddg_dtmp[TARGKEY + 3*TARGKEY]*dtarg[sYY]*dtarg[sXY] + ddg_dtmp[TARGKEY + 3*J3KEY]*dJ3[sYY]*dtarg[sXY]\
429 + ddg_dtmp[J3KEY + 3*SKEY]*ds[sYY]*dJ3[sXY] + ddg_dtmp[J3KEY + 3*TARGKEY]*dtarg[sYY]*dJ3[sXY] + ddg_dtmp[J3KEY + 3*J3KEY]*dJ3[sYY]*dJ3[sXY];
431 dr[sXY+ nSymTen*sZZ] = dg_dtmp[TARGKEY]*ddtarg[sXY+nSymTen*sZZ] + dg_d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