Scalar const c0 = 1.0*pow(q.x(), 4);
Scalar const c1 = 1.0*pow(q.y(), 4);
Scalar const c2 = 1.0*pow(q.z(), 4);
Scalar const c3 = pow(q.y(), 2);
Scalar const c4 = pow(q.x(), 2);
Scalar const c5 = 2.0*c4;
Scalar const c6 = pow(q.z(), 2);
Scalar const c7 = c3*c6;
Scalar const c8 = 1.0/(c0 + c1 + c2 + c3*c5 + c5*c6 + 2.0*c7);
Scalar const c9 = 1.0*c4;
Scalar const c10 = sqrt(c3 + c4 + c6);
Scalar const c11 = c10*atan(c10/q.w());
Scalar const c12 = 1.0*c11;
Scalar const c13 = c12*q.w();
Scalar const c14 = c13*c6 + c3*c9;
Scalar const c15 = c13*c3 + c6*c9;
Scalar const c16 = pow(q.z(), 3);
Scalar const c17 = 1.0*c16;
Scalar const c18 = c11*c17;
Scalar const c19 = c9*q.z();
Scalar const c20 = c11*c19;
Scalar const c21 = c3*q.z();
Scalar const c22 = c12*c21;
Scalar const c23 = pow(q.y(), 3);
Scalar const c24 = 1.0*q.x();
Scalar const c25 = 1.0*pow(q.x(), 3);
Scalar const c26 = c6*q.y();
Scalar const c27 = c11*c24;
Scalar const c28 = c27*q.w();
Scalar const c29 = c23*c24 + c24*c26 + c25*q.y() - c28*q.y();
Scalar const c30 = 1.0*c23;
Scalar const c31 = c11*c30;
Scalar const c32 = c11*c9;
Scalar const c33 = c32*q.y();
Scalar const c34 = c12*c26;
Scalar const c35 = c16*c24 + c21*c24 + c25*q.z() - c28*q.z();
Scalar const c36 = c32*q.w() + 1.0*c7;
Scalar const c37 = c11*c25;
Scalar const c38 = c27*c3;
Scalar const c39 = c27*c6;
Scalar const c40 = -c13*q.y()*q.z() + c17*q.y() + c19*q.y() + c30*q.z();
result[0] = c8*(c0 + c14 + c15);
result[1] = c8*(c18 + c20 + c22 + c29);
result[2] = c8*(-c31 - c33 - c34 + c35);
result[3] = c8*(-c18 - c20 - c22 + c29);
result[4] = c8*(c1 + c14 + c36);
result[5] = c8*(c37 + c38 + c39 + c40);
result[6] = c8*(c31 + c33 + c34 + c35);
result[7] = c8*(-c37 - c38 - c39 + c40);
result[8] = c8*(c15 + c2 + c36);
