/// autogenerated analytical inverse kinematics code from ikfast program part of OpenRAVE
/// \author Rosen Diankov
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///     http://www.apache.org/licenses/LICENSE-2.0
/// 
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
/// ikfast version 59 generated on 2012-06-29 00:23:54.147056
/// To compile with gcc:
///     gcc -lstdc++ ik.cpp
/// To compile without any main function as a shared object (might need -llapack):
///     gcc -fPIC -lstdc++ -DIKFAST_NO_MAIN -DIKFAST_CLIBRARY -shared -Wl,-soname,libik.so -o libik.so ik.cpp
#include <cmath>
#include <vector>
#include <limits>
#include <algorithm>
#include <complex>

#ifdef IKFAST_HEADER
#include IKFAST_HEADER
#endif

#ifndef IKFAST_ASSERT
#include <stdexcept>
#include <sstream>
#include <iostream>

#ifdef _MSC_VER
#ifndef __PRETTY_FUNCTION__
#define __PRETTY_FUNCTION__ __FUNCDNAME__
#endif
#endif

#ifndef __PRETTY_FUNCTION__
#define __PRETTY_FUNCTION__ __func__
#endif

#define IKFAST_ASSERT(b) { if( !(b) ) { std::stringstream ss; ss << "ikfast exception: " << __FILE__ << ":" << __LINE__ << ": " <<__PRETTY_FUNCTION__ << ": Assertion '" << #b << "' failed"; throw std::runtime_error(ss.str()); } }

#endif

#if defined(_MSC_VER)
#define IKFAST_ALIGNED16(x) __declspec(align(16)) x
#else
#define IKFAST_ALIGNED16(x) x __attribute((aligned(16)))
#endif

#define IK2PI  ((IKReal)6.28318530717959)
#define IKPI  ((IKReal)3.14159265358979)
#define IKPI_2  ((IKReal)1.57079632679490)

#ifdef _MSC_VER
#ifndef isnan
#define isnan _isnan
#endif
#endif // _MSC_VER

// defined when creating a shared object/dll
#ifdef IKFAST_CLIBRARY
#ifdef _MSC_VER
#define IKFAST_API extern "C" __declspec(dllexport)
#else
#define IKFAST_API extern "C"
#endif
#else
#define IKFAST_API
#endif

// lapack routines
extern "C" {
  void dgetrf_ (const int* m, const int* n, double* a, const int* lda, int* ipiv, int* info);
  void zgetrf_ (const int* m, const int* n, std::complex<double>* a, const int* lda, int* ipiv, int* info);
  void dgetri_(const int* n, const double* a, const int* lda, int* ipiv, double* work, const int* lwork, int* info);
  void dgesv_ (const int* n, const int* nrhs, double* a, const int* lda, int* ipiv, double* b, const int* ldb, int* info);
  void dgetrs_(const char *trans, const int *n, const int *nrhs, double *a, const int *lda, int *ipiv, double *b, const int *ldb, int *info);
  void dgeev_(const char *jobvl, const char *jobvr, const int *n, double *a, const int *lda, double *wr, double *wi,double *vl, const int *ldvl, double *vr, const int *ldvr, double *work, const int *lwork, int *info);
}

using namespace std; // necessary to get std math routines

#ifdef IKFAST_NAMESPACE
namespace IKFAST_NAMESPACE {
#endif

#ifdef IKFAST_REAL
typedef IKFAST_REAL IKReal;
#else
typedef double IKReal;
#endif

class IKSolution
{
public:
    /// Gets a solution given its free parameters
    /// \param pfree The free parameters required, range is in [-pi,pi]
    void GetSolution(IKReal* psolution, const IKReal* pfree) const {
        for(std::size_t i = 0; i < basesol.size(); ++i) {
            if( basesol[i].freeind < 0 )
                psolution[i] = basesol[i].foffset;
            else {
                IKFAST_ASSERT(pfree != NULL);
                psolution[i] = pfree[basesol[i].freeind]*basesol[i].fmul + basesol[i].foffset;
                if( psolution[i] > IKPI ) {
                    psolution[i] -= IK2PI;
                }
                else if( psolution[i] < -IKPI ) {
                    psolution[i] += IK2PI;
                }
            }
        }
    }

    /// Gets the free parameters the solution requires to be set before a full solution can be returned
    /// \return vector of indices indicating the free parameters
    const std::vector<int>& GetFree() const { return vfree; }

    struct VARIABLE
    {
        VARIABLE() : fmul(0), foffset(0), freeind(-1), maxsolutions(1) {
            indices[0] = indices[1] = -1;
        }
        IKReal fmul, foffset; ///< joint value is fmul*sol[freeind]+foffset
        signed char freeind; ///< if >= 0, mimics another joint
        unsigned char maxsolutions; ///< max possible indices, 0 if controlled by free index or a free joint itself
        unsigned char indices[2]; ///< unique index of the solution used to keep track on what part it came from. sometimes a solution can be repeated for different indices. store at least another repeated root
    };

    std::vector<VARIABLE> basesol;       ///< solution and their offsets if joints are mimiced
    std::vector<int> vfree;

    bool Validate() const {
        for(size_t i = 0; i < basesol.size(); ++i) {
            if( basesol[i].maxsolutions == (unsigned char)-1) {
                return false;
            }
            if( basesol[i].maxsolutions > 0 ) {
                if( basesol[i].indices[0] >= basesol[i].maxsolutions ) {
                    return false;
                }
                if( basesol[i].indices[1] != (unsigned char)-1 && basesol[i].indices[1] >= basesol[i].maxsolutions ) {
                    return false;
                }
            }
        }
        return true;
    }

    void GetSolutionIndices(std::vector<unsigned int>& v) const {
        v.resize(0);
        v.push_back(0);
        for(int i = (int)basesol.size()-1; i >= 0; --i) {
            if( basesol[i].maxsolutions != (unsigned char)-1 && basesol[i].maxsolutions > 1 ) {
                for(size_t j = 0; j < v.size(); ++j) {
                    v[j] *= basesol[i].maxsolutions;
                }
                size_t orgsize=v.size();
                if( basesol[i].indices[1] != (unsigned char)-1 ) {
                    for(size_t j = 0; j < orgsize; ++j) {
                        v.push_back(v[j]+basesol[i].indices[1]);
                    }
                }
                if( basesol[i].indices[0] != (unsigned char)-1 ) {
                    for(size_t j = 0; j < orgsize; ++j) {
                        v[j] += basesol[i].indices[0];
                    }
                }
            }
        }
    }
};

inline float IKabs(float f) { return fabsf(f); }
inline double IKabs(double f) { return fabs(f); }

inline float IKsqr(float f) { return f*f; }
inline double IKsqr(double f) { return f*f; }

inline float IKlog(float f) { return logf(f); }
inline double IKlog(double f) { return log(f); }

// allows asin and acos to exceed 1
#ifndef IKFAST_SINCOS_THRESH
#define IKFAST_SINCOS_THRESH ((IKReal)0.000001)
#endif

// used to check input to atan2 for degenerate cases
#ifndef IKFAST_ATAN2_MAGTHRESH
#define IKFAST_ATAN2_MAGTHRESH ((IKReal)2e-6)
#endif

// minimum distance of separate solutions
#ifndef IKFAST_SOLUTION_THRESH
#define IKFAST_SOLUTION_THRESH ((IKReal)1e-6)
#endif

inline float IKasin(float f)
{
IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver
if( f <= -1 ) return float(-IKPI_2);
else if( f >= 1 ) return float(IKPI_2);
return asinf(f);
}
inline double IKasin(double f)
{
IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver
if( f <= -1 ) return -IKPI_2;
else if( f >= 1 ) return IKPI_2;
return asin(f);
}

// return positive value in [0,y)
inline float IKfmod(float x, float y)
{
    while(x < 0) {
        x += y;
    }
    return fmodf(x,y);
}

// return positive value in [0,y)
inline double IKfmod(double x, double y)
{
    while(x < 0) {
        x += y;
    }
    return fmod(x,y);
}

inline float IKacos(float f)
{
IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver
if( f <= -1 ) return float(IKPI);
else if( f >= 1 ) return float(0);
return acosf(f);
}
inline double IKacos(double f)
{
IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver
if( f <= -1 ) return IKPI;
else if( f >= 1 ) return 0;
return acos(f);
}
inline float IKsin(float f) { return sinf(f); }
inline double IKsin(double f) { return sin(f); }
inline float IKcos(float f) { return cosf(f); }
inline double IKcos(double f) { return cos(f); }
inline float IKtan(float f) { return tanf(f); }
inline double IKtan(double f) { return tan(f); }
inline float IKsqrt(float f) { if( f <= 0.0f ) return 0.0f; return sqrtf(f); }
inline double IKsqrt(double f) { if( f <= 0.0 ) return 0.0; return sqrt(f); }
inline float IKatan2(float fy, float fx) {
    if( isnan(fy) ) {
        IKFAST_ASSERT(!isnan(fx)); // if both are nan, probably wrong value will be returned
        return float(IKPI_2);
    }
    else if( isnan(fx) ) {
        return 0;
    }
    return atan2f(fy,fx);
}
inline double IKatan2(double fy, double fx) {
    if( isnan(fy) ) {
        IKFAST_ASSERT(!isnan(fx)); // if both are nan, probably wrong value will be returned
        return IKPI_2;
    }
    else if( isnan(fx) ) {
        return 0;
    }
    return atan2(fy,fx);
}

inline float IKsign(float f) {
    if( f > 0 ) {
        return float(1);
    }
    else if( f < 0 ) {
        return float(-1);
    }
    return 0;
}

inline double IKsign(double f) {
    if( f > 0 ) {
        return 1.0;
    }
    else if( f < 0 ) {
        return -1.0;
    }
    return 0;
}

/// solves the forward kinematics equations.
/// \param pfree is an array specifying the free joints of the chain.
IKFAST_API void fk(const IKReal* j, IKReal* eetrans, IKReal* eerot) {
IKReal x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21;
x0=IKcos(j[0]);
x1=IKsin(j[1]);
x2=IKcos(j[3]);
x3=IKsin(j[3]);
x4=IKcos(j[1]);
x5=IKcos(j[2]);
x6=IKsin(j[0]);
x7=IKsin(j[2]);
x8=((IKReal(0.0450000000000000))*(x3));
x9=((IKReal(0.350000000000000))*(x4));
x10=((IKReal(0.350000000000000))*(x7));
x11=((IKReal(0.0450000000000000))*(x6));
x12=((IKReal(0.350000000000000))*(x2));
x13=((x0)*(x1));
x14=((x1)*(x5));
x15=((x0)*(x5));
x16=((x1)*(x6));
x17=((x11)*(x7));
x18=((IKReal(0.0450000000000000))*(x0)*(x7));
x19=((IKReal(0.0450000000000000))*(x15)*(x4));
x20=((x11)*(x4)*(x5));
x21=((x18)+(x20));
eetrans[0]=((IKReal(0.220000000000000))+(((IKReal(0.550000000000000))*(x13)))+(((IKReal(-1.00000000000000))*(x17)))+(x19)+(((x12)*(x13)))+(((x2)*(((((IKReal(-1.00000000000000))*(x19)))+(x17)))))+(((x3)*(((((IKReal(-1.00000000000000))*(x10)*(x6)))+(((x15)*(x9)))))))+(((x13)*(x8))));
eetrans[1]=((IKReal(0.140000000000000))+(((IKReal(0.550000000000000))*(x16)))+(((IKReal(-1.00000000000000))*(x2)*(x21)))+(x21)+(((x3)*(((((x0)*(x10)))+(((x5)*(x6)*(x9)))))))+(((x16)*(x8)))+(((x12)*(x16))));
IKReal x22=((IKReal(0.0450000000000000))*(x14));
eetrans[2]=((IKReal(0.346000000000000))+(((IKReal(-1.00000000000000))*(x22)))+(((x4)*(x8)))+(((x2)*(x22)))+(((x2)*(x9)))+(((IKReal(-0.350000000000000))*(x14)*(x3)))+(((IKReal(0.550000000000000))*(x4))));
}

IKFAST_API int getNumFreeParameters() { return 1; }
IKFAST_API int* getFreeParameters() { static int freeparams[] = {1}; return freeparams; }
IKFAST_API int getNumJoints() { return 4; }

IKFAST_API int getIKRealSize() { return sizeof(IKReal); }

IKFAST_API int getIKType() { return 0x33000003; }

class IKSolver {
public:
IKReal j0,cj0,sj0,htj0,j2,cj2,sj2,htj2,j3,cj3,sj3,htj3,j1,cj1,sj1,htj1,new_px,px,npx,new_py,py,npy,new_pz,pz,npz,pp;
unsigned char _ij0[2], _nj0,_ij2[2], _nj2,_ij3[2], _nj3,_ij1[2], _nj1;

bool ik(const IKReal* eetrans, const IKReal* eerot, const IKReal* pfree, std::vector<IKSolution>& vsolutions) {
j0=numeric_limits<IKReal>::quiet_NaN(); _ij0[0] = -1; _ij0[1] = -1; _nj0 = -1; j2=numeric_limits<IKReal>::quiet_NaN(); _ij2[0] = -1; _ij2[1] = -1; _nj2 = -1; j3=numeric_limits<IKReal>::quiet_NaN(); _ij3[0] = -1; _ij3[1] = -1; _nj3 = -1;  _ij1[0] = -1; _ij1[1] = -1; _nj1 = 0; 
for(int dummyiter = 0; dummyiter < 1; ++dummyiter) {
    vsolutions.resize(0); vsolutions.reserve(8);
j1=pfree[0]; cj1=cos(pfree[0]); sj1=sin(pfree[0]);
px = eetrans[0]; py = eetrans[1]; pz = eetrans[2];

new_px=((IKReal(-0.220000000000000))+(px));
new_py=((IKReal(-0.140000000000000))+(py));
new_pz=((IKReal(-0.346000000000000))+(pz));
px = new_px; py = new_py; pz = new_pz;
pp=(((px)*(px))+((py)*(py))+((pz)*(pz)));
{
IKReal j3array[2], cj3array[2], sj3array[2];
bool j3valid[2]={false};
_nj3 = 2;
if( (((IKReal(1.10163610111212))+(((IKReal(-2.56761706354067))*(pp))))) < -1-IKFAST_SINCOS_THRESH || (((IKReal(1.10163610111212))+(((IKReal(-2.56761706354067))*(pp))))) > 1+IKFAST_SINCOS_THRESH )
    continue;
IKReal x23=IKasin(((IKReal(1.10163610111212))+(((IKReal(-2.56761706354067))*(pp)))));
j3array[0]=((IKReal(-1.36129006610583))+(((IKReal(-1.00000000000000))*(x23))));
sj3array[0]=IKsin(j3array[0]);
cj3array[0]=IKcos(j3array[0]);
j3array[1]=((IKReal(1.78030258748397))+(x23));
sj3array[1]=IKsin(j3array[1]);
cj3array[1]=IKcos(j3array[1]);
if( j3array[0] > IKPI )
{
    j3array[0]-=IK2PI;
}
else if( j3array[0] < -IKPI )
{    j3array[0]+=IK2PI;
}
j3valid[0] = true;
if( j3array[1] > IKPI )
{
    j3array[1]-=IK2PI;
}
else if( j3array[1] < -IKPI )
{    j3array[1]+=IK2PI;
}
j3valid[1] = true;
for(int ij3 = 0; ij3 < 2; ++ij3)
{
if( !j3valid[ij3] )
{
    continue;
}
_ij3[0] = ij3; _ij3[1] = -1;
for(int iij3 = ij3+1; iij3 < 2; ++iij3)
{
if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
{
    j3valid[iij3]=false; _ij3[1] = iij3; break; 
}
}
j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];

{
IKReal dummyeval[1];
IKReal x24=(sj1)*(sj1);
dummyeval[0]=((((x24)*((px)*(px))))+(((x24)*((py)*(py)))));
if( IKabs(dummyeval[0]) < 0.0000010000000000  )
{
{
IKReal dummyeval[1];
IKReal x25=(sj1)*(sj1);
dummyeval[0]=((((x25)*((px)*(px))))+(((x25)*((py)*(py)))));
if( IKabs(dummyeval[0]) < 0.0000010000000000  )
{
{
IKReal dummyeval[1];
IKReal x26=(sj1)*(sj1);
dummyeval[0]=((((x26)*((px)*(px)*(px)*(px))))+(((x26)*((px)*(px))*((py)*(py)))));
if( IKabs(dummyeval[0]) < 0.0000010000000000  )
{
{
IKReal evalcond[3];
evalcond[0]=((IKReal(-3.14159265358979))+(IKfmod(((IKReal(3.14159265358979))+(j1)), IKReal(6.28318530717959))));
evalcond[1]=((IKReal(0.429050000000000))+(((IKReal(0.380950000000000))*(cj3)))+(((IKReal(0.0810000000000000))*(sj3)))+(((IKReal(-1.00000000000000))*(pp))));
evalcond[2]=((IKReal(-0.550000000000000))+(((IKReal(-0.0450000000000000))*(sj3)))+(((IKReal(-0.350000000000000))*(cj3)))+(pz));
if( IKabs(evalcond[0]) < 0.0000010000000000  && IKabs(evalcond[1]) < 0.0000010000000000  && IKabs(evalcond[2]) < 0.0000010000000000  )
{
{
IKReal dummyeval[1];
IKReal gconst3;
gconst3=((IKReal(-1.00000000000000))*(py));
IKReal gconst4;
gconst4=((IKReal(2.00000000000000))*(px));
IKReal gconst5;
gconst5=py;
IKReal gconst6;
gconst6=((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))+(((IKReal(-1.00000000000000))*(px))));
IKReal gconst7;
gconst7=((IKReal(-2.00000000000000))*(py));
IKReal gconst8;
gconst8=((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))+(px));
IKReal gconst9;
gconst9=((IKReal(-1.00000000000000))*(py));
IKReal gconst10;
gconst10=((IKReal(2.00000000000000))*(px));
IKReal gconst11;
gconst11=py;
IKReal gconst12;
gconst12=((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))+(((IKReal(-1.00000000000000))*(px))));
IKReal gconst13;
gconst13=((IKReal(-2.00000000000000))*(py));
IKReal gconst14;
gconst14=((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))+(px));
IKReal gconst15;
gconst15=((IKReal(2.00000000000000))*(px));
IKReal gconst16;
gconst16=((IKReal(4.00000000000000))*(py));
IKReal gconst17;
gconst17=((IKReal(-2.00000000000000))*(px));
IKReal gconst18;
gconst18=((IKReal(-2.00000000000000))*(py));
IKReal gconst19;
gconst19=((IKReal(4.00000000000000))*(px));
IKReal gconst20;
gconst20=((IKReal(2.00000000000000))*(py));
IKReal gconst21;
gconst21=((IKReal(2.00000000000000))*(px));
IKReal gconst22;
gconst22=((IKReal(4.00000000000000))*(py));
IKReal gconst23;
gconst23=((IKReal(-2.00000000000000))*(px));
IKReal gconst24;
gconst24=((IKReal(-2.00000000000000))*(py));
IKReal gconst25;
gconst25=((IKReal(4.00000000000000))*(px));
IKReal gconst26;
gconst26=((IKReal(2.00000000000000))*(py));
IKReal gconst27;
gconst27=py;
IKReal gconst28;
gconst28=((IKReal(-2.00000000000000))*(px));
IKReal gconst29;
gconst29=((IKReal(-1.00000000000000))*(py));
IKReal gconst30;
gconst30=((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))+(px));
IKReal gconst31;
gconst31=((IKReal(2.00000000000000))*(py));
IKReal gconst32;
gconst32=((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))+(((IKReal(-1.00000000000000))*(px))));
IKReal gconst33;
gconst33=py;
IKReal gconst34;
gconst34=((IKReal(-2.00000000000000))*(px));
IKReal gconst35;
gconst35=((IKReal(-1.00000000000000))*(py));
IKReal gconst36;
gconst36=((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))+(px));
IKReal gconst37;
gconst37=((IKReal(2.00000000000000))*(py));
IKReal gconst38;
gconst38=((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))+(((IKReal(-1.00000000000000))*(px))));
IKReal x27=((gconst33)*(gconst37));
IKReal x28=((gconst28)*(gconst32));
IKReal x29=((gconst29)*(gconst31));
IKReal x30=((gconst34)*(gconst36));
IKReal x31=((gconst27)*(gconst32));
IKReal x32=((gconst33)*(gconst38));
IKReal x33=((gconst35)*(gconst36));
IKReal x34=((gconst29)*(gconst30));
dummyeval[0]=((((IKReal(-1.00000000000000))*(x27)*(x29)))+(((x29)*(x30)))+(((IKReal(-1.00000000000000))*(x31)*(x32)))+(((IKReal(-1.00000000000000))*(x28)*(x30)))+(((x32)*(x34)))+(((IKReal(-1.00000000000000))*(x33)*(x34)))+(((x31)*(x33)))+(((x27)*(x28))));
if( IKabs(dummyeval[0]) < 0.0000001000000000  )
{
continue;

} else
{
IKReal op[8+1], zeror[8];
int numroots;
IKReal x35=((gconst32)*(gconst36));
IKReal x36=((gconst32)*(gconst33));
IKReal x37=((gconst28)*(gconst37));
IKReal x38=((IKReal(1.00000000000000))*(gconst34));
IKReal x39=((gconst33)*(gconst38));
IKReal x40=((gconst17)*(gconst30));
IKReal x41=((gconst26)*(gconst9));
IKReal x42=((gconst5)*(gconst6));
IKReal x43=((IKReal(1.00000000000000))*(gconst8));
IKReal x44=((gconst14)*(gconst9));
IKReal x45=((gconst18)*(gconst5));
IKReal x46=((IKReal(1.00000000000000))*(gconst27));
IKReal x47=((gconst10)*(gconst12));
IKReal x48=((gconst17)*(gconst7));
IKReal x49=((gconst17)*(gconst6));
IKReal x50=((gconst5)*(gconst7));
IKReal x51=((gconst12)*(gconst3));
IKReal x52=((gconst13)*(gconst9));
IKReal x53=((gconst27)*(gconst35));
IKReal x54=((gconst14)*(gconst21));
IKReal x55=((gconst12)*(gconst22));
IKReal x56=((gconst4)*(gconst8));
IKReal x57=((gconst13)*(gconst21));
IKReal x58=((gconst31)*(gconst36));
IKReal x59=((gconst20)*(gconst36));
IKReal x60=((gconst21)*(gconst38));
IKReal x61=((IKReal(1.00000000000000))*(gconst20));
IKReal x62=((IKReal(1.00000000000000))*(gconst29));
IKReal x63=((gconst33)*(gconst37));
IKReal x64=((gconst30)*(gconst35));
IKReal x65=((gconst29)*(gconst30));
IKReal x66=((gconst25)*(gconst9));
IKReal x67=((gconst11)*(gconst24));
IKReal x68=((gconst24)*(gconst32));
IKReal x69=((gconst10)*(gconst24));
IKReal x70=((gconst11)*(gconst8));
IKReal x71=((gconst19)*(gconst5));
IKReal x72=((gconst29)*(gconst31)*(gconst34));
IKReal x73=((IKReal(1.00000000000000))*(gconst11)*(gconst12));
IKReal x74=((gconst36)*(x62));
IKReal x75=((gconst31)*(gconst33)*(x62));
op[0]=((((x39)*(x65)))+(((x36)*(x37)))+(((x35)*(x53)))+(((IKReal(-1.00000000000000))*(gconst28)*(x35)*(x38)))+(((gconst29)*(gconst34)*(x58)))+(((IKReal(-1.00000000000000))*(gconst38)*(x36)*(x46)))+(((IKReal(-1.00000000000000))*(gconst31)*(x62)*(x63)))+(((IKReal(-1.00000000000000))*(x64)*(x74))));
op[1]=((((IKReal(-1.00000000000000))*(gconst35)*(gconst36)*(x40)))+(((IKReal(-1.00000000000000))*(gconst25)*(x75)))+(((gconst21)*(gconst32)*(x37)))+(((IKReal(-1.00000000000000))*(gconst16)*(x35)*(x38)))+(((x60)*(x65)))+(((gconst17)*(gconst34)*(x58)))+(((IKReal(-1.00000000000000))*(gconst22)*(gconst28)*(x35)))+(((IKReal(-1.00000000000000))*(gconst19)*(x62)*(x63)))+(((IKReal(-1.00000000000000))*(gconst26)*(x36)*(x46)))+(((x39)*(x40)))+(((IKReal(-1.00000000000000))*(gconst23)*(gconst30)*(x74)))+(((IKReal(-1.00000000000000))*(gconst28)*(x38)*(x68)))+(((gconst20)*(gconst33)*(x37)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst31)*(x63)))+(((IKReal(-1.00000000000000))*(gconst18)*(gconst35)*(x74)))+(((gconst23)*(gconst27)*(x35)))+(((gconst19)*(gconst29)*(gconst34)*(gconst36)))+(((gconst22)*(gconst29)*(x58)))+(((gconst16)*(gconst37)*(x36)))+(((IKReal(-1.00000000000000))*(gconst28)*(x38)*(x59)))+(((IKReal(-1.00000000000000))*(gconst32)*(x46)*(x60)))+(((IKReal(-1.00000000000000))*(gconst20)*(x39)*(x46)))+(((x53)*(x68)))+(((gconst24)*(x72)))+(((IKReal(-1.00000000000000))*(gconst21)*(gconst31)*(gconst37)*(x62)))+(((x53)*(x59)))+(((IKReal(-1.00000000000000))*(gconst24)*(x62)*(x64)))+(((gconst26)*(gconst33)*(x65)))+(((IKReal(-1.00000000000000))*(gconst15)*(gconst38)*(x36)))+(((gconst18)*(gconst29)*(x39)))+(((gconst15)*(gconst35)*(x35)))+(((gconst25)*(gconst28)*(x36))));
op[2]=((((gconst16)*(gconst21)*(gconst32)*(gconst37)))+(((gconst27)*(gconst35)*(gconst36)*(gconst8)))+(((gconst10)*(gconst29)*(gconst31)*(gconst36)))+(((gconst21)*(gconst25)*(gconst28)*(gconst32)))+(((gconst18)*(gconst21)*(gconst29)*(gconst38)))+(((gconst16)*(gconst20)*(gconst33)*(gconst37)))+(((IKReal(-1.00000000000000))*(gconst16)*(gconst24)*(gconst32)*(gconst34)))+(((IKReal(-1.00000000000000))*(gconst18)*(gconst24)*(gconst29)*(gconst35)))+(((gconst21)*(gconst26)*(gconst29)*(gconst30)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst23)*(gconst30)*(gconst36)))+(((gconst20)*(gconst24)*(gconst27)*(gconst35)))+(((IKReal(-1.00000000000000))*(gconst16)*(gconst20)*(gconst34)*(gconst36)))+(((gconst12)*(gconst27)*(gconst32)*(gconst35)))+(((IKReal(-1.00000000000000))*(gconst21)*(gconst25)*(gconst29)*(gconst31)))+(((gconst30)*(gconst33)*(gconst38)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst29)*(gconst30)*(gconst35)))+(((gconst31)*(gconst34)*(gconst36)*(gconst5)))+(((gconst17)*(gconst22)*(gconst31)*(gconst36)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst27)*(gconst32)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst15)*(gconst20)*(gconst33)*(gconst38)))+(((gconst28)*(gconst32)*(gconst37)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst16)*(gconst22)*(gconst32)*(gconst36)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst29)*(gconst30)*(gconst36)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst28)*(gconst32)*(gconst36)))+(((IKReal(-1.00000000000000))*(gconst20)*(gconst24)*(gconst28)*(gconst34)))+(((IKReal(-1.00000000000000))*(gconst19)*(gconst25)*(gconst29)*(gconst33)))+(((gconst16)*(gconst25)*(gconst32)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst23)*(gconst24)*(gconst29)*(gconst30)))+(((IKReal(-1.00000000000000))*(gconst29)*(gconst31)*(gconst37)*(gconst9)))+(((gconst17)*(gconst18)*(gconst33)*(gconst38)))+(((gconst28)*(gconst33)*(gconst37)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst32)*(gconst34)*(gconst36)*(gconst4)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst19)*(gconst33)*(gconst37)))+(((gconst29)*(gconst30)*(gconst38)*(gconst9)))+(((gconst11)*(gconst27)*(gconst32)*(gconst36)))+(((gconst18)*(gconst26)*(gconst29)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst30)*(gconst35)*(gconst36)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst29)*(gconst33)*(gconst37)*(gconst7)))+(((gconst29)*(gconst33)*(gconst38)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst21)*(gconst31)*(gconst37)))+(((IKReal(-1.00000000000000))*(gconst3)*(gconst32)*(gconst33)*(gconst38)))+(((IKReal(-1.00000000000000))*(gconst28)*(gconst34)*(gconst36)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst20)*(gconst26)*(gconst27)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst22)*(gconst24)*(gconst28)*(gconst32)))+(((gconst14)*(gconst29)*(gconst30)*(gconst33)))+(((gconst17)*(gconst26)*(gconst30)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst31)*(gconst33)*(gconst37)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst15)*(gconst21)*(gconst32)*(gconst38)))+(((gconst19)*(gconst24)*(gconst29)*(gconst34)))+(((gconst15)*(gconst23)*(gconst32)*(gconst36)))+(((IKReal(-1.00000000000000))*(gconst19)*(gconst21)*(gconst29)*(gconst37)))+(((gconst15)*(gconst24)*(gconst32)*(gconst35)))+(((gconst13)*(gconst28)*(gconst32)*(gconst33)))+(((gconst20)*(gconst21)*(gconst28)*(gconst37)))+(((IKReal(-1.00000000000000))*(gconst20)*(gconst22)*(gconst28)*(gconst36)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst24)*(gconst30)*(gconst35)))+(((IKReal(-1.00000000000000))*(gconst27)*(gconst33)*(gconst38)*(gconst8)))+(((gconst12)*(gconst29)*(gconst31)*(gconst34)))+(((gconst23)*(gconst24)*(gconst27)*(gconst32)))+(((gconst22)*(gconst24)*(gconst29)*(gconst31)))+(((gconst17)*(gconst19)*(gconst34)*(gconst36)))+(((IKReal(-1.00000000000000))*(gconst27)*(gconst32)*(gconst38)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst29)*(gconst35)*(gconst36)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst15)*(gconst26)*(gconst32)*(gconst33)))+(((gconst19)*(gconst22)*(gconst29)*(gconst36)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst18)*(gconst35)*(gconst36)))+(((gconst29)*(gconst34)*(gconst36)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst29)*(gconst31)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst28)*(gconst32)*(gconst34)))+(((gconst32)*(gconst33)*(gconst37)*(gconst4)))+(((gconst3)*(gconst32)*(gconst35)*(gconst36)))+(((IKReal(-1.00000000000000))*(gconst21)*(gconst26)*(gconst27)*(gconst32)))+(((IKReal(-1.00000000000000))*(gconst20)*(gconst21)*(gconst27)*(gconst38)))+(((gconst20)*(gconst25)*(gconst28)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst18)*(gconst23)*(gconst29)*(gconst36)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst25)*(gconst31)*(gconst33)))+(((gconst15)*(gconst20)*(gconst35)*(gconst36)))+(((gconst20)*(gconst23)*(gconst27)*(gconst36)))+(((gconst17)*(gconst24)*(gconst31)*(gconst34)))+(((gconst17)*(gconst21)*(gconst30)*(gconst38))));
op[3]=((((IKReal(-1.00000000000000))*(gconst14)*(gconst21)*(gconst27)*(gconst32)))+(((gconst23)*(gconst27)*(gconst36)*(gconst8)))+(((gconst19)*(gconst22)*(gconst24)*(gconst29)))+(((IKReal(-1.00000000000000))*(gconst16)*(gconst34)*(gconst36)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst20)*(gconst34)*(gconst36)*(gconst4)))+(((IKReal(-1.00000000000000))*(gconst18)*(gconst23)*(gconst24)*(gconst29)))+(((gconst17)*(gconst18)*(gconst21)*(gconst38)))+(((IKReal(-1.00000000000000))*(gconst21)*(gconst29)*(gconst37)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst24)*(gconst32)*(gconst34)*(gconst4)))+(((gconst20)*(gconst28)*(gconst37)*(gconst9)))+(((gconst26)*(gconst29)*(gconst33)*(gconst6)))+(((gconst20)*(gconst3)*(gconst35)*(gconst36)))+(((gconst24)*(gconst27)*(gconst35)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst23)*(gconst24)*(gconst30)))+(((gconst15)*(gconst20)*(gconst24)*(gconst35)))+(((IKReal(-1.00000000000000))*(gconst18)*(gconst35)*(gconst36)*(gconst5)))+(((gconst12)*(gconst17)*(gconst31)*(gconst34)))+(((IKReal(-1.00000000000000))*(gconst19)*(gconst29)*(gconst37)*(gconst9)))+(((gconst16)*(gconst20)*(gconst25)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst16)*(gconst22)*(gconst24)*(gconst32)))+(((IKReal(-1.00000000000000))*(gconst15)*(gconst33)*(gconst38)*(gconst8)))+(((gconst12)*(gconst22)*(gconst29)*(gconst31)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst18)*(gconst29)*(gconst35)))+(((IKReal(-1.00000000000000))*(gconst16)*(gconst20)*(gconst24)*(gconst34)))+(((gconst15)*(gconst20)*(gconst23)*(gconst36)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst21)*(gconst29)*(gconst31)))+(((IKReal(-1.00000000000000))*(gconst24)*(gconst29)*(gconst35)*(gconst6)))+(((gconst24)*(gconst31)*(gconst34)*(gconst5)))+(((gconst24)*(gconst29)*(gconst34)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst23)*(gconst29)*(gconst30)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst18)*(gconst24)*(gconst35)))+(((gconst11)*(gconst15)*(gconst32)*(gconst36)))+(((gconst14)*(gconst18)*(gconst29)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst24)*(gconst29)*(gconst30)))+(((gconst20)*(gconst33)*(gconst37)*(gconst4)))+(((IKReal(-1.00000000000000))*(gconst25)*(gconst29)*(gconst33)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst16)*(gconst32)*(gconst36)))+(((gconst17)*(gconst33)*(gconst38)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst19)*(gconst33)*(gconst37)*(gconst5)))+(((gconst21)*(gconst29)*(gconst38)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst25)*(gconst29)*(gconst31)*(gconst9)))+(((gconst17)*(gconst19)*(gconst22)*(gconst36)))+(((gconst17)*(gconst21)*(gconst26)*(gconst30)))+(((gconst20)*(gconst23)*(gconst24)*(gconst27)))+(((gconst10)*(gconst17)*(gconst31)*(gconst36)))+(((gconst17)*(gconst19)*(gconst24)*(gconst34)))+(((gconst26)*(gconst29)*(gconst30)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst24)*(gconst28)*(gconst34)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst23)*(gconst29)*(gconst36)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst26)*(gconst27)*(gconst33)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst26)*(gconst3)*(gconst32)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst18)*(gconst29)*(gconst36)))+(((gconst11)*(gconst24)*(gconst27)*(gconst32)))+(((IKReal(-1.00000000000000))*(gconst22)*(gconst32)*(gconst36)*(gconst4)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst16)*(gconst32)*(gconst34)))+(((gconst14)*(gconst21)*(gconst29)*(gconst30)))+(((gconst15)*(gconst23)*(gconst24)*(gconst32)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst17)*(gconst30)*(gconst35)))+(((gconst17)*(gconst22)*(gconst24)*(gconst31)))+(((gconst16)*(gconst33)*(gconst37)*(gconst8)))+(((gconst16)*(gconst32)*(gconst37)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst17)*(gconst30)*(gconst36)))+(((IKReal(-1.00000000000000))*(gconst22)*(gconst28)*(gconst36)*(gconst8)))+(((gconst17)*(gconst18)*(gconst26)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst20)*(gconst21)*(gconst26)*(gconst27)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst19)*(gconst25)*(gconst33)))+(((gconst22)*(gconst29)*(gconst36)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst26)*(gconst27)*(gconst32)*(gconst9)))+(((gconst12)*(gconst23)*(gconst27)*(gconst32)))+(((IKReal(-1.00000000000000))*(gconst20)*(gconst3)*(gconst33)*(gconst38)))+(((gconst16)*(gconst20)*(gconst21)*(gconst37)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst35)*(gconst36)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst24)*(gconst30)*(gconst35)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst21)*(gconst31)*(gconst37)*(gconst5)))+(((gconst10)*(gconst24)*(gconst29)*(gconst31)))+(((gconst19)*(gconst34)*(gconst36)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst20)*(gconst28)*(gconst36)))+(((IKReal(-1.00000000000000))*(gconst20)*(gconst27)*(gconst38)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst15)*(gconst20)*(gconst21)*(gconst38)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst33)*(gconst37)*(gconst7)))+(((gconst16)*(gconst21)*(gconst25)*(gconst32)))+(((gconst25)*(gconst28)*(gconst33)*(gconst8)))+(((gconst24)*(gconst3)*(gconst32)*(gconst35)))+(((gconst12)*(gconst15)*(gconst32)*(gconst35)))+(((IKReal(-1.00000000000000))*(gconst23)*(gconst30)*(gconst36)*(gconst5)))+(((gconst13)*(gconst20)*(gconst28)*(gconst33)))+(((gconst21)*(gconst28)*(gconst37)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst21)*(gconst25)*(gconst31)))+(((gconst13)*(gconst16)*(gconst32)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst17)*(gconst31)*(gconst33)))+(((gconst10)*(gconst19)*(gconst29)*(gconst36)))+(((gconst20)*(gconst21)*(gconst25)*(gconst28)))+(((gconst22)*(gconst31)*(gconst36)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst16)*(gconst20)*(gconst22)*(gconst36)))+(((gconst21)*(gconst32)*(gconst37)*(gconst4)))+(((gconst12)*(gconst19)*(gconst29)*(gconst34)))+(((gconst11)*(gconst20)*(gconst27)*(gconst36)))+(((gconst18)*(gconst21)*(gconst26)*(gconst29)))+(((gconst12)*(gconst20)*(gconst27)*(gconst35)))+(((gconst13)*(gconst21)*(gconst28)*(gconst32)))+(((gconst17)*(gconst30)*(gconst38)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst15)*(gconst21)*(gconst26)*(gconst32)))+(((gconst14)*(gconst17)*(gconst30)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst31)*(gconst37)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst15)*(gconst32)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst20)*(gconst27)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst22)*(gconst28)*(gconst32)))+(((IKReal(-1.00000000000000))*(gconst21)*(gconst3)*(gconst32)*(gconst38)))+(((gconst23)*(gconst3)*(gconst32)*(gconst36)))+(((gconst21)*(gconst30)*(gconst38)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst25)*(gconst31)*(gconst33)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst18)*(gconst23)*(gconst36)))+(((gconst18)*(gconst33)*(gconst38)*(gconst5)))+(((gconst25)*(gconst32)*(gconst33)*(gconst4)))+(((IKReal(-1.00000000000000))*(gconst19)*(gconst21)*(gconst25)*(gconst29)))+(((gconst15)*(gconst35)*(gconst36)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst20)*(gconst28)*(gconst34)))+(((gconst17)*(gconst34)*(gconst36)*(gconst7)))+(((gconst18)*(gconst29)*(gconst38)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst15)*(gconst20)*(gconst26)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst20)*(gconst22)*(gconst24)*(gconst28)))+(((IKReal(-1.00000000000000))*(gconst15)*(gconst32)*(gconst38)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst24)*(gconst28)*(gconst32)))+(((IKReal(-1.00000000000000))*(gconst21)*(gconst27)*(gconst38)*(gconst8)))+(((gconst26)*(gconst30)*(gconst33)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst19)*(gconst29)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst19)*(gconst21)*(gconst37)))+(((gconst25)*(gconst28)*(gconst32)*(gconst9))));
op[4]=((((IKReal(-1.00000000000000))*(gconst12)*(gconst17)*(gconst23)*(gconst30)))+(((gconst29)*(gconst38)*(gconst6)*(gconst9)))+(((gconst15)*(gconst24)*(gconst35)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst21)*(gconst25)*(gconst29)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst18)*(gconst23)*(gconst24)))+(((gconst33)*(gconst38)*(gconst5)*(gconst6)))+(((gconst13)*(gconst16)*(gconst20)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst28)*(gconst36)*(gconst8)))+(((gconst12)*(gconst29)*(gconst34)*(gconst7)))+(((gconst12)*(gconst15)*(gconst23)*(gconst32)))+(((gconst11)*(gconst15)*(gconst24)*(gconst32)))+(((gconst19)*(gconst22)*(gconst36)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst29)*(gconst35)*(gconst6)))+(((gconst11)*(gconst15)*(gconst20)*(gconst36)))+(((IKReal(-1.00000000000000))*(gconst15)*(gconst26)*(gconst33)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst29)*(gconst31)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst30)*(gconst36)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst33)*(gconst37)*(gconst5)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst19)*(gconst21)*(gconst29)))+(((gconst10)*(gconst12)*(gconst29)*(gconst31)))+(((gconst12)*(gconst31)*(gconst34)*(gconst5)))+(((gconst22)*(gconst24)*(gconst31)*(gconst5)))+(((gconst17)*(gconst22)*(gconst36)*(gconst7)))+(((gconst17)*(gconst19)*(gconst22)*(gconst24)))+(((gconst10)*(gconst31)*(gconst36)*(gconst5)))+(((gconst23)*(gconst24)*(gconst3)*(gconst32)))+(((gconst12)*(gconst20)*(gconst23)*(gconst27)))+(((IKReal(-1.00000000000000))*(gconst15)*(gconst21)*(gconst38)*(gconst8)))+(((gconst17)*(gconst18)*(gconst21)*(gconst26)))+(((IKReal(-1.00000000000000))*(gconst16)*(gconst22)*(gconst36)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst21)*(gconst26)*(gconst3)*(gconst32)))+(((gconst16)*(gconst21)*(gconst37)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst17)*(gconst24)*(gconst30)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst29)*(gconst36)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst23)*(gconst24)*(gconst30)*(gconst5)))+(((gconst14)*(gconst29)*(gconst33)*(gconst6)))+(((gconst10)*(gconst29)*(gconst36)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst20)*(gconst24)*(gconst34)*(gconst4)))+(((IKReal(-1.00000000000000))*(gconst21)*(gconst26)*(gconst27)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst27)*(gconst38)*(gconst8)*(gconst9)))+(((gconst11)*(gconst12)*(gconst27)*(gconst32)))+(((gconst13)*(gconst32)*(gconst33)*(gconst4)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst16)*(gconst24)*(gconst32)))+(((gconst11)*(gconst20)*(gconst24)*(gconst27)))+(((gconst16)*(gconst25)*(gconst32)*(gconst9)))+(((gconst20)*(gconst23)*(gconst3)*(gconst36)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst20)*(gconst22)*(gconst28)))+(((gconst21)*(gconst25)*(gconst32)*(gconst4)))+(((IKReal(-1.00000000000000))*(gconst19)*(gconst25)*(gconst33)*(gconst5)))+(((gconst12)*(gconst15)*(gconst20)*(gconst35)))+(((IKReal(-1.00000000000000))*(gconst3)*(gconst33)*(gconst38)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst15)*(gconst20)*(gconst21)*(gconst26)))+(((gconst12)*(gconst27)*(gconst35)*(gconst8)))+(((gconst28)*(gconst37)*(gconst8)*(gconst9)))+(((gconst19)*(gconst24)*(gconst34)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst31)*(gconst33)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst21)*(gconst37)*(gconst7)))+(((gconst18)*(gconst26)*(gconst33)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst24)*(gconst35)*(gconst6)))+(((gconst10)*(gconst17)*(gconst19)*(gconst36)))+(((gconst15)*(gconst20)*(gconst23)*(gconst24)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst30)*(gconst35)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst18)*(gconst23)*(gconst29)))+(((gconst12)*(gconst19)*(gconst22)*(gconst29)))+(((gconst21)*(gconst26)*(gconst29)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst20)*(gconst26)*(gconst27)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst23)*(gconst24)*(gconst29)*(gconst6)))+(((gconst17)*(gconst21)*(gconst38)*(gconst6)))+(((gconst12)*(gconst17)*(gconst22)*(gconst31)))+(((IKReal(-1.00000000000000))*(gconst20)*(gconst22)*(gconst36)*(gconst4)))+(((gconst11)*(gconst27)*(gconst36)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst12)*(gconst29)*(gconst30)))+(((gconst20)*(gconst25)*(gconst33)*(gconst4)))+(((gconst17)*(gconst18)*(gconst38)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst31)*(gconst37)*(gconst5)*(gconst9)))+(((gconst21)*(gconst26)*(gconst30)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst19)*(gconst25)*(gconst29)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst17)*(gconst21)*(gconst31)))+(((gconst17)*(gconst24)*(gconst34)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst16)*(gconst20)*(gconst34)))+(((gconst13)*(gconst16)*(gconst21)*(gconst32)))+(((IKReal(-1.00000000000000))*(gconst21)*(gconst25)*(gconst31)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst17)*(gconst18)*(gconst35)))+(((gconst14)*(gconst30)*(gconst33)*(gconst5)))+(((gconst30)*(gconst38)*(gconst5)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst16)*(gconst24)*(gconst34)*(gconst8)))+(((gconst22)*(gconst24)*(gconst29)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst20)*(gconst24)*(gconst28)))+(((gconst14)*(gconst17)*(gconst18)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst3)*(gconst32)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst15)*(gconst20)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst16)*(gconst20)*(gconst36)))+(((gconst13)*(gconst28)*(gconst32)*(gconst9)))+(((gconst15)*(gconst23)*(gconst36)*(gconst8)))+(((gconst16)*(gconst20)*(gconst21)*(gconst25)))+(((gconst14)*(gconst18)*(gconst21)*(gconst29)))+(((IKReal(-1.00000000000000))*(gconst19)*(gconst21)*(gconst37)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst29)*(gconst37)*(gconst7)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst34)*(gconst36)*(gconst4)*(gconst8)))+(((gconst12)*(gconst3)*(gconst32)*(gconst35)))+(((gconst14)*(gconst17)*(gconst21)*(gconst30)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst25)*(gconst33)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst35)*(gconst36)*(gconst5)*(gconst6)))+(((gconst10)*(gconst19)*(gconst24)*(gconst29)))+(((gconst3)*(gconst35)*(gconst36)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst32)*(gconst34)*(gconst4)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst12)*(gconst28)*(gconst32)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst16)*(gconst22)*(gconst32)))+(((gconst20)*(gconst21)*(gconst37)*(gconst4)))+(((gconst23)*(gconst24)*(gconst27)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst22)*(gconst24)*(gconst32)*(gconst4)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst25)*(gconst31)*(gconst9)))+(((gconst10)*(gconst17)*(gconst24)*(gconst31)))+(((IKReal(-1.00000000000000))*(gconst20)*(gconst26)*(gconst3)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst20)*(gconst21)*(gconst3)*(gconst38)))+(((gconst13)*(gconst20)*(gconst21)*(gconst28)))+(((gconst14)*(gconst29)*(gconst30)*(gconst9)))+(((gconst32)*(gconst37)*(gconst4)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst29)*(gconst33)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst27)*(gconst32)*(gconst9)))+(((gconst16)*(gconst25)*(gconst33)*(gconst8)))+(((gconst34)*(gconst36)*(gconst5)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst15)*(gconst21)*(gconst32)))+(((gconst18)*(gconst21)*(gconst38)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst22)*(gconst24)*(gconst28)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst17)*(gconst19)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst18)*(gconst24)*(gconst35)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst17)*(gconst18)*(gconst36)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst20)*(gconst21)*(gconst27)))+(((IKReal(-1.00000000000000))*(gconst18)*(gconst23)*(gconst36)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst15)*(gconst26)*(gconst32)*(gconst9)))+(((gconst20)*(gconst25)*(gconst28)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst19)*(gconst21)*(gconst25)))+(((gconst12)*(gconst17)*(gconst19)*(gconst34)))+(((IKReal(-1.00000000000000))*(gconst16)*(gconst20)*(gconst22)*(gconst24)))+(((IKReal(-1.00000000000000))*(gconst15)*(gconst20)*(gconst38)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst28)*(gconst34)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst32)*(gconst36)*(gconst4)))+(((gconst20)*(gconst24)*(gconst3)*(gconst35)))+(((gconst33)*(gconst37)*(gconst4)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst23)*(gconst36)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst19)*(gconst37)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst18)*(gconst24)*(gconst29)))+(((gconst17)*(gconst26)*(gconst33)*(gconst6)))+(((gconst18)*(gconst26)*(gconst29)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst27)*(gconst33)*(gconst8)))+(((gconst11)*(gconst3)*(gconst32)*(gconst36)))+(((gconst21)*(gconst25)*(gconst28)*(gconst8)))+(((gconst17)*(gconst26)*(gconst30)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst3)*(gconst32)*(gconst38)*(gconst9)))+(((gconst16)*(gconst20)*(gconst37)*(gconst9)))+(((gconst13)*(gconst28)*(gconst33)*(gconst8))));
op[5]=((((IKReal(-1.00000000000000))*(gconst25)*(gconst29)*(gconst7)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst24)*(gconst32)*(gconst4)))+(((IKReal(-1.00000000000000))*(gconst25)*(gconst31)*(gconst5)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst21)*(gconst25)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst19)*(gconst29)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst19)*(gconst33)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst15)*(gconst33)*(gconst8)))+(((gconst24)*(gconst34)*(gconst5)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst25)*(gconst33)*(gconst5)*(gconst7)))+(((gconst14)*(gconst17)*(gconst30)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst21)*(gconst27)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst19)*(gconst21)*(gconst25)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst17)*(gconst36)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst21)*(gconst3)*(gconst32)))+(((IKReal(-1.00000000000000))*(gconst26)*(gconst3)*(gconst33)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst23)*(gconst24)*(gconst6)))+(((gconst11)*(gconst15)*(gconst36)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst37)*(gconst7)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst23)*(gconst30)*(gconst5)))+(((gconst13)*(gconst21)*(gconst32)*(gconst4)))+(((gconst10)*(gconst12)*(gconst19)*(gconst29)))+(((gconst12)*(gconst23)*(gconst27)*(gconst8)))+(((gconst12)*(gconst15)*(gconst20)*(gconst23)))+(((IKReal(-1.00000000000000))*(gconst20)*(gconst22)*(gconst24)*(gconst4)))+(((gconst16)*(gconst37)*(gconst8)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst22)*(gconst32)*(gconst4)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst18)*(gconst35)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst24)*(gconst29)*(gconst6)))+(((gconst17)*(gconst38)*(gconst6)*(gconst9)))+(((gconst15)*(gconst23)*(gconst24)*(gconst8)))+(((gconst14)*(gconst21)*(gconst29)*(gconst6)))+(((gconst12)*(gconst22)*(gconst31)*(gconst5)))+(((gconst12)*(gconst15)*(gconst35)*(gconst8)))+(((gconst21)*(gconst37)*(gconst4)*(gconst8)))+(((gconst23)*(gconst3)*(gconst36)*(gconst8)))+(((gconst26)*(gconst29)*(gconst6)*(gconst9)))+(((gconst25)*(gconst32)*(gconst4)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst19)*(gconst25)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst12)*(gconst16)*(gconst32)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst17)*(gconst31)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst17)*(gconst35)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst20)*(gconst34)*(gconst4)))+(((gconst18)*(gconst21)*(gconst26)*(gconst5)))+(((gconst11)*(gconst24)*(gconst27)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst15)*(gconst20)*(gconst26)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst17)*(gconst18)*(gconst23)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst18)*(gconst36)*(gconst5)))+(((gconst25)*(gconst28)*(gconst8)*(gconst9)))+(((gconst10)*(gconst24)*(gconst29)*(gconst7)))+(((gconst22)*(gconst36)*(gconst5)*(gconst7)))+(((gconst16)*(gconst21)*(gconst25)*(gconst8)))+(((gconst10)*(gconst12)*(gconst17)*(gconst31)))+(((gconst10)*(gconst19)*(gconst36)*(gconst5)))+(((gconst12)*(gconst17)*(gconst34)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst17)*(gconst33)*(gconst7)))+(((gconst11)*(gconst24)*(gconst3)*(gconst32)))+(((IKReal(-1.00000000000000))*(gconst23)*(gconst36)*(gconst5)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst15)*(gconst32)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst23)*(gconst29)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst20)*(gconst21)*(gconst26)*(gconst3)))+(((IKReal(-1.00000000000000))*(gconst21)*(gconst3)*(gconst38)*(gconst8)))+(((gconst10)*(gconst17)*(gconst19)*(gconst24)))+(((IKReal(-1.00000000000000))*(gconst20)*(gconst3)*(gconst38)*(gconst9)))+(((gconst11)*(gconst20)*(gconst3)*(gconst36)))+(((gconst10)*(gconst17)*(gconst36)*(gconst7)))+(((gconst20)*(gconst23)*(gconst24)*(gconst3)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst20)*(gconst3)*(gconst33)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst12)*(gconst20)*(gconst28)))+(((gconst13)*(gconst21)*(gconst28)*(gconst8)))+(((gconst12)*(gconst22)*(gconst29)*(gconst7)))+(((gconst17)*(gconst21)*(gconst26)*(gconst6)))+(((gconst26)*(gconst33)*(gconst5)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst22)*(gconst28)*(gconst8)))+(((gconst14)*(gconst17)*(gconst18)*(gconst21)))+(((IKReal(-1.00000000000000))*(gconst15)*(gconst21)*(gconst26)*(gconst8)))+(((gconst16)*(gconst20)*(gconst25)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst24)*(gconst28)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst16)*(gconst36)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst17)*(gconst19)*(gconst21)))+(((gconst14)*(gconst17)*(gconst33)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst20)*(gconst27)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst17)*(gconst18)*(gconst24)))+(((gconst21)*(gconst38)*(gconst5)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst16)*(gconst20)*(gconst24)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst16)*(gconst34)*(gconst8)))+(((gconst12)*(gconst20)*(gconst3)*(gconst35)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst16)*(gconst20)*(gconst22)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst15)*(gconst20)*(gconst21)))+(((gconst20)*(gconst37)*(gconst4)*(gconst9)))+(((gconst13)*(gconst16)*(gconst33)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst19)*(gconst37)*(gconst5)*(gconst9)))+(((gconst24)*(gconst3)*(gconst35)*(gconst8)))+(((gconst10)*(gconst24)*(gconst31)*(gconst5)))+(((gconst12)*(gconst19)*(gconst34)*(gconst5)))+(((gconst17)*(gconst18)*(gconst26)*(gconst9)))+(((gconst25)*(gconst33)*(gconst4)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst12)*(gconst17)*(gconst30)))+(((gconst13)*(gconst20)*(gconst33)*(gconst4)))+(((gconst26)*(gconst30)*(gconst5)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst24)*(gconst35)*(gconst5)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst21)*(gconst37)*(gconst5)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst26)*(gconst3)*(gconst32)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst18)*(gconst23)*(gconst24)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst26)*(gconst27)*(gconst8)*(gconst9)))+(((gconst12)*(gconst23)*(gconst3)*(gconst32)))+(((IKReal(-1.00000000000000))*(gconst16)*(gconst22)*(gconst24)*(gconst8)))+(((gconst20)*(gconst21)*(gconst25)*(gconst4)))+(((gconst14)*(gconst21)*(gconst30)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst12)*(gconst18)*(gconst29)))+(((IKReal(-1.00000000000000))*(gconst15)*(gconst38)*(gconst8)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst20)*(gconst36)*(gconst4)))+(((gconst13)*(gconst16)*(gconst32)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst24)*(gconst30)*(gconst5)))+(((gconst19)*(gconst22)*(gconst24)*(gconst5)))+(((gconst11)*(gconst15)*(gconst20)*(gconst24)))+(((IKReal(-1.00000000000000))*(gconst22)*(gconst36)*(gconst4)*(gconst8)))+(((gconst13)*(gconst20)*(gconst28)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst21)*(gconst31)*(gconst5)))+(((gconst11)*(gconst12)*(gconst15)*(gconst32)))+(((gconst13)*(gconst16)*(gconst20)*(gconst21)))+(((IKReal(-1.00000000000000))*(gconst24)*(gconst34)*(gconst4)*(gconst8)))+(((gconst18)*(gconst38)*(gconst5)*(gconst9)))+(((gconst14)*(gconst18)*(gconst33)*(gconst5)))+(((gconst11)*(gconst12)*(gconst20)*(gconst27)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst21)*(gconst29)*(gconst7)))+(((gconst17)*(gconst22)*(gconst24)*(gconst7)))+(((gconst12)*(gconst17)*(gconst19)*(gconst22)))+(((gconst14)*(gconst18)*(gconst29)*(gconst9))));
op[6]=((((gconst13)*(gconst32)*(gconst4)*(gconst9)))+(((gconst14)*(gconst33)*(gconst5)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst17)*(gconst19)*(gconst9)))+(((gconst13)*(gconst16)*(gconst20)*(gconst9)))+(((gconst13)*(gconst33)*(gconst4)*(gconst8)))+(((gconst16)*(gconst25)*(gconst8)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst12)*(gconst16)*(gconst20)))+(((gconst14)*(gconst29)*(gconst6)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst19)*(gconst25)*(gconst5)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst31)*(gconst5)*(gconst9)))+(((gconst37)*(gconst4)*(gconst8)*(gconst9)))+(((gconst38)*(gconst5)*(gconst6)*(gconst9)))+(((gconst10)*(gconst36)*(gconst5)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst18)*(gconst24)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst15)*(gconst21)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst18)*(gconst23)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst15)*(gconst26)*(gconst8)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst17)*(gconst25)*(gconst7)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst36)*(gconst5)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst23)*(gconst24)*(gconst5)*(gconst6)))+(((gconst11)*(gconst3)*(gconst36)*(gconst8)))+(((gconst13)*(gconst20)*(gconst21)*(gconst4)))+(((gconst20)*(gconst25)*(gconst4)*(gconst9)))+(((gconst12)*(gconst15)*(gconst23)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst20)*(gconst26)*(gconst3)*(gconst9)))+(((gconst12)*(gconst34)*(gconst5)*(gconst7)))+(((gconst11)*(gconst12)*(gconst27)*(gconst8)))+(((gconst17)*(gconst26)*(gconst6)*(gconst9)))+(((gconst11)*(gconst12)*(gconst3)*(gconst32)))+(((IKReal(-1.00000000000000))*(gconst21)*(gconst26)*(gconst3)*(gconst8)))+(((gconst12)*(gconst3)*(gconst35)*(gconst8)))+(((gconst10)*(gconst17)*(gconst24)*(gconst7)))+(((gconst18)*(gconst26)*(gconst5)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst16)*(gconst22)*(gconst8)))+(((gconst23)*(gconst24)*(gconst3)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst33)*(gconst5)*(gconst7)))+(((gconst13)*(gconst16)*(gconst21)*(gconst8)))+(((gconst12)*(gconst20)*(gconst23)*(gconst3)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst12)*(gconst30)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst22)*(gconst24)*(gconst4)*(gconst8)))+(((gconst10)*(gconst12)*(gconst17)*(gconst19)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst27)*(gconst8)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst34)*(gconst4)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst19)*(gconst21)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst3)*(gconst33)*(gconst8)))+(((gconst11)*(gconst12)*(gconst15)*(gconst20)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst20)*(gconst22)*(gconst4)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst12)*(gconst32)*(gconst4)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst16)*(gconst24)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst21)*(gconst25)*(gconst5)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst12)*(gconst28)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst17)*(gconst21)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst3)*(gconst38)*(gconst8)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst17)*(gconst23)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst13)*(gconst29)*(gconst7)*(gconst9)))+(((gconst12)*(gconst17)*(gconst22)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst12)*(gconst29)*(gconst6)))+(((gconst12)*(gconst19)*(gconst22)*(gconst5)))+(((gconst10)*(gconst12)*(gconst29)*(gconst7)))+(((gconst14)*(gconst18)*(gconst21)*(gconst5)))+(((gconst22)*(gconst24)*(gconst5)*(gconst7)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst17)*(gconst24)*(gconst6)))+(((gconst21)*(gconst25)*(gconst4)*(gconst8)))+(((gconst21)*(gconst26)*(gconst5)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst20)*(gconst21)*(gconst3)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst35)*(gconst5)*(gconst6)))+(((gconst14)*(gconst30)*(gconst5)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst15)*(gconst20)*(gconst9)))+(((gconst14)*(gconst17)*(gconst21)*(gconst6)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst36)*(gconst4)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst37)*(gconst5)*(gconst7)*(gconst9)))+(((gconst10)*(gconst19)*(gconst24)*(gconst5)))+(((IKReal(-1.00000000000000))*(gconst14)*(gconst3)*(gconst32)*(gconst9)))+(((IKReal(-1.00000000000000))*(gconst11)*(gconst12)*(gconst17)*(gconst18)))+(((gconst13)*(gconst28)*(gconst8)*(gconst9)))+(((gconst14)*(gconst17)*(gconst18)*(gconst9)))+(((gconst11)*(gconst15)*(gconst24)*(gconst8)))+(((IKReal(-1.00000000000000))*(gconst10)*(gconst20)*(gconst24)*(gconst4)))+(((gconst10)*(gconst12)*(gconst31)*(gconst5)))+(((gconst11)*(gconst20)*(gconst24)*(gconst3))));
op[7]=((((IKReal(-1.00000000000000))*(gconst4)*(x47)*(x61)))+(((IKReal(-1.00000000000000))*(x48)*(x52)))+(((IKReal(-1.00000000000000))*(x52)*(x71)))+(((x41)*(x42)))+(((gconst23)*(gconst8)*(x51)))+(((IKReal(-1.00000000000000))*(x45)*(x73)))+(((IKReal(-1.00000000000000))*(gconst15)*(x43)*(x44)))+(((IKReal(-1.00000000000000))*(gconst4)*(x43)*(x69)))+(((IKReal(-1.00000000000000))*(x42)*(x67)))+(((x47)*(x48)))+(((IKReal(-1.00000000000000))*(gconst4)*(x43)*(x55)))+(((gconst12)*(gconst15)*(x70)))+(((x47)*(x71)))+(((IKReal(-1.00000000000000))*(gconst16)*(x43)*(x47)))+(((IKReal(-1.00000000000000))*(x50)*(x66)))+(((IKReal(-1.00000000000000))*(gconst3)*(x41)*(x43)))+(((x42)*(x54)))+(((x50)*(x55)))+(((IKReal(-1.00000000000000))*(x50)*(x57)))+(((IKReal(-1.00000000000000))*(x49)*(x73)))+(((x50)*(x69)))+(((x56)*(x66)))+(((gconst16)*(gconst8)*(x52)))+(((x56)*(x57)))+(((gconst3)*(gconst8)*(x67)))+(((x44)*(x49)))+(((x44)*(x45)))+(((IKReal(-1.00000000000000))*(gconst3)*(x44)*(x61)))+(((IKReal(-1.00000000000000))*(gconst12)*(gconst23)*(x42)))+(((IKReal(-1.00000000000000))*(gconst3)*(x43)*(x54)))+(((gconst20)*(gconst4)*(x52)))+(((gconst11)*(gconst20)*(x51))));
op[8]=((((IKReal(-1.00000000000000))*(x42)*(x73)))+(((IKReal(-1.00000000000000))*(x50)*(x52)))+(((x42)*(x44)))+(((x51)*(x70)))+(((IKReal(-1.00000000000000))*(gconst3)*(x43)*(x44)))+(((IKReal(-1.00000000000000))*(gconst4)*(x43)*(x47)))+(((x52)*(x56)))+(((x47)*(x50))));
polyroots8(op,zeror,numroots);
IKReal j0array[8], cj0array[8], sj0array[8], tempj0array[1];
int numsolutions = 0;
for(int ij0 = 0; ij0 < numroots; ++ij0)
{
IKReal htj0 = zeror[ij0];
tempj0array[0]=((IKReal(2.00000000000000))*(atan(htj0)));
for(int kj0 = 0; kj0 < 1; ++kj0)
{
j0array[numsolutions] = tempj0array[kj0];
if( j0array[numsolutions] > IKPI )
{
    j0array[numsolutions]-=IK2PI;
}
else if( j0array[numsolutions] < -IKPI )
{
    j0array[numsolutions]+=IK2PI;
}
sj0array[numsolutions] = IKsin(j0array[numsolutions]);
cj0array[numsolutions] = IKcos(j0array[numsolutions]);
numsolutions++;
}
}
bool j0valid[8]={true,true,true,true,true,true,true,true};
_nj0 = 8;
for(int ij0 = 0; ij0 < numsolutions; ++ij0)
    {
if( !j0valid[ij0] )
{
    continue;
}
    j0 = j0array[ij0]; cj0 = cj0array[ij0]; sj0 = sj0array[ij0];
htj0 = IKtan(j0/2);

_ij0[0] = ij0; _ij0[1] = -1;
for(int iij0 = ij0+1; iij0 < numsolutions; ++iij0)
{
if( j0valid[iij0] && IKabs(cj0array[ij0]-cj0array[iij0]) < IKFAST_SOLUTION_THRESH && IKabs(sj0array[ij0]-sj0array[iij0]) < IKFAST_SOLUTION_THRESH )
{
    j0valid[iij0]=false; _ij0[1] = iij0; break; 
}
}
{
IKReal dummyeval[1];
IKReal gconst55;
gconst55=IKsign(((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))));
dummyeval[0]=((IKReal(1.00000000000000))+(((IKReal(7.77777777777778))*(sj3)))+(((IKReal(-1.00000000000000))*(cj3))));
if( IKabs(dummyeval[0]) < 0.0000010000000000  )
{
{
IKReal evalcond[5];
IKReal x76=((IKReal(1.00000000000000))*(py));
evalcond[0]=((IKReal(-3.14159265358979))+(IKfmod(((IKReal(3.14159265358979))+(j3)), IKReal(6.28318530717959))));
evalcond[1]=((IKReal(0.810000000000000))+(((IKReal(-1.00000000000000))*(pp))));
evalcond[2]=((IKReal(-0.900000000000000))+(pz));
evalcond[3]=((((IKReal(-1.00000000000000))*(cj0)*(x76)))+(((px)*(sj0))));
evalcond[4]=((((IKReal(-1.00000000000000))*(sj0)*(x76)))+(((IKReal(-1.00000000000000))*(cj0)*(px))));
if( IKabs(evalcond[0]) < 0.0000010000000000  && IKabs(evalcond[1]) < 0.0000010000000000  && IKabs(evalcond[2]) < 0.0000010000000000  && IKabs(evalcond[3]) < 0.0000010000000000  && IKabs(evalcond[4]) < 0.0000010000000000  )
{
{
IKReal dummyeval[1];
IKReal gconst56;
IKReal x77=(px)*(px);
IKReal x78=(sj0)*(sj0);
IKReal x79=(cj0)*(cj0);
IKReal x80=(py)*(py);
IKReal x81=((IKReal(0.0900000000000000))*(x78));
IKReal x82=((IKReal(0.0900000000000000))*(x79));
gconst56=IKsign(((((x77)*(x82)))+(((x77)*(x81)))+(((x80)*(x82)))+(((x80)*(x81)))));
IKReal x83=(sj0)*(sj0);
IKReal x84=(py)*(py);
IKReal x85=(cj0)*(cj0);
IKReal x86=(px)*(px);
dummyeval[0]=((((x84)*(x85)))+(((x85)*(x86)))+(((x83)*(x84)))+(((x83)*(x86))));
if( IKabs(dummyeval[0]) < 0.0000010000000000  )
{
continue;

} else
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
IKReal x87=((pp)*(py));
IKReal x88=((IKReal(0.180000000000000))*(cj0));
IKReal x89=((py)*(sj0));
IKReal x90=((IKReal(1.10000000000000))*(pz));
IKReal x91=((px)*(sj0));
IKReal x92=((px)*(x90));
if( IKabs(((gconst56)*(((((IKReal(-1.00000000000000))*(pp)*(x91)))+(((IKReal(-0.180000000000000))*(x91)))+(((py)*(x88)))+(((x90)*(x91)))+(((cj0)*(x87)))+(((IKReal(-1.00000000000000))*(cj0)*(py)*(x90))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((gconst56)*(((((IKReal(-1.00000000000000))*(cj0)*(x92)))+(((IKReal(0.180000000000000))*(x89)))+(((sj0)*(x87)))+(((px)*(x88)))+(((cj0)*(pp)*(px)))+(((IKReal(-1.00000000000000))*(x89)*(x90))))))) < IKFAST_ATAN2_MAGTHRESH )
    continue;
j2array[0]=IKatan2(((gconst56)*(((((IKReal(-1.00000000000000))*(pp)*(x91)))+(((IKReal(-0.180000000000000))*(x91)))+(((py)*(x88)))+(((x90)*(x91)))+(((cj0)*(x87)))+(((IKReal(-1.00000000000000))*(cj0)*(py)*(x90)))))), ((gconst56)*(((((IKReal(-1.00000000000000))*(cj0)*(x92)))+(((IKReal(0.180000000000000))*(x89)))+(((sj0)*(x87)))+(((px)*(x88)))+(((cj0)*(pp)*(px)))+(((IKReal(-1.00000000000000))*(x89)*(x90)))))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[3];
IKReal x93=IKsin(j2);
IKReal x94=IKcos(j2);
IKReal x95=((IKReal(1.00000000000000))*(py));
IKReal x96=((IKReal(0.0900000000000000))*(py));
IKReal x97=((sj0)*(x94));
IKReal x98=((sj0)*(x93));
IKReal x99=((cj0)*(x93));
IKReal x100=((cj0)*(px)*(x94));
evalcond[0]=((((IKReal(-1.00000000000000))*(cj0)*(x94)*(x95)))+(((py)*(x98)))+(((px)*(x97)))+(((px)*(x99))));
evalcond[1]=((((IKReal(-1.00000000000000))*(x95)*(x97)))+(((IKReal(-1.00000000000000))*(x95)*(x99)))+(((px)*(x98)))+(((IKReal(-1.00000000000000))*(x100))));
evalcond[2]=((IKReal(-0.180000000000000))+(((x96)*(x97)))+(((x96)*(x99)))+(((IKReal(-0.0900000000000000))*(px)*(x98)))+(((IKReal(0.0900000000000000))*(x100)))+(((IKReal(-1.00000000000000))*(pp)))+(((IKReal(1.10000000000000))*(pz))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

}

}

} else
{
IKReal x101=((IKReal(1.00000000000000))*(py));
evalcond[0]=((IKReal(-3.14159265358979))+(IKfmod(((IKReal(3.14159265358979))+(j3)), IKReal(6.28318530717959))));
evalcond[1]=((IKReal(0.810000000000000))+(((IKReal(-1.00000000000000))*(pp))));
evalcond[2]=((IKReal(-0.900000000000000))+(pz));
evalcond[3]=((((IKReal(-1.00000000000000))*(cj0)*(x101)))+(((px)*(sj0))));
evalcond[4]=((((IKReal(-1.00000000000000))*(sj0)*(x101)))+(((IKReal(-1.00000000000000))*(cj0)*(px))));
if( IKabs(evalcond[0]) < 0.0000010000000000  && IKabs(evalcond[1]) < 0.0000010000000000  && IKabs(evalcond[2]) < 0.0000010000000000  && IKabs(evalcond[3]) < 0.0000010000000000  && IKabs(evalcond[4]) < 0.0000010000000000  )
{
{
IKReal dummyeval[1];
IKReal gconst57;
IKReal x102=(px)*(px);
IKReal x103=(sj0)*(sj0);
IKReal x104=(cj0)*(cj0);
IKReal x105=(py)*(py);
IKReal x106=((IKReal(0.0900000000000000))*(x103));
IKReal x107=((IKReal(0.0900000000000000))*(x104));
gconst57=IKsign(((((x102)*(x107)))+(((x102)*(x106)))+(((x105)*(x106)))+(((x105)*(x107)))));
IKReal x108=(sj0)*(sj0);
IKReal x109=(py)*(py);
IKReal x110=(cj0)*(cj0);
IKReal x111=(px)*(px);
dummyeval[0]=((((x110)*(x111)))+(((x109)*(x110)))+(((x108)*(x109)))+(((x108)*(x111))));
if( IKabs(dummyeval[0]) < 0.0000010000000000  )
{
continue;

} else
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
IKReal x112=((pp)*(py));
IKReal x113=((IKReal(0.180000000000000))*(cj0));
IKReal x114=((py)*(sj0));
IKReal x115=((IKReal(1.10000000000000))*(pz));
IKReal x116=((px)*(sj0));
IKReal x117=((px)*(x115));
if( IKabs(((gconst57)*(((((py)*(x113)))+(((IKReal(-1.00000000000000))*(cj0)*(py)*(x115)))+(((cj0)*(x112)))+(((IKReal(-0.180000000000000))*(x116)))+(((x115)*(x116)))+(((IKReal(-1.00000000000000))*(pp)*(x116))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((gconst57)*(((((sj0)*(x112)))+(((px)*(x113)))+(((IKReal(0.180000000000000))*(x114)))+(((IKReal(-1.00000000000000))*(x114)*(x115)))+(((cj0)*(pp)*(px)))+(((IKReal(-1.00000000000000))*(cj0)*(x117))))))) < IKFAST_ATAN2_MAGTHRESH )
    continue;
j2array[0]=IKatan2(((gconst57)*(((((py)*(x113)))+(((IKReal(-1.00000000000000))*(cj0)*(py)*(x115)))+(((cj0)*(x112)))+(((IKReal(-0.180000000000000))*(x116)))+(((x115)*(x116)))+(((IKReal(-1.00000000000000))*(pp)*(x116)))))), ((gconst57)*(((((sj0)*(x112)))+(((px)*(x113)))+(((IKReal(0.180000000000000))*(x114)))+(((IKReal(-1.00000000000000))*(x114)*(x115)))+(((cj0)*(pp)*(px)))+(((IKReal(-1.00000000000000))*(cj0)*(x117)))))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[3];
IKReal x118=IKsin(j2);
IKReal x119=IKcos(j2);
IKReal x120=((IKReal(1.00000000000000))*(py));
IKReal x121=((IKReal(0.0900000000000000))*(py));
IKReal x122=((sj0)*(x119));
IKReal x123=((sj0)*(x118));
IKReal x124=((cj0)*(x118));
IKReal x125=((cj0)*(px)*(x119));
evalcond[0]=((((py)*(x123)))+(((px)*(x122)))+(((px)*(x124)))+(((IKReal(-1.00000000000000))*(cj0)*(x119)*(x120))));
evalcond[1]=((((IKReal(-1.00000000000000))*(x120)*(x124)))+(((IKReal(-1.00000000000000))*(x120)*(x122)))+(((px)*(x123)))+(((IKReal(-1.00000000000000))*(x125))));
evalcond[2]=((IKReal(-0.180000000000000))+(((x121)*(x122)))+(((x121)*(x124)))+(((IKReal(0.0900000000000000))*(x125)))+(((IKReal(-0.0900000000000000))*(px)*(x123)))+(((IKReal(-1.00000000000000))*(pp)))+(((IKReal(1.10000000000000))*(pz))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

}

}

} else
{
evalcond[0]=((IKReal(-3.14159265358979))+(IKfmod(((IKReal(-0.255739837120000))+(j3)), IKReal(6.28318530717959))));
evalcond[1]=((IKReal(0.0400000003605000))+(((IKReal(-1.00000000000000))*(pp))));
evalcond[2]=((IKReal(-0.200000000250000))+(pz));
if( IKabs(evalcond[0]) < 0.0000010000000000  && IKabs(evalcond[1]) < 0.0000010000000000  && IKabs(evalcond[2]) < 0.0000010000000000  )
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
IKReal x126=((IKReal(1052631578.94737))*(py));
IKReal x127=((IKReal(1052631578.94737))*(px));
if( IKabs(((((cj0)*(x126)))+(((IKReal(-1.00000000000000))*(sj0)*(x127))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((cj0)*(x127)))+(((sj0)*(x126))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((cj0)*(x126)))+(((IKReal(-1.00000000000000))*(sj0)*(x127)))))+IKsqr(((((cj0)*(x127)))+(((sj0)*(x126)))))-1) <= IKFAST_SINCOS_THRESH )
    continue;
j2array[0]=IKatan2(((((cj0)*(x126)))+(((IKReal(-1.00000000000000))*(sj0)*(x127)))), ((((cj0)*(x127)))+(((sj0)*(x126)))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[5];
IKReal x128=IKsin(j2);
IKReal x129=IKcos(j2);
IKReal x130=((IKReal(0.0900000000000000))*(py));
IKReal x131=((IKReal(1.00000000000000))*(py));
IKReal x132=((px)*(sj0));
IKReal x133=((sj0)*(x129));
IKReal x134=((cj0)*(x128));
IKReal x135=((cj0)*(px)*(x129));
evalcond[0]=((((IKReal(9.50000000000000e-10))*(x128)))+(x132)+(((IKReal(-1.00000000000000))*(cj0)*(x131))));
evalcond[1]=((((IKReal(9.50000000000000e-10))*(x129)))+(((IKReal(-1.00000000000000))*(sj0)*(x131)))+(((IKReal(-1.00000000000000))*(cj0)*(px))));
evalcond[2]=((((x129)*(x132)))+(((px)*(x134)))+(((IKReal(-1.00000000000000))*(cj0)*(x129)*(x131)))+(((py)*(sj0)*(x128))));
evalcond[3]=((IKReal(9.50000000000000e-10))+(((IKReal(-1.00000000000000))*(x135)))+(((x128)*(x132)))+(((IKReal(-1.00000000000000))*(x131)*(x134)))+(((IKReal(-1.00000000000000))*(x131)*(x133))));
evalcond[4]=((IKReal(-0.180000000000000))+(((IKReal(-0.0900000000000000))*(x128)*(x132)))+(((IKReal(0.0900000000000000))*(x135)))+(((IKReal(-1.00000000000000))*(pp)))+(((x130)*(x134)))+(((x130)*(x133)))+(((IKReal(1.10000000000000))*(pz))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  || IKabs(evalcond[3]) > 0.000001  || IKabs(evalcond[4]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

} else
{
if( 1 )
{
continue;

} else
{
}
}
}
}
}

} else
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
if( IKabs(((gconst55)*(((((IKReal(-1.00000000000000))*(px)*(sj0)))+(((cj0)*(py))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((gconst55)*(((((cj0)*(px)))+(((py)*(sj0))))))) < IKFAST_ATAN2_MAGTHRESH )
    continue;
j2array[0]=IKatan2(((gconst55)*(((((IKReal(-1.00000000000000))*(px)*(sj0)))+(((cj0)*(py)))))), ((gconst55)*(((((cj0)*(px)))+(((py)*(sj0)))))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[5];
IKReal x136=IKsin(j2);
IKReal x137=IKcos(j2);
IKReal x138=((IKReal(0.0450000000000000))*(cj3));
IKReal x139=((px)*(sj0));
IKReal x140=((IKReal(1.00000000000000))*(py));
IKReal x141=((IKReal(0.350000000000000))*(sj3));
IKReal x142=((IKReal(0.0900000000000000))*(py));
IKReal x143=((sj0)*(x137));
IKReal x144=((cj0)*(x136));
IKReal x145=((cj0)*(px)*(x137));
evalcond[0]=((((x136)*(x141)))+(((IKReal(-1.00000000000000))*(cj0)*(x140)))+(((IKReal(0.0450000000000000))*(x136)))+(x139)+(((IKReal(-1.00000000000000))*(x136)*(x138))));
evalcond[1]=((((IKReal(-1.00000000000000))*(sj0)*(x140)))+(((x137)*(x141)))+(((IKReal(-1.00000000000000))*(x137)*(x138)))+(((IKReal(0.0450000000000000))*(x137)))+(((IKReal(-1.00000000000000))*(cj0)*(px))));
evalcond[2]=((((IKReal(-1.00000000000000))*(cj0)*(x137)*(x140)))+(((x137)*(x139)))+(((px)*(x144)))+(((py)*(sj0)*(x136))));
evalcond[3]=((IKReal(0.0450000000000000))+(((IKReal(-1.00000000000000))*(x140)*(x143)))+(((IKReal(-1.00000000000000))*(x140)*(x144)))+(((x136)*(x139)))+(x141)+(((IKReal(-1.00000000000000))*(x138)))+(((IKReal(-1.00000000000000))*(x145))));
evalcond[4]=((IKReal(-0.180000000000000))+(((x142)*(x143)))+(((x142)*(x144)))+(((IKReal(0.0900000000000000))*(x145)))+(((IKReal(-1.00000000000000))*(pp)))+(((IKReal(1.10000000000000))*(pz)))+(((IKReal(-0.0900000000000000))*(x136)*(x139))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  || IKabs(evalcond[3]) > 0.000001  || IKabs(evalcond[4]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

}

}
    }

}

}

} else
{
evalcond[0]=((IKReal(-3.14159265358979))+(IKfmod(((IKReal(1.11022302462516e-16))+(j1)), IKReal(6.28318530717959))));
evalcond[1]=((IKReal(0.429050000000000))+(((IKReal(0.380950000000000))*(cj3)))+(((IKReal(0.0810000000000000))*(sj3)))+(((IKReal(-1.00000000000000))*(pp))));
evalcond[2]=((IKReal(-0.550000000000000))+(((IKReal(-0.0450000000000000))*(sj3)))+(((IKReal(-0.350000000000000))*(cj3)))+(((IKReal(-1.00000000000000))*(pz))));
if( IKabs(evalcond[0]) < 0.0000010000000000  && IKabs(evalcond[1]) < 0.0000010000000000  && IKabs(evalcond[2]) < 0.0000010000000000  )
{
{
IKReal dummyeval[1];
IKReal gconst58;
gconst58=((IKReal(-1.00000000000000))*(py));
IKReal gconst59;
gconst59=((IKReal(-2.00000000000000))*(px));
IKReal gconst60;
gconst60=py;
IKReal gconst61;
gconst61=((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))+(px));
IKReal gconst62;
gconst62=((IKReal(-2.00000000000000))*(py));
IKReal gconst63;
gconst63=((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))+(((IKReal(-1.00000000000000))*(px))));
IKReal gconst64;
gconst64=((IKReal(-1.00000000000000))*(py));
IKReal gconst65;
gconst65=((IKReal(-2.00000000000000))*(px));
IKReal gconst66;
gconst66=py;
IKReal gconst67;
gconst67=((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))+(px));
IKReal gconst68;
gconst68=((IKReal(-2.00000000000000))*(py));
IKReal gconst69;
gconst69=((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))+(((IKReal(-1.00000000000000))*(px))));
IKReal gconst70;
gconst70=((IKReal(2.00000000000000))*(px));
IKReal gconst71;
gconst71=((IKReal(-4.00000000000000))*(py));
IKReal gconst72;
gconst72=((IKReal(-2.00000000000000))*(px));
IKReal gconst73;
gconst73=((IKReal(2.00000000000000))*(py));
IKReal gconst74;
gconst74=((IKReal(4.00000000000000))*(px));
IKReal gconst75;
gconst75=((IKReal(-2.00000000000000))*(py));
IKReal gconst76;
gconst76=((IKReal(2.00000000000000))*(px));
IKReal gconst77;
gconst77=((IKReal(-4.00000000000000))*(py));
IKReal gconst78;
gconst78=((IKReal(-2.00000000000000))*(px));
IKReal gconst79;
gconst79=((IKReal(2.00000000000000))*(py));
IKReal gconst80;
gconst80=((IKReal(4.00000000000000))*(px));
IKReal gconst81;
gconst81=((IKReal(-2.00000000000000))*(py));
IKReal gconst82;
gconst82=py;
IKReal gconst83;
gconst83=((IKReal(2.00000000000000))*(px));
IKReal gconst84;
gconst84=((IKReal(-1.00000000000000))*(py));
IKReal gconst85;
gconst85=((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))+(((IKReal(-1.00000000000000))*(px))));
IKReal gconst86;
gconst86=((IKReal(2.00000000000000))*(py));
IKReal gconst87;
gconst87=((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))+(px));
IKReal gconst88;
gconst88=py;
IKReal gconst89;
gconst89=((IKReal(2.00000000000000))*(px));
IKReal gconst90;
gconst90=((IKReal(-1.00000000000000))*(py));
IKReal gconst91;
gconst91=((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))+(((IKReal(-1.00000000000000))*(px))));
IKReal gconst92;
gconst92=((IKReal(2.00000000000000))*(py));
IKReal gconst93;
gconst93=((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))+(px));
IKReal x146=((gconst83)*(gconst87));
IKReal x147=((gconst89)*(gconst91));
IKReal x148=((gconst88)*(gconst92));
IKReal x149=((gconst84)*(gconst86));
IKReal x150=((gconst88)*(gconst93));
IKReal x151=((gconst84)*(gconst85));
IKReal x152=((gconst82)*(gconst87));
IKReal x153=((gconst90)*(gconst91));
dummyeval[0]=((((x150)*(x151)))+(((IKReal(-1.00000000000000))*(x150)*(x152)))+(((x152)*(x153)))+(((IKReal(-1.00000000000000))*(x151)*(x153)))+(((IKReal(-1.00000000000000))*(x146)*(x147)))+(((x147)*(x149)))+(((x146)*(x148)))+(((IKReal(-1.00000000000000))*(x148)*(x149))));
if( IKabs(dummyeval[0]) < 0.0000001000000000  )
{
continue;

} else
{
IKReal op[8+1], zeror[8];
int numroots;
IKReal x154=((gconst61)*(gconst69));
IKReal x155=((gconst64)*(gconst72));
IKReal x156=((IKReal(1.00000000000000))*(gconst79));
IKReal x157=((gconst84)*(gconst85));
IKReal x158=((gconst65)*(gconst67));
IKReal x159=((gconst59)*(gconst63));
IKReal x160=((gconst64)*(gconst68));
IKReal x161=((IKReal(1.00000000000000))*(gconst88));
IKReal x162=((gconst82)*(gconst93));
IKReal x163=((gconst83)*(gconst87));
IKReal x164=((gconst72)*(gconst86));
IKReal x165=((gconst60)*(gconst76));
IKReal x166=((gconst58)*(gconst75));
IKReal x167=((gconst82)*(gconst87));
IKReal x168=((gconst90)*(gconst91));
IKReal x169=((IKReal(1.00000000000000))*(gconst87));
IKReal x170=((gconst60)*(gconst64));
IKReal x171=((gconst66)*(gconst67));
IKReal x172=((gconst58)*(gconst63));
IKReal x173=((gconst59)*(gconst75));
IKReal x174=((gconst67)*(gconst78));
IKReal x175=((gconst67)*(gconst77));
IKReal x176=((gconst60)*(gconst62));
IKReal x177=((gconst77)*(gconst91));
IKReal x178=((gconst88)*(gconst92));
IKReal x179=((gconst84)*(gconst86));
IKReal x180=((gconst88)*(gconst93));
IKReal x181=((gconst63)*(gconst70));
IKReal x182=((gconst89)*(gconst91));
IKReal x183=((gconst78)*(gconst91));
IKReal x184=((IKReal(1.00000000000000))*(gconst62));
IKReal x185=((gconst70)*(gconst87));
IKReal x186=((gconst60)*(gconst61));
IKReal x187=((IKReal(1.00000000000000))*(gconst60));
IKReal x188=((gconst74)*(gconst84));
IKReal x189=((gconst72)*(gconst85));
IKReal x190=((gconst73)*(gconst84));
IKReal x191=((gconst76)*(gconst92));
IKReal x192=((gconst63)*(gconst71));
IKReal x193=((gconst89)*(x179));
IKReal x194=((IKReal(1.00000000000000))*(gconst64)*(gconst69));
IKReal x195=((IKReal(1.00000000000000))*(gconst83)*(x182));
op[0]=((((x157)*(x180)))+(((IKReal(-1.00000000000000))*(gconst92)*(x161)*(x179)))+(((x179)*(x182)))+(((IKReal(-1.00000000000000))*(x157)*(x168)))+(((x167)*(x168)))+(((IKReal(-1.00000000000000))*(gconst87)*(x161)*(x162)))+(((IKReal(-1.00000000000000))*(x163)*(x182)))+(((x163)*(x178))));
op[1]=((((IKReal(-1.00000000000000))*(gconst80)*(x161)*(x179)))+(((IKReal(-1.00000000000000))*(gconst89)*(x156)*(x163)))+(((gconst79)*(x193)))+(((x180)*(x189)))+(((x168)*(x185)))+(((gconst76)*(gconst93)*(x157)))+(((IKReal(-1.00000000000000))*(gconst71)*(x169)*(x182)))+(((IKReal(-1.00000000000000))*(gconst81)*(x161)*(x167)))+(((gconst75)*(gconst82)*(x168)))+(((x180)*(x190)))+(((gconst79)*(gconst90)*(x167)))+(((IKReal(-1.00000000000000))*(x168)*(x189)))+(((IKReal(-1.00000000000000))*(x168)*(x190)))+(((IKReal(-1.00000000000000))*(gconst92)*(x161)*(x164)))+(((x164)*(x182)))+(((gconst75)*(gconst83)*(x178)))+(((x167)*(x183)))+(((IKReal(-1.00000000000000))*(gconst90)*(x156)*(x157)))+(((IKReal(-1.00000000000000))*(gconst92)*(x161)*(x188)))+(((IKReal(-1.00000000000000))*(gconst75)*(x195)))+(((IKReal(-1.00000000000000))*(x157)*(x183)))+(((IKReal(-1.00000000000000))*(gconst76)*(x162)*(x169)))+(((IKReal(-1.00000000000000))*(gconst93)*(x161)*(x185)))+(((gconst81)*(gconst88)*(x157)))+(((gconst80)*(gconst88)*(x163)))+(((gconst71)*(gconst87)*(x178)))+(((x182)*(x188)))+(((IKReal(-1.00000000000000))*(x179)*(x191)))+(((IKReal(-1.00000000000000))*(x163)*(x177)))+(((x163)*(x191)))+(((IKReal(-1.00000000000000))*(gconst75)*(x161)*(x162)))+(((x177)*(x179))));
op[2]=((((IKReal(-1.00000000000000))*(gconst73)*(gconst78)*(gconst84)*(gconst91)))+(((gconst71)*(gconst80)*(gconst87)*(gconst88)))+(((gconst69)*(gconst84)*(gconst85)*(gconst88)))+(((gconst78)*(gconst79)*(gconst82)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst83)*(gconst89)*(gconst91)))+(((gconst76)*(gconst80)*(gconst83)*(gconst87)))+(((gconst72)*(gconst76)*(gconst85)*(gconst93)))+(((gconst60)*(gconst86)*(gconst89)*(gconst91)))+(((gconst64)*(gconst83)*(gconst87)*(gconst92)))+(((gconst64)*(gconst84)*(gconst85)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst72)*(gconst73)*(gconst90)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst86)*(gconst88)*(gconst92)))+(((gconst68)*(gconst83)*(gconst87)*(gconst88)))+(((gconst71)*(gconst75)*(gconst88)*(gconst92)))+(((gconst70)*(gconst79)*(gconst87)*(gconst90)))+(((IKReal(-1.00000000000000))*(gconst61)*(gconst84)*(gconst90)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst65)*(gconst83)*(gconst87)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst84)*(gconst86)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst69)*(gconst82)*(gconst87)*(gconst88)))+(((gconst72)*(gconst73)*(gconst88)*(gconst93)))+(((gconst73)*(gconst81)*(gconst84)*(gconst88)))+(((gconst75)*(gconst76)*(gconst83)*(gconst92)))+(((gconst74)*(gconst79)*(gconst84)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst72)*(gconst76)*(gconst86)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst75)*(gconst81)*(gconst82)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst73)*(gconst79)*(gconst84)*(gconst90)))+(((gconst70)*(gconst75)*(gconst90)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst66)*(gconst84)*(gconst85)*(gconst91)))+(((gconst77)*(gconst79)*(gconst84)*(gconst86)))+(((IKReal(-1.00000000000000))*(gconst70)*(gconst75)*(gconst88)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst75)*(gconst76)*(gconst82)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst77)*(gconst79)*(gconst83)*(gconst87)))+(((gconst74)*(gconst77)*(gconst84)*(gconst91)))+(((gconst76)*(gconst81)*(gconst84)*(gconst85)))+(((IKReal(-1.00000000000000))*(gconst75)*(gconst77)*(gconst83)*(gconst91)))+(((gconst75)*(gconst80)*(gconst83)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst87)*(gconst89)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst72)*(gconst79)*(gconst85)*(gconst90)))+(((gconst67)*(gconst84)*(gconst86)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst75)*(gconst79)*(gconst83)*(gconst89)))+(((gconst72)*(gconst81)*(gconst85)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst72)*(gconst80)*(gconst86)*(gconst88)))+(((gconst66)*(gconst82)*(gconst87)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst72)*(gconst78)*(gconst85)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst74)*(gconst76)*(gconst84)*(gconst92)))+(((gconst75)*(gconst78)*(gconst82)*(gconst91)))+(((gconst72)*(gconst79)*(gconst86)*(gconst89)))+(((gconst59)*(gconst87)*(gconst88)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst67)*(gconst83)*(gconst87)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst70)*(gconst81)*(gconst87)*(gconst88)))+(((gconst65)*(gconst84)*(gconst86)*(gconst91)))+(((gconst63)*(gconst83)*(gconst88)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst78)*(gconst79)*(gconst84)*(gconst85)))+(((IKReal(-1.00000000000000))*(gconst71)*(gconst75)*(gconst89)*(gconst91)))+(((gconst72)*(gconst77)*(gconst86)*(gconst91)))+(((gconst67)*(gconst82)*(gconst87)*(gconst90)))+(((gconst72)*(gconst74)*(gconst89)*(gconst91)))+(((gconst71)*(gconst76)*(gconst87)*(gconst92)))+(((gconst62)*(gconst84)*(gconst89)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst85)*(gconst90)*(gconst91)))+(((gconst63)*(gconst82)*(gconst90)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst82)*(gconst88)*(gconst93)))+(((gconst58)*(gconst87)*(gconst90)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst62)*(gconst84)*(gconst88)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst74)*(gconst80)*(gconst84)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst87)*(gconst88)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst70)*(gconst76)*(gconst87)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst76)*(gconst80)*(gconst84)*(gconst86)))+(((gconst75)*(gconst79)*(gconst82)*(gconst90)))+(((IKReal(-1.00000000000000))*(gconst76)*(gconst81)*(gconst82)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst71)*(gconst79)*(gconst87)*(gconst89)))+(((gconst73)*(gconst76)*(gconst84)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst68)*(gconst84)*(gconst86)*(gconst88)))+(((gconst61)*(gconst84)*(gconst88)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst82)*(gconst87)*(gconst93)))+(((gconst70)*(gconst78)*(gconst87)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst71)*(gconst77)*(gconst87)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst67)*(gconst84)*(gconst85)*(gconst90)))+(((IKReal(-1.00000000000000))*(gconst72)*(gconst74)*(gconst88)*(gconst92)))+(((gconst60)*(gconst85)*(gconst88)*(gconst93))));
op[3]=((((gconst65)*(gconst79)*(gconst84)*(gconst86)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst79)*(gconst85)*(gconst90)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst78)*(gconst85)*(gconst91)))+(((gconst67)*(gconst75)*(gconst82)*(gconst90)))+(((gconst67)*(gconst70)*(gconst87)*(gconst90)))+(((gconst70)*(gconst78)*(gconst79)*(gconst87)))+(((gconst67)*(gconst74)*(gconst84)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst67)*(gconst77)*(gconst83)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst70)*(gconst87)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst81)*(gconst82)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst61)*(gconst78)*(gconst84)*(gconst91)))+(((gconst68)*(gconst71)*(gconst87)*(gconst88)))+(((gconst58)*(gconst79)*(gconst87)*(gconst90)))+(((IKReal(-1.00000000000000))*(gconst69)*(gconst76)*(gconst82)*(gconst87)))+(((gconst72)*(gconst77)*(gconst79)*(gconst86)))+(((IKReal(-1.00000000000000))*(gconst73)*(gconst78)*(gconst79)*(gconst84)))+(((gconst69)*(gconst76)*(gconst84)*(gconst85)))+(((gconst71)*(gconst75)*(gconst76)*(gconst92)))+(((gconst63)*(gconst70)*(gconst90)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst74)*(gconst84)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst69)*(gconst75)*(gconst82)*(gconst88)))+(((gconst60)*(gconst73)*(gconst88)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst62)*(gconst72)*(gconst88)*(gconst92)))+(((gconst67)*(gconst77)*(gconst84)*(gconst86)))+(((IKReal(-1.00000000000000))*(gconst65)*(gconst79)*(gconst83)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst61)*(gconst79)*(gconst84)*(gconst90)))+(((IKReal(-1.00000000000000))*(gconst61)*(gconst72)*(gconst90)*(gconst91)))+(((gconst61)*(gconst81)*(gconst84)*(gconst88)))+(((gconst65)*(gconst74)*(gconst84)*(gconst91)))+(((gconst61)*(gconst72)*(gconst88)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst79)*(gconst87)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst75)*(gconst77)*(gconst79)*(gconst83)))+(((gconst72)*(gconst73)*(gconst81)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst68)*(gconst76)*(gconst84)*(gconst86)))+(((IKReal(-1.00000000000000))*(gconst70)*(gconst75)*(gconst76)*(gconst93)))+(((gconst62)*(gconst77)*(gconst84)*(gconst91)))+(((gconst72)*(gconst74)*(gconst79)*(gconst89)))+(((gconst60)*(gconst77)*(gconst86)*(gconst91)))+(((gconst64)*(gconst75)*(gconst83)*(gconst92)))+(((gconst72)*(gconst73)*(gconst76)*(gconst93)))+(((gconst64)*(gconst72)*(gconst85)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst68)*(gconst74)*(gconst84)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst67)*(gconst78)*(gconst84)*(gconst85)))+(((IKReal(-1.00000000000000))*(gconst62)*(gconst80)*(gconst84)*(gconst88)))+(((gconst71)*(gconst76)*(gconst80)*(gconst87)))+(((gconst67)*(gconst78)*(gconst82)*(gconst87)))+(((gconst66)*(gconst75)*(gconst82)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst68)*(gconst72)*(gconst86)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst75)*(gconst88)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst71)*(gconst77)*(gconst79)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst80)*(gconst84)*(gconst86)))+(((IKReal(-1.00000000000000))*(gconst66)*(gconst79)*(gconst84)*(gconst85)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst81)*(gconst82)*(gconst87)))+(((gconst71)*(gconst75)*(gconst80)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst75)*(gconst82)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst65)*(gconst71)*(gconst87)*(gconst91)))+(((gconst63)*(gconst79)*(gconst82)*(gconst90)))+(((gconst60)*(gconst74)*(gconst89)*(gconst91)))+(((gconst67)*(gconst72)*(gconst86)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst70)*(gconst88)*(gconst93)))+(((gconst59)*(gconst75)*(gconst88)*(gconst92)))+(((gconst62)*(gconst79)*(gconst84)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst72)*(gconst74)*(gconst76)*(gconst92)))+(((gconst75)*(gconst78)*(gconst79)*(gconst82)))+(((IKReal(-1.00000000000000))*(gconst67)*(gconst75)*(gconst83)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst72)*(gconst73)*(gconst79)*(gconst90)))+(((gconst64)*(gconst80)*(gconst83)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst73)*(gconst90)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst71)*(gconst89)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst69)*(gconst70)*(gconst87)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst77)*(gconst87)*(gconst91)))+(((gconst59)*(gconst76)*(gconst87)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst72)*(gconst74)*(gconst80)*(gconst88)))+(((gconst60)*(gconst81)*(gconst85)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst71)*(gconst75)*(gconst77)*(gconst91)))+(((gconst62)*(gconst72)*(gconst89)*(gconst91)))+(((gconst69)*(gconst73)*(gconst84)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst71)*(gconst75)*(gconst79)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst75)*(gconst89)*(gconst91)))+(((gconst65)*(gconst72)*(gconst86)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst76)*(gconst82)*(gconst93)))+(((gconst64)*(gconst71)*(gconst87)*(gconst92)))+(((gconst70)*(gconst75)*(gconst78)*(gconst91)))+(((gconst58)*(gconst75)*(gconst90)*(gconst91)))+(((gconst64)*(gconst73)*(gconst84)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst66)*(gconst72)*(gconst85)*(gconst91)))+(((gconst63)*(gconst80)*(gconst83)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst77)*(gconst83)*(gconst91)))+(((gconst75)*(gconst76)*(gconst80)*(gconst83)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst76)*(gconst86)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst72)*(gconst73)*(gconst78)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst72)*(gconst86)*(gconst92)))+(((gconst66)*(gconst79)*(gconst82)*(gconst87)))+(((gconst63)*(gconst78)*(gconst82)*(gconst91)))+(((gconst66)*(gconst70)*(gconst87)*(gconst91)))+(((gconst63)*(gconst71)*(gconst88)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst72)*(gconst76)*(gconst80)*(gconst86)))+(((gconst59)*(gconst80)*(gconst87)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst79)*(gconst83)*(gconst89)))+(((gconst69)*(gconst72)*(gconst85)*(gconst88)))+(((gconst68)*(gconst75)*(gconst83)*(gconst88)))+(((gconst60)*(gconst79)*(gconst86)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst67)*(gconst73)*(gconst84)*(gconst90)))+(((gconst70)*(gconst75)*(gconst79)*(gconst90)))+(((gconst68)*(gconst76)*(gconst83)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst80)*(gconst86)*(gconst88)))+(((gconst72)*(gconst74)*(gconst77)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst72)*(gconst78)*(gconst79)*(gconst85)))+(((gconst74)*(gconst77)*(gconst79)*(gconst84)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst76)*(gconst87)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst67)*(gconst71)*(gconst87)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst75)*(gconst76)*(gconst81)*(gconst82)))+(((gconst63)*(gconst76)*(gconst83)*(gconst92)))+(((gconst73)*(gconst76)*(gconst81)*(gconst84)))+(((gconst64)*(gconst81)*(gconst84)*(gconst85)))+(((IKReal(-1.00000000000000))*(gconst65)*(gconst75)*(gconst83)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst66)*(gconst73)*(gconst84)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst62)*(gconst76)*(gconst84)*(gconst92)))+(((gconst72)*(gconst76)*(gconst81)*(gconst85)))+(((gconst61)*(gconst76)*(gconst84)*(gconst93)))+(((gconst60)*(gconst76)*(gconst85)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst70)*(gconst75)*(gconst81)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst74)*(gconst88)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst74)*(gconst76)*(gconst80)*(gconst84)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst81)*(gconst87)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst67)*(gconst72)*(gconst85)*(gconst90)))+(((IKReal(-1.00000000000000))*(gconst70)*(gconst76)*(gconst81)*(gconst87)))+(((gconst58)*(gconst78)*(gconst87)*(gconst91))));
op[4]=((((IKReal(-1.00000000000000))*(gconst72)*(gconst73)*(gconst78)*(gconst79)))+(((gconst60)*(gconst74)*(gconst79)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst76)*(gconst81)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst70)*(gconst75)*(gconst76)*(gconst81)))+(((gconst58)*(gconst78)*(gconst79)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst72)*(gconst74)*(gconst76)*(gconst80)))+(((IKReal(-1.00000000000000))*(gconst65)*(gconst75)*(gconst79)*(gconst83)))+(((IKReal(-1.00000000000000))*(gconst65)*(gconst71)*(gconst79)*(gconst87)))+(((gconst60)*(gconst65)*(gconst86)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst61)*(gconst67)*(gconst84)*(gconst90)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst66)*(gconst85)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst70)*(gconst76)*(gconst93)))+(((gconst61)*(gconst64)*(gconst84)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst66)*(gconst72)*(gconst73)*(gconst91)))+(((gconst63)*(gconst71)*(gconst80)*(gconst88)))+(((gconst68)*(gconst75)*(gconst76)*(gconst83)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst68)*(gconst86)*(gconst88)))+(((gconst65)*(gconst67)*(gconst84)*(gconst86)))+(((IKReal(-1.00000000000000))*(gconst66)*(gconst67)*(gconst84)*(gconst85)))+(((gconst64)*(gconst68)*(gconst83)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst63)*(gconst88)*(gconst93)))+(((gconst60)*(gconst76)*(gconst81)*(gconst85)))+(((gconst65)*(gconst72)*(gconst79)*(gconst86)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst64)*(gconst86)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst69)*(gconst82)*(gconst87)))+(((gconst61)*(gconst72)*(gconst81)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst68)*(gconst72)*(gconst76)*(gconst86)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst73)*(gconst79)*(gconst90)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst67)*(gconst87)*(gconst89)))+(((gconst58)*(gconst75)*(gconst79)*(gconst90)))+(((gconst58)*(gconst67)*(gconst87)*(gconst90)))+(((gconst69)*(gconst73)*(gconst76)*(gconst84)))+(((gconst61)*(gconst72)*(gconst76)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst65)*(gconst67)*(gconst83)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst65)*(gconst83)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst61)*(gconst72)*(gconst78)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst61)*(gconst78)*(gconst79)*(gconst84)))+(((gconst69)*(gconst72)*(gconst73)*(gconst88)))+(((gconst63)*(gconst70)*(gconst79)*(gconst90)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst74)*(gconst80)*(gconst84)))+(((gconst58)*(gconst75)*(gconst78)*(gconst91)))+(((gconst62)*(gconst67)*(gconst84)*(gconst89)))+(((gconst67)*(gconst70)*(gconst75)*(gconst90)))+(((gconst63)*(gconst67)*(gconst82)*(gconst90)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst68)*(gconst84)*(gconst86)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst74)*(gconst80)*(gconst88)))+(((gconst63)*(gconst68)*(gconst83)*(gconst88)))+(((gconst69)*(gconst72)*(gconst76)*(gconst85)))+(((gconst66)*(gconst70)*(gconst79)*(gconst87)))+(((gconst68)*(gconst71)*(gconst75)*(gconst88)))+(((gconst63)*(gconst70)*(gconst78)*(gconst91)))+(((gconst67)*(gconst70)*(gconst78)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst71)*(gconst77)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst73)*(gconst78)*(gconst91)))+(((gconst66)*(gconst70)*(gconst75)*(gconst91)))+(((gconst66)*(gconst67)*(gconst82)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst69)*(gconst82)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst71)*(gconst75)*(gconst77)*(gconst79)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst67)*(gconst85)*(gconst90)))+(((gconst64)*(gconst72)*(gconst73)*(gconst93)))+(((gconst68)*(gconst71)*(gconst76)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst78)*(gconst79)*(gconst85)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst70)*(gconst75)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst61)*(gconst72)*(gconst79)*(gconst90)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst70)*(gconst81)*(gconst88)))+(((gconst63)*(gconst78)*(gconst79)*(gconst82)))+(((gconst59)*(gconst63)*(gconst88)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst67)*(gconst83)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst65)*(gconst71)*(gconst75)*(gconst91)))+(((gconst64)*(gconst71)*(gconst75)*(gconst92)))+(((gconst67)*(gconst72)*(gconst77)*(gconst86)))+(((gconst67)*(gconst74)*(gconst77)*(gconst84)))+(((IKReal(-1.00000000000000))*(gconst67)*(gconst72)*(gconst78)*(gconst85)))+(((gconst61)*(gconst69)*(gconst84)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst67)*(gconst72)*(gconst73)*(gconst90)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst75)*(gconst76)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst65)*(gconst87)*(gconst91)))+(((gconst71)*(gconst75)*(gconst76)*(gconst80)))+(((gconst60)*(gconst67)*(gconst86)*(gconst89)))+(((gconst62)*(gconst72)*(gconst79)*(gconst89)))+(((gconst63)*(gconst71)*(gconst76)*(gconst92)))+(((gconst60)*(gconst73)*(gconst76)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst68)*(gconst72)*(gconst74)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst67)*(gconst73)*(gconst78)*(gconst84)))+(((IKReal(-1.00000000000000))*(gconst69)*(gconst70)*(gconst76)*(gconst87)))+(((gconst59)*(gconst75)*(gconst76)*(gconst92)))+(((gconst72)*(gconst74)*(gconst77)*(gconst79)))+(((gconst70)*(gconst75)*(gconst78)*(gconst79)))+(((IKReal(-1.00000000000000))*(gconst66)*(gconst73)*(gconst79)*(gconst84)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst64)*(gconst87)*(gconst93)))+(((gconst63)*(gconst66)*(gconst82)*(gconst91)))+(((gconst66)*(gconst75)*(gconst79)*(gconst82)))+(((IKReal(-1.00000000000000))*(gconst62)*(gconst68)*(gconst84)*(gconst88)))+(((gconst60)*(gconst77)*(gconst79)*(gconst86)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst72)*(gconst74)*(gconst92)))+(((gconst60)*(gconst64)*(gconst85)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst61)*(gconst90)*(gconst91)))+(((gconst59)*(gconst64)*(gconst87)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst62)*(gconst72)*(gconst76)*(gconst92)))+(((gconst72)*(gconst73)*(gconst76)*(gconst81)))+(((gconst64)*(gconst71)*(gconst80)*(gconst87)))+(((gconst64)*(gconst72)*(gconst81)*(gconst85)))+(((IKReal(-1.00000000000000))*(gconst61)*(gconst66)*(gconst84)*(gconst91)))+(((gconst67)*(gconst72)*(gconst74)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst69)*(gconst87)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst67)*(gconst71)*(gconst77)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst62)*(gconst72)*(gconst80)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst74)*(gconst76)*(gconst92)))+(((gconst64)*(gconst73)*(gconst81)*(gconst84)))+(((gconst62)*(gconst77)*(gconst79)*(gconst84)))+(((IKReal(-1.00000000000000))*(gconst69)*(gconst75)*(gconst76)*(gconst82)))+(((gconst58)*(gconst66)*(gconst87)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst77)*(gconst79)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst75)*(gconst81)*(gconst82)))+(((gconst61)*(gconst76)*(gconst81)*(gconst84)))+(((gconst64)*(gconst75)*(gconst80)*(gconst83)))+(((gconst63)*(gconst64)*(gconst83)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst67)*(gconst71)*(gconst75)*(gconst89)))+(((gconst62)*(gconst72)*(gconst77)*(gconst91)))+(((gconst59)*(gconst76)*(gconst80)*(gconst87)))+(((gconst59)*(gconst68)*(gconst87)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst66)*(gconst72)*(gconst79)*(gconst85)))+(((IKReal(-1.00000000000000))*(gconst62)*(gconst76)*(gconst80)*(gconst84)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst63)*(gconst89)*(gconst91)))+(((gconst67)*(gconst75)*(gconst78)*(gconst82)))+(((gconst59)*(gconst75)*(gconst80)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst77)*(gconst79)*(gconst83)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst71)*(gconst79)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst72)*(gconst80)*(gconst86)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst76)*(gconst81)*(gconst82)))+(((IKReal(-1.00000000000000))*(gconst62)*(gconst64)*(gconst84)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst69)*(gconst70)*(gconst75)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst64)*(gconst82)*(gconst93)))+(((gconst62)*(gconst65)*(gconst84)*(gconst91)))+(((gconst60)*(gconst69)*(gconst85)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst70)*(gconst81)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst76)*(gconst80)*(gconst86)))+(((gconst65)*(gconst74)*(gconst79)*(gconst84)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst75)*(gconst79)*(gconst89)))+(((gconst60)*(gconst62)*(gconst89)*(gconst91)))+(((gconst60)*(gconst74)*(gconst77)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst68)*(gconst74)*(gconst76)*(gconst84)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst75)*(gconst81)*(gconst88)))+(((gconst63)*(gconst76)*(gconst80)*(gconst83)))+(((gconst60)*(gconst73)*(gconst81)*(gconst88)))+(((gconst58)*(gconst63)*(gconst90)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst67)*(gconst75)*(gconst77)*(gconst83)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst62)*(gconst88)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst75)*(gconst77)*(gconst91)))+(((gconst64)*(gconst69)*(gconst84)*(gconst85)))+(((gconst60)*(gconst61)*(gconst88)*(gconst93)))+(((gconst65)*(gconst72)*(gconst74)*(gconst91))));
op[5]=((((IKReal(-1.00000000000000))*(gconst59)*(gconst63)*(gconst79)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst68)*(gconst72)*(gconst74)*(gconst76)))+(((gconst61)*(gconst64)*(gconst72)*(gconst93)))+(((gconst64)*(gconst68)*(gconst71)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst72)*(gconst74)*(gconst80)))+(((gconst63)*(gconst66)*(gconst79)*(gconst82)))+(((gconst60)*(gconst65)*(gconst79)*(gconst86)))+(((gconst60)*(gconst67)*(gconst74)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst62)*(gconst80)*(gconst88)))+(((gconst63)*(gconst67)*(gconst78)*(gconst82)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst64)*(gconst75)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst69)*(gconst70)*(gconst88)))+(((gconst69)*(gconst72)*(gconst73)*(gconst76)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst69)*(gconst75)*(gconst88)))+(((gconst63)*(gconst70)*(gconst78)*(gconst79)))+(((gconst58)*(gconst63)*(gconst78)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst66)*(gconst67)*(gconst73)*(gconst84)))+(((gconst59)*(gconst64)*(gconst75)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst65)*(gconst67)*(gconst71)*(gconst87)))+(((gconst58)*(gconst66)*(gconst75)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst64)*(gconst81)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst66)*(gconst67)*(gconst72)*(gconst85)))+(((IKReal(-1.00000000000000))*(gconst61)*(gconst67)*(gconst72)*(gconst90)))+(((gconst64)*(gconst68)*(gconst75)*(gconst83)))+(((gconst58)*(gconst67)*(gconst78)*(gconst87)))+(((gconst68)*(gconst71)*(gconst75)*(gconst76)))+(((gconst62)*(gconst65)*(gconst72)*(gconst91)))+(((gconst59)*(gconst64)*(gconst80)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst66)*(gconst72)*(gconst73)*(gconst79)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst70)*(gconst75)*(gconst81)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst75)*(gconst77)*(gconst79)))+(((gconst60)*(gconst67)*(gconst77)*(gconst86)))+(((gconst63)*(gconst64)*(gconst80)*(gconst83)))+(((gconst58)*(gconst63)*(gconst79)*(gconst90)))+(((gconst61)*(gconst69)*(gconst76)*(gconst84)))+(((IKReal(-1.00000000000000))*(gconst65)*(gconst71)*(gconst75)*(gconst79)))+(((gconst59)*(gconst75)*(gconst76)*(gconst80)))+(((gconst66)*(gconst70)*(gconst75)*(gconst79)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst67)*(gconst71)*(gconst89)))+(((gconst60)*(gconst69)*(gconst73)*(gconst88)))+(((gconst63)*(gconst68)*(gconst76)*(gconst83)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst68)*(gconst72)*(gconst86)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst64)*(gconst74)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst75)*(gconst76)*(gconst81)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst61)*(gconst79)*(gconst90)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst73)*(gconst78)*(gconst79)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst68)*(gconst74)*(gconst84)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst67)*(gconst77)*(gconst83)))+(((gconst62)*(gconst72)*(gconst77)*(gconst79)))+(((gconst66)*(gconst67)*(gconst75)*(gconst82)))+(((gconst62)*(gconst67)*(gconst72)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst63)*(gconst81)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst62)*(gconst72)*(gconst76)*(gconst80)))+(((gconst60)*(gconst62)*(gconst77)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst63)*(gconst76)*(gconst93)))+(((gconst60)*(gconst74)*(gconst77)*(gconst79)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst61)*(gconst78)*(gconst91)))+(((gconst65)*(gconst67)*(gconst74)*(gconst84)))+(((gconst60)*(gconst61)*(gconst76)*(gconst93)))+(((gconst58)*(gconst75)*(gconst78)*(gconst79)))+(((gconst59)*(gconst68)*(gconst76)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst64)*(gconst81)*(gconst82)))+(((gconst63)*(gconst68)*(gconst71)*(gconst88)))+(((gconst61)*(gconst64)*(gconst81)*(gconst84)))+(((IKReal(-1.00000000000000))*(gconst62)*(gconst68)*(gconst72)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst66)*(gconst73)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst64)*(gconst80)*(gconst86)))+(((gconst60)*(gconst65)*(gconst74)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst67)*(gconst72)*(gconst73)*(gconst78)))+(((IKReal(-1.00000000000000))*(gconst65)*(gconst67)*(gconst75)*(gconst83)))+(((gconst59)*(gconst68)*(gconst75)*(gconst88)))+(((gconst60)*(gconst64)*(gconst81)*(gconst85)))+(((gconst58)*(gconst67)*(gconst75)*(gconst90)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst62)*(gconst76)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst74)*(gconst76)*(gconst80)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst67)*(gconst73)*(gconst90)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst63)*(gconst77)*(gconst91)))+(((gconst64)*(gconst71)*(gconst75)*(gconst80)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst69)*(gconst76)*(gconst82)))+(((gconst60)*(gconst69)*(gconst76)*(gconst85)))+(((IKReal(-1.00000000000000))*(gconst62)*(gconst68)*(gconst76)*(gconst84)))+(((gconst60)*(gconst61)*(gconst81)*(gconst88)))+(((gconst60)*(gconst64)*(gconst73)*(gconst93)))+(((gconst61)*(gconst69)*(gconst72)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst64)*(gconst70)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst70)*(gconst76)*(gconst81)))+(((IKReal(-1.00000000000000))*(gconst69)*(gconst70)*(gconst75)*(gconst76)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst65)*(gconst71)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst62)*(gconst64)*(gconst80)*(gconst84)))+(((IKReal(-1.00000000000000))*(gconst61)*(gconst66)*(gconst72)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst67)*(gconst78)*(gconst85)))+(((gconst64)*(gconst72)*(gconst73)*(gconst81)))+(((IKReal(-1.00000000000000))*(gconst67)*(gconst71)*(gconst75)*(gconst77)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst69)*(gconst75)*(gconst82)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst69)*(gconst76)*(gconst87)))+(((gconst65)*(gconst67)*(gconst72)*(gconst86)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst66)*(gconst79)*(gconst85)))+(((gconst59)*(gconst63)*(gconst80)*(gconst88)))+(((gconst63)*(gconst64)*(gconst71)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst65)*(gconst79)*(gconst83)))+(((gconst63)*(gconst66)*(gconst70)*(gconst91)))+(((gconst67)*(gconst72)*(gconst74)*(gconst77)))+(((IKReal(-1.00000000000000))*(gconst62)*(gconst64)*(gconst72)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst68)*(gconst74)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst61)*(gconst66)*(gconst79)*(gconst84)))+(((gconst66)*(gconst67)*(gconst70)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst67)*(gconst77)*(gconst87)))+(((gconst62)*(gconst65)*(gconst79)*(gconst84)))+(((gconst63)*(gconst71)*(gconst76)*(gconst80)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst71)*(gconst77)*(gconst79)))+(((IKReal(-1.00000000000000))*(gconst61)*(gconst67)*(gconst78)*(gconst84)))+(((gconst65)*(gconst72)*(gconst74)*(gconst79)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst65)*(gconst79)*(gconst87)))+(((gconst60)*(gconst62)*(gconst79)*(gconst89)))+(((gconst59)*(gconst63)*(gconst76)*(gconst92)))+(((gconst63)*(gconst67)*(gconst70)*(gconst90)))+(((gconst64)*(gconst69)*(gconst73)*(gconst84)))+(((gconst61)*(gconst72)*(gconst76)*(gconst81)))+(((gconst62)*(gconst67)*(gconst77)*(gconst84)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst68)*(gconst76)*(gconst86)))+(((gconst67)*(gconst70)*(gconst75)*(gconst78)))+(((gconst60)*(gconst73)*(gconst76)*(gconst81)))+(((IKReal(-1.00000000000000))*(gconst61)*(gconst72)*(gconst78)*(gconst79)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst67)*(gconst75)*(gconst89)))+(((gconst64)*(gconst69)*(gconst72)*(gconst85)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst69)*(gconst70)*(gconst87)))+(((gconst58)*(gconst66)*(gconst79)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst65)*(gconst75)*(gconst91))));
op[6]=((((gconst61)*(gconst64)*(gconst69)*(gconst84)))+(((gconst60)*(gconst62)*(gconst65)*(gconst91)))+(((gconst62)*(gconst65)*(gconst67)*(gconst84)))+(((gconst62)*(gconst67)*(gconst72)*(gconst77)))+(((IKReal(-1.00000000000000))*(gconst65)*(gconst67)*(gconst71)*(gconst75)))+(((gconst61)*(gconst64)*(gconst72)*(gconst81)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst64)*(gconst69)*(gconst87)))+(((gconst58)*(gconst66)*(gconst67)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst63)*(gconst69)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst61)*(gconst67)*(gconst90)))+(((gconst60)*(gconst69)*(gconst73)*(gconst76)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst61)*(gconst66)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst62)*(gconst64)*(gconst92)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst64)*(gconst69)*(gconst82)))+(((gconst58)*(gconst63)*(gconst78)*(gconst79)))+(((gconst63)*(gconst68)*(gconst71)*(gconst76)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst62)*(gconst76)*(gconst80)))+(((IKReal(-1.00000000000000))*(gconst61)*(gconst67)*(gconst72)*(gconst78)))+(((gconst58)*(gconst67)*(gconst75)*(gconst78)))+(((gconst63)*(gconst67)*(gconst70)*(gconst78)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst64)*(gconst75)*(gconst81)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst65)*(gconst67)*(gconst87)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst65)*(gconst75)*(gconst79)))+(((IKReal(-1.00000000000000))*(gconst61)*(gconst66)*(gconst67)*(gconst84)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst68)*(gconst74)*(gconst76)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst64)*(gconst70)*(gconst81)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst65)*(gconst71)*(gconst79)))+(((gconst59)*(gconst68)*(gconst75)*(gconst76)))+(((gconst60)*(gconst61)*(gconst64)*(gconst93)))+(((gconst59)*(gconst63)*(gconst64)*(gconst92)))+(((gconst61)*(gconst69)*(gconst72)*(gconst76)))+(((gconst58)*(gconst63)*(gconst66)*(gconst91)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst63)*(gconst77)*(gconst79)))+(((gconst60)*(gconst61)*(gconst76)*(gconst81)))+(((gconst59)*(gconst64)*(gconst75)*(gconst80)))+(((gconst60)*(gconst64)*(gconst73)*(gconst81)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst62)*(gconst68)*(gconst88)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst67)*(gconst75)*(gconst77)))+(((gconst63)*(gconst66)*(gconst70)*(gconst79)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst64)*(gconst74)*(gconst80)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst69)*(gconst70)*(gconst75)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst68)*(gconst72)*(gconst74)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst69)*(gconst70)*(gconst76)))+(((gconst65)*(gconst67)*(gconst72)*(gconst74)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst61)*(gconst78)*(gconst79)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst64)*(gconst68)*(gconst86)))+(((IKReal(-1.00000000000000))*(gconst62)*(gconst64)*(gconst72)*(gconst80)))+(((gconst59)*(gconst63)*(gconst76)*(gconst80)))+(((IKReal(-1.00000000000000))*(gconst62)*(gconst68)*(gconst72)*(gconst76)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst66)*(gconst73)*(gconst79)))+(((gconst64)*(gconst69)*(gconst72)*(gconst73)))+(((gconst60)*(gconst65)*(gconst67)*(gconst86)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst65)*(gconst67)*(gconst83)))+(((gconst66)*(gconst67)*(gconst70)*(gconst75)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst63)*(gconst65)*(gconst91)))+(((gconst60)*(gconst61)*(gconst69)*(gconst88)))+(((gconst59)*(gconst63)*(gconst68)*(gconst88)))+(((gconst59)*(gconst64)*(gconst68)*(gconst87)))+(((gconst60)*(gconst62)*(gconst67)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst61)*(gconst66)*(gconst72)*(gconst79)))+(((IKReal(-1.00000000000000))*(gconst62)*(gconst64)*(gconst68)*(gconst84)))+(((IKReal(-1.00000000000000))*(gconst59)*(gconst63)*(gconst67)*(gconst89)))+(((IKReal(-1.00000000000000))*(gconst66)*(gconst67)*(gconst72)*(gconst73)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst67)*(gconst73)*(gconst78)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst63)*(gconst76)*(gconst81)))+(((gconst64)*(gconst68)*(gconst71)*(gconst75)))+(((IKReal(-1.00000000000000))*(gconst63)*(gconst67)*(gconst71)*(gconst77)))+(((gconst60)*(gconst65)*(gconst74)*(gconst79)))+(((gconst60)*(gconst67)*(gconst74)*(gconst77)))+(((gconst60)*(gconst64)*(gconst69)*(gconst85)))+(((IKReal(-1.00000000000000))*(gconst60)*(gconst66)*(gconst67)*(gconst85)))+(((gconst63)*(gconst66)*(gconst67)*(gconst82)))+(((gconst58)*(gconst63)*(gconst67)*(gconst90)))+(((gconst58)*(gconst66)*(gconst75)*(gconst79)))+(((gconst63)*(gconst64)*(gconst68)*(gconst83)))+(((gconst63)*(gconst64)*(gconst71)*(gconst80)))+(((gconst62)*(gconst65)*(gconst72)*(gconst79)))+(((gconst60)*(gconst62)*(gconst77)*(gconst79)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst63)*(gconst64)*(gconst93)))+(((IKReal(-1.00000000000000))*(gconst58)*(gconst69)*(gconst75)*(gconst76))));
op[7]=((((IKReal(-1.00000000000000))*(gconst69)*(gconst76)*(x172)))+(((IKReal(-1.00000000000000))*(gconst74)*(x160)*(x187)))+(((x160)*(x192)))+(((gconst61)*(gconst81)*(x170)))+(((gconst69)*(gconst73)*(x170)))+(((IKReal(-1.00000000000000))*(gconst68)*(x165)*(x184)))+(((IKReal(-1.00000000000000))*(gconst80)*(x170)*(x184)))+(((gconst68)*(gconst76)*(x159)))+(((gconst65)*(gconst79)*(x176)))+(((gconst66)*(gconst79)*(x172)))+(((gconst60)*(gconst74)*(x158)))+(((IKReal(-1.00000000000000))*(gconst64)*(gconst81)*(x172)))+(((x172)*(x174)))+(((x175)*(x176)))+(((IKReal(-1.00000000000000))*(gconst73)*(x171)*(x187)))+(((IKReal(-1.00000000000000))*(x174)*(x186)))+(((gconst62)*(gconst72)*(x158)))+(((IKReal(-1.00000000000000))*(x158)*(x192)))+(((x166)*(x171)))+(((x154)*(x155)))+(((IKReal(-1.00000000000000))*(gconst65)*(x156)*(x159)))+(((x154)*(x165)))+(((x171)*(x181)))+(((IKReal(-1.00000000000000))*(x159)*(x175)))+(((IKReal(-1.00000000000000))*(x158)*(x173)))+(((IKReal(-1.00000000000000))*(gconst68)*(x155)*(x184)))+(((IKReal(-1.00000000000000))*(x166)*(x194)))+(((gconst64)*(gconst80)*(x159)))+(((IKReal(-1.00000000000000))*(gconst66)*(x156)*(x186)))+(((IKReal(-1.00000000000000))*(gconst61)*(gconst72)*(x171)))+(((IKReal(-1.00000000000000))*(x181)*(x194)))+(((x160)*(x173))));
op[8]=((((IKReal(-1.00000000000000))*(x171)*(x186)))+(((IKReal(-1.00000000000000))*(x158)*(x159)))+(((x171)*(x172)))+(((IKReal(-1.00000000000000))*(x160)*(x176)))+(((x154)*(x170)))+(((IKReal(-1.00000000000000))*(x172)*(x194)))+(((x158)*(x176)))+(((x159)*(x160))));
polyroots8(op,zeror,numroots);
IKReal j0array[8], cj0array[8], sj0array[8], tempj0array[1];
int numsolutions = 0;
for(int ij0 = 0; ij0 < numroots; ++ij0)
{
IKReal htj0 = zeror[ij0];
tempj0array[0]=((IKReal(2.00000000000000))*(atan(htj0)));
for(int kj0 = 0; kj0 < 1; ++kj0)
{
j0array[numsolutions] = tempj0array[kj0];
if( j0array[numsolutions] > IKPI )
{
    j0array[numsolutions]-=IK2PI;
}
else if( j0array[numsolutions] < -IKPI )
{
    j0array[numsolutions]+=IK2PI;
}
sj0array[numsolutions] = IKsin(j0array[numsolutions]);
cj0array[numsolutions] = IKcos(j0array[numsolutions]);
numsolutions++;
}
}
bool j0valid[8]={true,true,true,true,true,true,true,true};
_nj0 = 8;
for(int ij0 = 0; ij0 < numsolutions; ++ij0)
    {
if( !j0valid[ij0] )
{
    continue;
}
    j0 = j0array[ij0]; cj0 = cj0array[ij0]; sj0 = sj0array[ij0];
htj0 = IKtan(j0/2);

_ij0[0] = ij0; _ij0[1] = -1;
for(int iij0 = ij0+1; iij0 < numsolutions; ++iij0)
{
if( j0valid[iij0] && IKabs(cj0array[ij0]-cj0array[iij0]) < IKFAST_SOLUTION_THRESH && IKabs(sj0array[ij0]-sj0array[iij0]) < IKFAST_SOLUTION_THRESH )
{
    j0valid[iij0]=false; _ij0[1] = iij0; break; 
}
}
{
IKReal dummyeval[1];
IKReal gconst110;
gconst110=IKsign(((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))));
dummyeval[0]=((IKReal(1.00000000000000))+(((IKReal(7.77777777777778))*(sj3)))+(((IKReal(-1.00000000000000))*(cj3))));
if( IKabs(dummyeval[0]) < 0.0000010000000000  )
{
{
IKReal evalcond[5];
evalcond[0]=((IKReal(-3.14159265358979))+(IKfmod(((IKReal(3.14159265358979))+(j3)), IKReal(6.28318530717959))));
evalcond[1]=((IKReal(0.810000000000000))+(((IKReal(-1.00000000000000))*(pp))));
evalcond[2]=((IKReal(-0.900000000000000))+(((IKReal(-1.00000000000000))*(pz))));
evalcond[3]=((((px)*(sj0)))+(((IKReal(-1.00000000000000))*(cj0)*(py))));
evalcond[4]=((((cj0)*(px)))+(((py)*(sj0))));
if( IKabs(evalcond[0]) < 0.0000010000000000  && IKabs(evalcond[1]) < 0.0000010000000000  && IKabs(evalcond[2]) < 0.0000010000000000  && IKabs(evalcond[3]) < 0.0000010000000000  && IKabs(evalcond[4]) < 0.0000010000000000  )
{
{
IKReal dummyeval[1];
IKReal gconst111;
IKReal x196=(px)*(px);
IKReal x197=(sj0)*(sj0);
IKReal x198=(cj0)*(cj0);
IKReal x199=(py)*(py);
IKReal x200=((IKReal(0.0900000000000000))*(x197));
IKReal x201=((IKReal(0.0900000000000000))*(x198));
gconst111=IKsign(((((x196)*(x200)))+(((x196)*(x201)))+(((x199)*(x201)))+(((x199)*(x200)))));
IKReal x202=(sj0)*(sj0);
IKReal x203=(py)*(py);
IKReal x204=(cj0)*(cj0);
IKReal x205=(px)*(px);
dummyeval[0]=((((x204)*(x205)))+(((x202)*(x203)))+(((x202)*(x205)))+(((x203)*(x204))));
if( IKabs(dummyeval[0]) < 0.0000010000000000  )
{
continue;

} else
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
IKReal x206=((cj0)*(px));
IKReal x207=((IKReal(1.10000000000000))*(pz));
IKReal x208=((IKReal(1.00000000000000))*(pp));
IKReal x209=((px)*(sj0));
IKReal x210=((cj0)*(py));
IKReal x211=((py)*(sj0));
if( IKabs(((gconst111)*(((((IKReal(-0.180000000000000))*(x209)))+(((x207)*(x210)))+(((IKReal(-1.00000000000000))*(x208)*(x209)))+(((IKReal(-1.00000000000000))*(x207)*(x209)))+(((IKReal(0.180000000000000))*(x210)))+(((pp)*(x210))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((gconst111)*(((((IKReal(-0.180000000000000))*(x211)))+(((IKReal(-1.00000000000000))*(x207)*(x211)))+(((IKReal(-0.180000000000000))*(x206)))+(((IKReal(-1.00000000000000))*(x206)*(x208)))+(((IKReal(-1.00000000000000))*(x206)*(x207)))+(((IKReal(-1.00000000000000))*(x208)*(x211))))))) < IKFAST_ATAN2_MAGTHRESH )
    continue;
j2array[0]=IKatan2(((gconst111)*(((((IKReal(-0.180000000000000))*(x209)))+(((x207)*(x210)))+(((IKReal(-1.00000000000000))*(x208)*(x209)))+(((IKReal(-1.00000000000000))*(x207)*(x209)))+(((IKReal(0.180000000000000))*(x210)))+(((pp)*(x210)))))), ((gconst111)*(((((IKReal(-0.180000000000000))*(x211)))+(((IKReal(-1.00000000000000))*(x207)*(x211)))+(((IKReal(-0.180000000000000))*(x206)))+(((IKReal(-1.00000000000000))*(x206)*(x208)))+(((IKReal(-1.00000000000000))*(x206)*(x207)))+(((IKReal(-1.00000000000000))*(x208)*(x211)))))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[3];
IKReal x212=IKcos(j2);
IKReal x213=IKsin(j2);
IKReal x214=((IKReal(0.0900000000000000))*(py));
IKReal x215=((IKReal(0.0900000000000000))*(px));
IKReal x216=((IKReal(1.00000000000000))*(py));
IKReal x217=((sj0)*(x212));
IKReal x218=((cj0)*(x212));
IKReal x219=((sj0)*(x213));
IKReal x220=((IKReal(1.00000000000000))*(cj0)*(x213));
evalcond[0]=((((px)*(x217)))+(((IKReal(-1.00000000000000))*(px)*(x220)))+(((IKReal(-1.00000000000000))*(x216)*(x219)))+(((IKReal(-1.00000000000000))*(x216)*(x218))));
evalcond[1]=((((py)*(x217)))+(((IKReal(-1.00000000000000))*(cj0)*(x213)*(x216)))+(((px)*(x219)))+(((px)*(x218))));
evalcond[2]=((IKReal(-0.180000000000000))+(((cj0)*(x213)*(x214)))+(((IKReal(-1.00000000000000))*(pp)))+(((IKReal(-1.10000000000000))*(pz)))+(((IKReal(-1.00000000000000))*(x214)*(x217)))+(((IKReal(-1.00000000000000))*(x215)*(x218)))+(((IKReal(-1.00000000000000))*(x215)*(x219))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

}

}

} else
{
evalcond[0]=((IKReal(-3.14159265358979))+(IKfmod(((IKReal(3.14159265358979))+(j3)), IKReal(6.28318530717959))));
evalcond[1]=((IKReal(0.810000000000000))+(((IKReal(-1.00000000000000))*(pp))));
evalcond[2]=((IKReal(-0.900000000000000))+(((IKReal(-1.00000000000000))*(pz))));
evalcond[3]=((((px)*(sj0)))+(((IKReal(-1.00000000000000))*(cj0)*(py))));
evalcond[4]=((((cj0)*(px)))+(((py)*(sj0))));
if( IKabs(evalcond[0]) < 0.0000010000000000  && IKabs(evalcond[1]) < 0.0000010000000000  && IKabs(evalcond[2]) < 0.0000010000000000  && IKabs(evalcond[3]) < 0.0000010000000000  && IKabs(evalcond[4]) < 0.0000010000000000  )
{
{
IKReal dummyeval[1];
IKReal gconst112;
IKReal x221=(px)*(px);
IKReal x222=(sj0)*(sj0);
IKReal x223=(cj0)*(cj0);
IKReal x224=(py)*(py);
IKReal x225=((IKReal(0.0900000000000000))*(x222));
IKReal x226=((IKReal(0.0900000000000000))*(x223));
gconst112=IKsign(((((x224)*(x225)))+(((x224)*(x226)))+(((x221)*(x225)))+(((x221)*(x226)))));
IKReal x227=(sj0)*(sj0);
IKReal x228=(py)*(py);
IKReal x229=(cj0)*(cj0);
IKReal x230=(px)*(px);
dummyeval[0]=((((x227)*(x228)))+(((x229)*(x230)))+(((x228)*(x229)))+(((x227)*(x230))));
if( IKabs(dummyeval[0]) < 0.0000010000000000  )
{
continue;

} else
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
IKReal x231=((cj0)*(px));
IKReal x232=((IKReal(1.10000000000000))*(pz));
IKReal x233=((IKReal(1.00000000000000))*(pp));
IKReal x234=((px)*(sj0));
IKReal x235=((cj0)*(py));
IKReal x236=((py)*(sj0));
if( IKabs(((gconst112)*(((((IKReal(-1.00000000000000))*(x233)*(x234)))+(((pp)*(x235)))+(((IKReal(0.180000000000000))*(x235)))+(((x232)*(x235)))+(((IKReal(-0.180000000000000))*(x234)))+(((IKReal(-1.00000000000000))*(x232)*(x234))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((gconst112)*(((((IKReal(-1.00000000000000))*(x233)*(x236)))+(((IKReal(-0.180000000000000))*(x236)))+(((IKReal(-0.180000000000000))*(x231)))+(((IKReal(-1.00000000000000))*(x231)*(x232)))+(((IKReal(-1.00000000000000))*(x231)*(x233)))+(((IKReal(-1.00000000000000))*(x232)*(x236))))))) < IKFAST_ATAN2_MAGTHRESH )
    continue;
j2array[0]=IKatan2(((gconst112)*(((((IKReal(-1.00000000000000))*(x233)*(x234)))+(((pp)*(x235)))+(((IKReal(0.180000000000000))*(x235)))+(((x232)*(x235)))+(((IKReal(-0.180000000000000))*(x234)))+(((IKReal(-1.00000000000000))*(x232)*(x234)))))), ((gconst112)*(((((IKReal(-1.00000000000000))*(x233)*(x236)))+(((IKReal(-0.180000000000000))*(x236)))+(((IKReal(-0.180000000000000))*(x231)))+(((IKReal(-1.00000000000000))*(x231)*(x232)))+(((IKReal(-1.00000000000000))*(x231)*(x233)))+(((IKReal(-1.00000000000000))*(x232)*(x236)))))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[3];
IKReal x237=IKcos(j2);
IKReal x238=IKsin(j2);
IKReal x239=((IKReal(0.0900000000000000))*(py));
IKReal x240=((IKReal(0.0900000000000000))*(px));
IKReal x241=((IKReal(1.00000000000000))*(py));
IKReal x242=((sj0)*(x237));
IKReal x243=((cj0)*(x237));
IKReal x244=((sj0)*(x238));
IKReal x245=((IKReal(1.00000000000000))*(cj0)*(x238));
evalcond[0]=((((px)*(x242)))+(((IKReal(-1.00000000000000))*(x241)*(x243)))+(((IKReal(-1.00000000000000))*(x241)*(x244)))+(((IKReal(-1.00000000000000))*(px)*(x245))));
evalcond[1]=((((px)*(x243)))+(((px)*(x244)))+(((IKReal(-1.00000000000000))*(cj0)*(x238)*(x241)))+(((py)*(x242))));
evalcond[2]=((IKReal(-0.180000000000000))+(((cj0)*(x238)*(x239)))+(((IKReal(-1.00000000000000))*(pp)))+(((IKReal(-1.10000000000000))*(pz)))+(((IKReal(-1.00000000000000))*(x240)*(x243)))+(((IKReal(-1.00000000000000))*(x240)*(x244)))+(((IKReal(-1.00000000000000))*(x239)*(x242))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

}

}

} else
{
evalcond[0]=((IKReal(-3.14159265358979))+(IKfmod(((IKReal(-0.255739837120000))+(j3)), IKReal(6.28318530717959))));
evalcond[1]=((IKReal(0.0400000003605000))+(((IKReal(-1.00000000000000))*(pp))));
evalcond[2]=((IKReal(-0.200000000250000))+(((IKReal(-1.00000000000000))*(pz))));
if( IKabs(evalcond[0]) < 0.0000010000000000  && IKabs(evalcond[1]) < 0.0000010000000000  && IKabs(evalcond[2]) < 0.0000010000000000  )
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
IKReal x246=((IKReal(1052631578.94737))*(py));
IKReal x247=((IKReal(1052631578.94737))*(px));
if( IKabs(((((cj0)*(x246)))+(((IKReal(-1.00000000000000))*(sj0)*(x247))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((IKReal(-1.00000000000000))*(sj0)*(x246)))+(((IKReal(-1.00000000000000))*(cj0)*(x247))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((cj0)*(x246)))+(((IKReal(-1.00000000000000))*(sj0)*(x247)))))+IKsqr(((((IKReal(-1.00000000000000))*(sj0)*(x246)))+(((IKReal(-1.00000000000000))*(cj0)*(x247)))))-1) <= IKFAST_SINCOS_THRESH )
    continue;
j2array[0]=IKatan2(((((cj0)*(x246)))+(((IKReal(-1.00000000000000))*(sj0)*(x247)))), ((((IKReal(-1.00000000000000))*(sj0)*(x246)))+(((IKReal(-1.00000000000000))*(cj0)*(x247)))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[5];
IKReal x248=IKcos(j2);
IKReal x249=IKsin(j2);
IKReal x250=((cj0)*(px));
IKReal x251=((IKReal(0.0900000000000000))*(py));
IKReal x252=((cj0)*(py));
IKReal x253=((px)*(sj0));
IKReal x254=((py)*(sj0));
IKReal x255=((IKReal(1.00000000000000))*(x249));
IKReal x256=((sj0)*(x248));
evalcond[0]=((((IKReal(9.50000000000000e-10))*(x249)))+(x253)+(((IKReal(-1.00000000000000))*(x252))));
evalcond[1]=((((IKReal(9.50000000000000e-10))*(x248)))+(x254)+(x250));
evalcond[2]=((((x248)*(x253)))+(((IKReal(-1.00000000000000))*(x250)*(x255)))+(((IKReal(-1.00000000000000))*(x254)*(x255)))+(((IKReal(-1.00000000000000))*(x248)*(x252))));
evalcond[3]=((IKReal(9.50000000000000e-10))+(((IKReal(-1.00000000000000))*(x252)*(x255)))+(((x248)*(x250)))+(((x248)*(x254)))+(((x249)*(x253))));
evalcond[4]=((IKReal(-0.180000000000000))+(((IKReal(-0.0900000000000000))*(x249)*(x253)))+(((IKReal(-0.0900000000000000))*(x248)*(x250)))+(((IKReal(-1.00000000000000))*(x251)*(x256)))+(((IKReal(-1.00000000000000))*(pp)))+(((IKReal(-1.10000000000000))*(pz)))+(((cj0)*(x249)*(x251))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  || IKabs(evalcond[3]) > 0.000001  || IKabs(evalcond[4]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

} else
{
if( 1 )
{
continue;

} else
{
}
}
}
}
}

} else
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
IKReal x257=((IKReal(1.00000000000000))*(px));
if( IKabs(((gconst110)*(((((IKReal(-1.00000000000000))*(sj0)*(x257)))+(((cj0)*(py))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((gconst110)*(((((IKReal(-1.00000000000000))*(cj0)*(x257)))+(((IKReal(-1.00000000000000))*(py)*(sj0))))))) < IKFAST_ATAN2_MAGTHRESH )
    continue;
j2array[0]=IKatan2(((gconst110)*(((((IKReal(-1.00000000000000))*(sj0)*(x257)))+(((cj0)*(py)))))), ((gconst110)*(((((IKReal(-1.00000000000000))*(cj0)*(x257)))+(((IKReal(-1.00000000000000))*(py)*(sj0)))))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[5];
IKReal x258=IKsin(j2);
IKReal x259=IKcos(j2);
IKReal x260=((cj0)*(px));
IKReal x261=((IKReal(0.0450000000000000))*(cj3));
IKReal x262=((cj0)*(py));
IKReal x263=((py)*(sj0));
IKReal x264=((IKReal(0.350000000000000))*(sj3));
IKReal x265=((px)*(sj0));
IKReal x266=((IKReal(0.0900000000000000))*(x259));
IKReal x267=((IKReal(1.00000000000000))*(x258));
IKReal x268=((IKReal(0.0900000000000000))*(x258));
evalcond[0]=((((IKReal(-1.00000000000000))*(x262)))+(((x258)*(x264)))+(((IKReal(-1.00000000000000))*(x258)*(x261)))+(((IKReal(0.0450000000000000))*(x258)))+(x265));
evalcond[1]=((((x259)*(x264)))+(((IKReal(-1.00000000000000))*(x259)*(x261)))+(((IKReal(0.0450000000000000))*(x259)))+(x260)+(x263));
evalcond[2]=((((IKReal(-1.00000000000000))*(x263)*(x267)))+(((x259)*(x265)))+(((IKReal(-1.00000000000000))*(x259)*(x262)))+(((IKReal(-1.00000000000000))*(x260)*(x267))));
evalcond[3]=((IKReal(0.0450000000000000))+(((IKReal(-1.00000000000000))*(x262)*(x267)))+(((x258)*(x265)))+(((x259)*(x263)))+(((x259)*(x260)))+(x264)+(((IKReal(-1.00000000000000))*(x261))));
evalcond[4]=((IKReal(-0.180000000000000))+(((IKReal(-1.00000000000000))*(x263)*(x266)))+(((x262)*(x268)))+(((IKReal(-1.00000000000000))*(pp)))+(((IKReal(-1.10000000000000))*(pz)))+(((IKReal(-1.00000000000000))*(x265)*(x268)))+(((IKReal(-1.00000000000000))*(x260)*(x266))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  || IKabs(evalcond[3]) > 0.000001  || IKabs(evalcond[4]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

}

}
    }

}

}

} else
{
if( 1 )
{
continue;

} else
{
}
}
}
}

} else
{
{
IKReal j0array[2], cj0array[2], sj0array[2];
bool j0valid[2]={false};
_nj0 = 2;
IKReal x269=(px)*(px);
IKReal x270=(sj1)*(sj1);
IKReal x271=((IKReal(1.21000000000000))*(x270));
IKReal x272=((IKReal(-1.10000000000000))*(sj1));
if( IKabs(((x269)*(x272))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((px)*(py)*(x272))) < IKFAST_ATAN2_MAGTHRESH )
    continue;
IKReal x273=((IKReal(1.00000000000000))*(IKatan2(((x269)*(x272)), ((px)*(py)*(x272)))));
if( (((((x271)*((x269)*(x269))))+(((x269)*(x271)*((py)*(py)))))) < (IKReal)-0.00001 )
    continue;
if( (((((IKabs(IKabs(IKsqrt(((((x271)*((x269)*(x269))))+(((x269)*(x271)*((py)*(py)))))))) != 0)?((IKReal)1/(IKabs(IKsqrt(((((x271)*((x269)*(x269))))+(((x269)*(x271)*((py)*(py))))))))):(IKReal)1.0e30))*(((((IKReal(-1.10000000000000))*(cj1)*(px)*(pz)))+(((IKReal(0.175950000000000))*(px)))+(((IKReal(0.00405000000000000))*(cj3)*(px)))+(((IKReal(-0.0315000000000000))*(px)*(sj3)))+(((pp)*(px))))))) < -1-IKFAST_SINCOS_THRESH || (((((IKabs(IKabs(IKsqrt(((((x271)*((x269)*(x269))))+(((x269)*(x271)*((py)*(py)))))))) != 0)?((IKReal)1/(IKabs(IKsqrt(((((x271)*((x269)*(x269))))+(((x269)*(x271)*((py)*(py))))))))):(IKReal)1.0e30))*(((((IKReal(-1.10000000000000))*(cj1)*(px)*(pz)))+(((IKReal(0.175950000000000))*(px)))+(((IKReal(0.00405000000000000))*(cj3)*(px)))+(((IKReal(-0.0315000000000000))*(px)*(sj3)))+(((pp)*(px))))))) > 1+IKFAST_SINCOS_THRESH )
    continue;
IKReal x274=IKasin(((((IKabs(IKabs(IKsqrt(((((x271)*((x269)*(x269))))+(((x269)*(x271)*((py)*(py)))))))) != 0)?((IKReal)1/(IKabs(IKsqrt(((((x271)*((x269)*(x269))))+(((x269)*(x271)*((py)*(py))))))))):(IKReal)1.0e30))*(((((IKReal(-1.10000000000000))*(cj1)*(px)*(pz)))+(((IKReal(0.175950000000000))*(px)))+(((IKReal(0.00405000000000000))*(cj3)*(px)))+(((IKReal(-0.0315000000000000))*(px)*(sj3)))+(((pp)*(px)))))));
j0array[0]=((((IKReal(-1.00000000000000))*(x274)))+(((IKReal(-1.00000000000000))*(x273))));
sj0array[0]=IKsin(j0array[0]);
cj0array[0]=IKcos(j0array[0]);
j0array[1]=((IKReal(3.14159265358979))+(x274)+(((IKReal(-1.00000000000000))*(x273))));
sj0array[1]=IKsin(j0array[1]);
cj0array[1]=IKcos(j0array[1]);
if( j0array[0] > IKPI )
{
    j0array[0]-=IK2PI;
}
else if( j0array[0] < -IKPI )
{    j0array[0]+=IK2PI;
}
j0valid[0] = true;
if( j0array[1] > IKPI )
{
    j0array[1]-=IK2PI;
}
else if( j0array[1] < -IKPI )
{    j0array[1]+=IK2PI;
}
j0valid[1] = true;
for(int ij0 = 0; ij0 < 2; ++ij0)
{
if( !j0valid[ij0] )
{
    continue;
}
_ij0[0] = ij0; _ij0[1] = -1;
for(int iij0 = ij0+1; iij0 < 2; ++iij0)
{
if( j0valid[iij0] && IKabs(cj0array[ij0]-cj0array[iij0]) < IKFAST_SOLUTION_THRESH && IKabs(sj0array[ij0]-sj0array[iij0]) < IKFAST_SOLUTION_THRESH )
{
    j0valid[iij0]=false; _ij0[1] = iij0; break; 
}
}
j0 = j0array[ij0]; cj0 = cj0array[ij0]; sj0 = sj0array[ij0];
{
IKReal evalcond[4];
IKReal x275=IKcos(j0);
IKReal x276=IKsin(j0);
IKReal x277=(py)*(py);
IKReal x278=(cj1)*(cj1);
IKReal x279=((cj1)*(py));
IKReal x280=((IKReal(0.0315000000000000))*(sj3));
IKReal x281=((cj1)*(px));
IKReal x282=((IKReal(0.00405000000000000))*(cj3));
IKReal x283=((IKReal(1.00000000000000))*(pp));
IKReal x284=((sj1)*(x276));
IKReal x285=((IKReal(1.10000000000000))*(x277));
IKReal x286=((sj1)*(x275));
IKReal x287=((IKReal(1.10000000000000))*(pz)*(x278));
IKReal x288=((IKReal(1.10000000000000))*(px)*(x286));
evalcond[0]=((IKReal(-0.550000000000000))+(((IKReal(-0.0450000000000000))*(sj3)))+(((IKReal(-0.350000000000000))*(cj3)))+(((cj1)*(pz)))+(((py)*(x284)))+(((px)*(x286))));
evalcond[1]=((((x284)*(x285)))+(((IKReal(1.10000000000000))*(pz)*(x279)))+(((IKReal(-1.00000000000000))*(py)*(x283)))+(((IKReal(-1.00000000000000))*(py)*(x282)))+(((IKReal(-0.175950000000000))*(py)))+(((py)*(x288)))+(((py)*(x280))));
evalcond[2]=((((cj1)*(x284)*(x285)))+(((x279)*(x280)))+(((x279)*(x288)))+(((IKReal(-0.175950000000000))*(x279)))+(((IKReal(-1.00000000000000))*(x279)*(x282)))+(((IKReal(-1.00000000000000))*(x279)*(x283)))+(((py)*(x287))));
evalcond[3]=((((IKReal(-0.175950000000000))*(x281)))+(((IKReal(-1.00000000000000))*(x281)*(x283)))+(((IKReal(-1.00000000000000))*(x281)*(x282)))+(((x280)*(x281)))+(((x281)*(x288)))+(((px)*(x287)))+(((IKReal(1.10000000000000))*(px)*(x279)*(x284))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  || IKabs(evalcond[3]) > 0.000001  )
{
continue;
}
}

{
IKReal dummyeval[1];
IKReal gconst0;
gconst0=IKsign(((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))));
dummyeval[0]=((IKReal(1.00000000000000))+(((IKReal(7.77777777777778))*(sj3)))+(((IKReal(-1.00000000000000))*(cj3))));
if( IKabs(dummyeval[0]) < 0.0000010000000000  )
{
{
IKReal evalcond[5];
IKReal x289=((cj0)*(px));
IKReal x290=((py)*(sj0));
IKReal x291=((IKReal(1.00000000000000))*(cj1));
evalcond[0]=((IKReal(-3.14159265358979))+(IKfmod(((IKReal(3.14159265358979))+(j3)), IKReal(6.28318530717959))));
evalcond[1]=((IKReal(0.810000000000000))+(((IKReal(-1.00000000000000))*(pp))));
evalcond[2]=((IKReal(-0.900000000000000))+(((sj1)*(x290)))+(((cj1)*(pz)))+(((sj1)*(x289))));
evalcond[3]=((((px)*(sj0)))+(((IKReal(-1.00000000000000))*(cj0)*(py))));
evalcond[4]=((((IKReal(-1.00000000000000))*(x290)*(x291)))+(((IKReal(-1.00000000000000))*(x289)*(x291)))+(((pz)*(sj1))));
if( IKabs(evalcond[0]) < 0.0000010000000000  && IKabs(evalcond[1]) < 0.0000010000000000  && IKabs(evalcond[2]) < 0.0000010000000000  && IKabs(evalcond[3]) < 0.0000010000000000  && IKabs(evalcond[4]) < 0.0000010000000000  )
{
{
IKReal dummyeval[1];
IKReal gconst1;
IKReal x292=(cj1)*(cj1);
IKReal x293=(px)*(px);
IKReal x294=(sj0)*(sj0);
IKReal x295=(cj0)*(cj0);
IKReal x296=(py)*(py);
IKReal x297=((py)*(sj0));
IKReal x298=((IKReal(0.0900000000000000))*(x294));
IKReal x299=((IKReal(0.180000000000000))*(cj0)*(px));
IKReal x300=((cj1)*(pz)*(sj1));
IKReal x301=((IKReal(0.0900000000000000))*(x295));
gconst1=IKsign(((((x292)*(x293)*(x301)))+(((IKReal(0.0900000000000000))*((pz)*(pz))*((sj1)*(sj1))))+(((x292)*(x297)*(x299)))+(((x292)*(x296)*(x298)))+(((IKReal(-1.00000000000000))*(x297)*(x299)))+(((IKReal(-1.00000000000000))*(x299)*(x300)))+(((x296)*(x301)))+(((IKReal(-0.180000000000000))*(x297)*(x300)))+(((x293)*(x298)))));
IKReal x302=(sj0)*(sj0);
IKReal x303=(py)*(py);
IKReal x304=(cj1)*(cj1);
IKReal x305=(cj0)*(cj0);
IKReal x306=(px)*(px);
IKReal x307=((cj0)*(px));
IKReal x308=((py)*(sj0));
IKReal x309=((IKReal(2.00000000000000))*(cj1)*(pz)*(sj1));
dummyeval[0]=((((x303)*(x305)))+(((IKReal(-1.00000000000000))*(x308)*(x309)))+(((IKReal(2.00000000000000))*(x304)*(x307)*(x308)))+((((pz)*(pz))*((sj1)*(sj1))))+(((x302)*(x306)))+(((x302)*(x303)*(x304)))+(((IKReal(-1.00000000000000))*(x307)*(x309)))+(((IKReal(-2.00000000000000))*(x307)*(x308)))+(((x304)*(x305)*(x306))));
if( IKabs(dummyeval[0]) < 0.0000010000000000  )
{
continue;

} else
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
IKReal x310=(sj1)*(sj1);
IKReal x311=(py)*(py);
IKReal x312=(sj0)*(sj0);
IKReal x313=(cj1)*(cj1);
IKReal x314=(cj0)*(cj0);
IKReal x315=(px)*(px);
IKReal x316=((IKReal(1.10000000000000))*(sj1));
IKReal x317=((px)*(py));
IKReal x318=((py)*(sj0));
IKReal x319=((cj1)*(pp));
IKReal x320=((px)*(sj0));
IKReal x321=((IKReal(1.00000000000000))*(pp));
IKReal x322=((cj0)*(py));
IKReal x323=((cj0)*(px));
IKReal x324=((cj0)*(sj0));
IKReal x325=((pz)*(sj1));
IKReal x326=((IKReal(1.10000000000000))*(pz));
IKReal x327=((IKReal(0.180000000000000))*(cj1));
IKReal x328=((x310)*(x326));
if( IKabs(((gconst1)*(((((IKReal(-0.180000000000000))*(x320)))+(((IKReal(0.180000000000000))*(x322)))+(((IKReal(-1.00000000000000))*(x320)*(x321)))+(((IKReal(-1.00000000000000))*(x314)*(x316)*(x317)))+(((x315)*(x316)*(x324)))+(((IKReal(-1.00000000000000))*(cj1)*(x322)*(x326)))+(((pp)*(x322)))+(((x312)*(x316)*(x317)))+(((cj1)*(x320)*(x326)))+(((IKReal(-1.00000000000000))*(x311)*(x316)*(x324))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((gconst1)*(((((x318)*(x327)))+(((x318)*(x328)))+(((IKReal(-1.00000000000000))*(x313)*(x323)*(x326)))+(((IKReal(-0.180000000000000))*(x325)))+(((x323)*(x328)))+(((x323)*(x327)))+(((IKReal(-1.00000000000000))*(x313)*(x318)*(x326)))+(((IKReal(-1.00000000000000))*(x321)*(x325)))+(((IKReal(-1.00000000000000))*(cj1)*(x314)*(x315)*(x316)))+(((cj1)*(x316)*((pz)*(pz))))+(((x318)*(x319)))+(((IKReal(-2.20000000000000))*(cj1)*(sj1)*(x317)*(x324)))+(((IKReal(-1.00000000000000))*(cj1)*(x311)*(x312)*(x316)))+(((x319)*(x323))))))) < IKFAST_ATAN2_MAGTHRESH )
    continue;
j2array[0]=IKatan2(((gconst1)*(((((IKReal(-0.180000000000000))*(x320)))+(((IKReal(0.180000000000000))*(x322)))+(((IKReal(-1.00000000000000))*(x320)*(x321)))+(((IKReal(-1.00000000000000))*(x314)*(x316)*(x317)))+(((x315)*(x316)*(x324)))+(((IKReal(-1.00000000000000))*(cj1)*(x322)*(x326)))+(((pp)*(x322)))+(((x312)*(x316)*(x317)))+(((cj1)*(x320)*(x326)))+(((IKReal(-1.00000000000000))*(x311)*(x316)*(x324)))))), ((gconst1)*(((((x318)*(x327)))+(((x318)*(x328)))+(((IKReal(-1.00000000000000))*(x313)*(x323)*(x326)))+(((IKReal(-0.180000000000000))*(x325)))+(((x323)*(x328)))+(((x323)*(x327)))+(((IKReal(-1.00000000000000))*(x313)*(x318)*(x326)))+(((IKReal(-1.00000000000000))*(x321)*(x325)))+(((IKReal(-1.00000000000000))*(cj1)*(x314)*(x315)*(x316)))+(((cj1)*(x316)*((pz)*(pz))))+(((x318)*(x319)))+(((IKReal(-2.20000000000000))*(cj1)*(sj1)*(x317)*(x324)))+(((IKReal(-1.00000000000000))*(cj1)*(x311)*(x312)*(x316)))+(((x319)*(x323)))))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[3];
IKReal x329=IKsin(j2);
IKReal x330=IKcos(j2);
IKReal x331=((px)*(sj0));
IKReal x332=((IKReal(1.10000000000000))*(sj1));
IKReal x333=((py)*(sj0));
IKReal x334=((pz)*(sj1));
IKReal x335=((cj0)*(px));
IKReal x336=((IKReal(0.0900000000000000))*(x330));
IKReal x337=((cj1)*(x329));
IKReal x338=((IKReal(1.00000000000000))*(x330));
IKReal x339=((cj0)*(py)*(x329));
evalcond[0]=((((x335)*(x337)))+(((IKReal(-1.00000000000000))*(cj0)*(py)*(x338)))+(((IKReal(-1.00000000000000))*(x329)*(x334)))+(((x330)*(x331)))+(((x333)*(x337))));
evalcond[1]=((((x330)*(x334)))+(((IKReal(-1.00000000000000))*(cj1)*(x335)*(x338)))+(((IKReal(-1.00000000000000))*(x339)))+(((x329)*(x331)))+(((IKReal(-1.00000000000000))*(cj1)*(x333)*(x338))));
evalcond[2]=((IKReal(-0.180000000000000))+(((IKReal(-0.0900000000000000))*(x329)*(x331)))+(((IKReal(0.0900000000000000))*(x339)))+(((cj1)*(x335)*(x336)))+(((x332)*(x333)))+(((x332)*(x335)))+(((IKReal(1.10000000000000))*(cj1)*(pz)))+(((IKReal(-1.00000000000000))*(pp)))+(((cj1)*(x333)*(x336)))+(((IKReal(-1.00000000000000))*(x334)*(x336))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

}

}

} else
{
IKReal x340=((cj0)*(px));
IKReal x341=((py)*(sj0));
IKReal x342=((IKReal(1.00000000000000))*(cj1));
evalcond[0]=((IKReal(-3.14159265358979))+(IKfmod(((IKReal(3.14159265358979))+(j3)), IKReal(6.28318530717959))));
evalcond[1]=((IKReal(0.810000000000000))+(((IKReal(-1.00000000000000))*(pp))));
evalcond[2]=((IKReal(-0.900000000000000))+(((cj1)*(pz)))+(((sj1)*(x341)))+(((sj1)*(x340))));
evalcond[3]=((((px)*(sj0)))+(((IKReal(-1.00000000000000))*(cj0)*(py))));
evalcond[4]=((((IKReal(-1.00000000000000))*(x340)*(x342)))+(((IKReal(-1.00000000000000))*(x341)*(x342)))+(((pz)*(sj1))));
if( IKabs(evalcond[0]) < 0.0000010000000000  && IKabs(evalcond[1]) < 0.0000010000000000  && IKabs(evalcond[2]) < 0.0000010000000000  && IKabs(evalcond[3]) < 0.0000010000000000  && IKabs(evalcond[4]) < 0.0000010000000000  )
{
{
IKReal dummyeval[1];
IKReal gconst2;
IKReal x343=(cj1)*(cj1);
IKReal x344=(px)*(px);
IKReal x345=(sj0)*(sj0);
IKReal x346=(cj0)*(cj0);
IKReal x347=(py)*(py);
IKReal x348=((py)*(sj0));
IKReal x349=((IKReal(0.0900000000000000))*(x345));
IKReal x350=((IKReal(0.180000000000000))*(cj0)*(px));
IKReal x351=((cj1)*(pz)*(sj1));
IKReal x352=((IKReal(0.0900000000000000))*(x346));
gconst2=IKsign(((((IKReal(0.0900000000000000))*((pz)*(pz))*((sj1)*(sj1))))+(((x343)*(x347)*(x349)))+(((IKReal(-0.180000000000000))*(x348)*(x351)))+(((IKReal(-1.00000000000000))*(x348)*(x350)))+(((x344)*(x349)))+(((x347)*(x352)))+(((x343)*(x344)*(x352)))+(((x343)*(x348)*(x350)))+(((IKReal(-1.00000000000000))*(x350)*(x351)))));
IKReal x353=(sj0)*(sj0);
IKReal x354=(py)*(py);
IKReal x355=(cj1)*(cj1);
IKReal x356=(cj0)*(cj0);
IKReal x357=(px)*(px);
IKReal x358=((cj0)*(px));
IKReal x359=((py)*(sj0));
IKReal x360=((IKReal(2.00000000000000))*(cj1)*(pz)*(sj1));
dummyeval[0]=((((x355)*(x356)*(x357)))+(((IKReal(2.00000000000000))*(x355)*(x358)*(x359)))+(((IKReal(-1.00000000000000))*(x358)*(x360)))+(((x353)*(x357)))+(((x354)*(x356)))+((((pz)*(pz))*((sj1)*(sj1))))+(((IKReal(-1.00000000000000))*(x359)*(x360)))+(((x353)*(x354)*(x355)))+(((IKReal(-2.00000000000000))*(x358)*(x359))));
if( IKabs(dummyeval[0]) < 0.0000010000000000  )
{
continue;

} else
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
IKReal x361=(sj1)*(sj1);
IKReal x362=(py)*(py);
IKReal x363=(sj0)*(sj0);
IKReal x364=(cj1)*(cj1);
IKReal x365=(cj0)*(cj0);
IKReal x366=(px)*(px);
IKReal x367=((IKReal(1.10000000000000))*(sj1));
IKReal x368=((px)*(py));
IKReal x369=((py)*(sj0));
IKReal x370=((cj1)*(pp));
IKReal x371=((px)*(sj0));
IKReal x372=((IKReal(1.00000000000000))*(pp));
IKReal x373=((cj0)*(sj0));
IKReal x374=((cj0)*(px));
IKReal x375=((cj0)*(py));
IKReal x376=((pz)*(sj1));
IKReal x377=((IKReal(0.180000000000000))*(cj1));
IKReal x378=((IKReal(1.10000000000000))*(pz));
IKReal x379=((x361)*(x378));
if( IKabs(((gconst2)*(((((IKReal(-0.180000000000000))*(x371)))+(((x366)*(x367)*(x373)))+(((IKReal(-1.00000000000000))*(x365)*(x367)*(x368)))+(((IKReal(-1.00000000000000))*(cj1)*(x375)*(x378)))+(((cj1)*(x371)*(x378)))+(((IKReal(-1.00000000000000))*(x371)*(x372)))+(((IKReal(-1.00000000000000))*(x362)*(x367)*(x373)))+(((IKReal(0.180000000000000))*(x375)))+(((pp)*(x375)))+(((x363)*(x367)*(x368))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((gconst2)*(((((IKReal(-2.20000000000000))*(cj1)*(sj1)*(x368)*(x373)))+(((IKReal(-0.180000000000000))*(x376)))+(((x370)*(x374)))+(((x369)*(x379)))+(((x369)*(x377)))+(((x369)*(x370)))+(((cj1)*(x367)*((pz)*(pz))))+(((IKReal(-1.00000000000000))*(x372)*(x376)))+(((IKReal(-1.00000000000000))*(cj1)*(x362)*(x363)*(x367)))+(((IKReal(-1.00000000000000))*(x364)*(x374)*(x378)))+(((x374)*(x379)))+(((x374)*(x377)))+(((IKReal(-1.00000000000000))*(x364)*(x369)*(x378)))+(((IKReal(-1.00000000000000))*(cj1)*(x365)*(x366)*(x367))))))) < IKFAST_ATAN2_MAGTHRESH )
    continue;
j2array[0]=IKatan2(((gconst2)*(((((IKReal(-0.180000000000000))*(x371)))+(((x366)*(x367)*(x373)))+(((IKReal(-1.00000000000000))*(x365)*(x367)*(x368)))+(((IKReal(-1.00000000000000))*(cj1)*(x375)*(x378)))+(((cj1)*(x371)*(x378)))+(((IKReal(-1.00000000000000))*(x371)*(x372)))+(((IKReal(-1.00000000000000))*(x362)*(x367)*(x373)))+(((IKReal(0.180000000000000))*(x375)))+(((pp)*(x375)))+(((x363)*(x367)*(x368)))))), ((gconst2)*(((((IKReal(-2.20000000000000))*(cj1)*(sj1)*(x368)*(x373)))+(((IKReal(-0.180000000000000))*(x376)))+(((x370)*(x374)))+(((x369)*(x379)))+(((x369)*(x377)))+(((x369)*(x370)))+(((cj1)*(x367)*((pz)*(pz))))+(((IKReal(-1.00000000000000))*(x372)*(x376)))+(((IKReal(-1.00000000000000))*(cj1)*(x362)*(x363)*(x367)))+(((IKReal(-1.00000000000000))*(x364)*(x374)*(x378)))+(((x374)*(x379)))+(((x374)*(x377)))+(((IKReal(-1.00000000000000))*(x364)*(x369)*(x378)))+(((IKReal(-1.00000000000000))*(cj1)*(x365)*(x366)*(x367)))))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[3];
IKReal x380=IKsin(j2);
IKReal x381=IKcos(j2);
IKReal x382=((px)*(sj0));
IKReal x383=((IKReal(1.10000000000000))*(sj1));
IKReal x384=((py)*(sj0));
IKReal x385=((pz)*(sj1));
IKReal x386=((cj0)*(px));
IKReal x387=((IKReal(0.0900000000000000))*(x381));
IKReal x388=((cj1)*(x380));
IKReal x389=((IKReal(1.00000000000000))*(x381));
IKReal x390=((cj0)*(py)*(x380));
evalcond[0]=((((x384)*(x388)))+(((IKReal(-1.00000000000000))*(cj0)*(py)*(x389)))+(((x386)*(x388)))+(((IKReal(-1.00000000000000))*(x380)*(x385)))+(((x381)*(x382))));
evalcond[1]=((((IKReal(-1.00000000000000))*(x390)))+(((IKReal(-1.00000000000000))*(cj1)*(x384)*(x389)))+(((x380)*(x382)))+(((x381)*(x385)))+(((IKReal(-1.00000000000000))*(cj1)*(x386)*(x389))));
evalcond[2]=((IKReal(-0.180000000000000))+(((cj1)*(x384)*(x387)))+(((x383)*(x384)))+(((x383)*(x386)))+(((IKReal(1.10000000000000))*(cj1)*(pz)))+(((IKReal(-1.00000000000000))*(pp)))+(((IKReal(-0.0900000000000000))*(x380)*(x382)))+(((IKReal(-1.00000000000000))*(x385)*(x387)))+(((IKReal(0.0900000000000000))*(x390)))+(((cj1)*(x386)*(x387))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

}

}

} else
{
evalcond[0]=((IKReal(-3.14159265358979))+(IKfmod(((IKReal(-0.255739837120000))+(j3)), IKReal(6.28318530717959))));
evalcond[1]=((IKReal(0.0400000003605000))+(((IKReal(-1.00000000000000))*(pp))));
evalcond[2]=((IKReal(-0.200000000250000))+(((cj1)*(pz)))+(((cj0)*(px)*(sj1)))+(((py)*(sj0)*(sj1))));
if( IKabs(evalcond[0]) < 0.0000010000000000  && IKabs(evalcond[1]) < 0.0000010000000000  && IKabs(evalcond[2]) < 0.0000010000000000  )
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
IKReal x391=((IKReal(1052631578.94737))*(py));
IKReal x392=((IKReal(1052631578.94737))*(px));
if( IKabs(((((IKReal(-1.00000000000000))*(sj0)*(x392)))+(((cj0)*(x391))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((IKReal(-1052631578.94737))*(pz)*(sj1)))+(((cj1)*(sj0)*(x391)))+(((cj0)*(cj1)*(x392))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((IKReal(-1.00000000000000))*(sj0)*(x392)))+(((cj0)*(x391)))))+IKsqr(((((IKReal(-1052631578.94737))*(pz)*(sj1)))+(((cj1)*(sj0)*(x391)))+(((cj0)*(cj1)*(x392)))))-1) <= IKFAST_SINCOS_THRESH )
    continue;
j2array[0]=IKatan2(((((IKReal(-1.00000000000000))*(sj0)*(x392)))+(((cj0)*(x391)))), ((((IKReal(-1052631578.94737))*(pz)*(sj1)))+(((cj1)*(sj0)*(x391)))+(((cj0)*(cj1)*(x392)))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[5];
IKReal x393=IKcos(j2);
IKReal x394=IKsin(j2);
IKReal x395=((px)*(sj0));
IKReal x396=((py)*(sj0));
IKReal x397=((IKReal(1.00000000000000))*(cj1));
IKReal x398=((IKReal(1.10000000000000))*(sj1));
IKReal x399=((pz)*(sj1));
IKReal x400=((cj0)*(px));
IKReal x401=((IKReal(0.0900000000000000))*(x394));
IKReal x402=((IKReal(1.00000000000000))*(cj0)*(py));
IKReal x403=((cj1)*(x394));
IKReal x404=((IKReal(0.0900000000000000))*(x393));
evalcond[0]=((x395)+(((IKReal(9.50000000000000e-10))*(x394)))+(((IKReal(-1.00000000000000))*(x402))));
evalcond[1]=((x399)+(((IKReal(9.50000000000000e-10))*(x393)))+(((IKReal(-1.00000000000000))*(x396)*(x397)))+(((IKReal(-1.00000000000000))*(x397)*(x400))));
evalcond[2]=((((IKReal(-1.00000000000000))*(x393)*(x402)))+(((IKReal(-1.00000000000000))*(x394)*(x399)))+(((x400)*(x403)))+(((x393)*(x395)))+(((x396)*(x403))));
evalcond[3]=((IKReal(9.50000000000000e-10))+(((x394)*(x395)))+(((IKReal(-1.00000000000000))*(x394)*(x402)))+(((IKReal(-1.00000000000000))*(x393)*(x396)*(x397)))+(((x393)*(x399)))+(((IKReal(-1.00000000000000))*(x393)*(x397)*(x400))));
evalcond[4]=((IKReal(-0.180000000000000))+(((cj0)*(py)*(x401)))+(((cj1)*(x400)*(x404)))+(((IKReal(-1.00000000000000))*(x395)*(x401)))+(((x396)*(x398)))+(((cj1)*(x396)*(x404)))+(((IKReal(1.10000000000000))*(cj1)*(pz)))+(((IKReal(-1.00000000000000))*(pp)))+(((IKReal(-1.00000000000000))*(x399)*(x404)))+(((x398)*(x400))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  || IKabs(evalcond[3]) > 0.000001  || IKabs(evalcond[4]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

} else
{
if( 1 )
{
continue;

} else
{
}
}
}
}
}

} else
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
if( IKabs(((gconst0)*(((((IKReal(-1.00000000000000))*(px)*(sj0)))+(((cj0)*(py))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((gconst0)*(((((cj1)*(py)*(sj0)))+(((IKReal(-1.00000000000000))*(pz)*(sj1)))+(((cj0)*(cj1)*(px))))))) < IKFAST_ATAN2_MAGTHRESH )
    continue;
j2array[0]=IKatan2(((gconst0)*(((((IKReal(-1.00000000000000))*(px)*(sj0)))+(((cj0)*(py)))))), ((gconst0)*(((((cj1)*(py)*(sj0)))+(((IKReal(-1.00000000000000))*(pz)*(sj1)))+(((cj0)*(cj1)*(px)))))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[5];
IKReal x405=IKsin(j2);
IKReal x406=IKcos(j2);
IKReal x407=((IKReal(0.0450000000000000))*(cj3));
IKReal x408=((px)*(sj0));
IKReal x409=((py)*(sj0));
IKReal x410=((IKReal(1.00000000000000))*(cj0));
IKReal x411=((IKReal(1.10000000000000))*(sj1));
IKReal x412=((IKReal(0.350000000000000))*(sj3));
IKReal x413=((pz)*(sj1));
IKReal x414=((IKReal(0.0900000000000000))*(cj0));
IKReal x415=((cj0)*(px));
IKReal x416=((cj1)*(x406));
IKReal x417=((py)*(x405));
IKReal x418=((cj1)*(x405));
evalcond[0]=((((IKReal(0.0450000000000000))*(x405)))+(((x405)*(x412)))+(x408)+(((IKReal(-1.00000000000000))*(x405)*(x407)))+(((IKReal(-1.00000000000000))*(py)*(x410))));
evalcond[1]=((((IKReal(0.0450000000000000))*(x406)))+(((IKReal(-1.00000000000000))*(x406)*(x407)))+(((IKReal(-1.00000000000000))*(cj1)*(px)*(x410)))+(((x406)*(x412)))+(((IKReal(-1.00000000000000))*(cj1)*(x409)))+(x413));
evalcond[2]=((((IKReal(-1.00000000000000))*(py)*(x406)*(x410)))+(((x415)*(x418)))+(((x409)*(x418)))+(((x406)*(x408)))+(((IKReal(-1.00000000000000))*(x405)*(x413))));
evalcond[3]=((IKReal(0.0450000000000000))+(((x405)*(x408)))+(((IKReal(-1.00000000000000))*(px)*(x410)*(x416)))+(((IKReal(-1.00000000000000))*(x409)*(x416)))+(((x406)*(x413)))+(x412)+(((IKReal(-1.00000000000000))*(x410)*(x417)))+(((IKReal(-1.00000000000000))*(x407))));
evalcond[4]=((IKReal(-0.180000000000000))+(((IKReal(-0.0900000000000000))*(x405)*(x408)))+(((x411)*(x415)))+(((IKReal(0.0900000000000000))*(x409)*(x416)))+(((px)*(x414)*(x416)))+(((x414)*(x417)))+(((x409)*(x411)))+(((IKReal(1.10000000000000))*(cj1)*(pz)))+(((IKReal(-1.00000000000000))*(pp)))+(((IKReal(-0.0900000000000000))*(x406)*(x413))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  || IKabs(evalcond[3]) > 0.000001  || IKabs(evalcond[4]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

}

}
}
}

}

}

} else
{
{
IKReal j0array[2], cj0array[2], sj0array[2];
bool j0valid[2]={false};
_nj0 = 2;
IKReal x419=(sj1)*(sj1);
if( IKabs(((px)*(sj1))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((py)*(sj1))) < IKFAST_ATAN2_MAGTHRESH )
    continue;
IKReal x420=((IKReal(1.00000000000000))*(IKatan2(((px)*(sj1)), ((py)*(sj1)))));
if( (((((x419)*((py)*(py))))+(((x419)*((px)*(px)))))) < (IKReal)-0.00001 )
    continue;
if( (((((IKabs(IKabs(IKsqrt(((((x419)*((py)*(py))))+(((x419)*((px)*(px)))))))) != 0)?((IKReal)1/(IKabs(IKsqrt(((((x419)*((py)*(py))))+(((x419)*((px)*(px))))))))):(IKReal)1.0e30))*(((IKReal(-0.550000000000000))+(((IKReal(-0.0450000000000000))*(sj3)))+(((IKReal(-0.350000000000000))*(cj3)))+(((cj1)*(pz))))))) < -1-IKFAST_SINCOS_THRESH || (((((IKabs(IKabs(IKsqrt(((((x419)*((py)*(py))))+(((x419)*((px)*(px)))))))) != 0)?((IKReal)1/(IKabs(IKsqrt(((((x419)*((py)*(py))))+(((x419)*((px)*(px))))))))):(IKReal)1.0e30))*(((IKReal(-0.550000000000000))+(((IKReal(-0.0450000000000000))*(sj3)))+(((IKReal(-0.350000000000000))*(cj3)))+(((cj1)*(pz))))))) > 1+IKFAST_SINCOS_THRESH )
    continue;
IKReal x421=IKasin(((((IKabs(IKabs(IKsqrt(((((x419)*((py)*(py))))+(((x419)*((px)*(px)))))))) != 0)?((IKReal)1/(IKabs(IKsqrt(((((x419)*((py)*(py))))+(((x419)*((px)*(px))))))))):(IKReal)1.0e30))*(((IKReal(-0.550000000000000))+(((IKReal(-0.0450000000000000))*(sj3)))+(((IKReal(-0.350000000000000))*(cj3)))+(((cj1)*(pz)))))));
j0array[0]=((((IKReal(-1.00000000000000))*(x421)))+(((IKReal(-1.00000000000000))*(x420))));
sj0array[0]=IKsin(j0array[0]);
cj0array[0]=IKcos(j0array[0]);
j0array[1]=((IKReal(3.14159265358979))+(((IKReal(-1.00000000000000))*(x420)))+(x421));
sj0array[1]=IKsin(j0array[1]);
cj0array[1]=IKcos(j0array[1]);
if( j0array[0] > IKPI )
{
    j0array[0]-=IK2PI;
}
else if( j0array[0] < -IKPI )
{    j0array[0]+=IK2PI;
}
j0valid[0] = true;
if( j0array[1] > IKPI )
{
    j0array[1]-=IK2PI;
}
else if( j0array[1] < -IKPI )
{    j0array[1]+=IK2PI;
}
j0valid[1] = true;
for(int ij0 = 0; ij0 < 2; ++ij0)
{
if( !j0valid[ij0] )
{
    continue;
}
_ij0[0] = ij0; _ij0[1] = -1;
for(int iij0 = ij0+1; iij0 < 2; ++iij0)
{
if( j0valid[iij0] && IKabs(cj0array[ij0]-cj0array[iij0]) < IKFAST_SOLUTION_THRESH && IKabs(sj0array[ij0]-sj0array[iij0]) < IKFAST_SOLUTION_THRESH )
{
    j0valid[iij0]=false; _ij0[1] = iij0; break; 
}
}
j0 = j0array[ij0]; cj0 = cj0array[ij0]; sj0 = sj0array[ij0];
{
IKReal evalcond[4];
IKReal x422=IKcos(j0);
IKReal x423=IKsin(j0);
IKReal x424=(py)*(py);
IKReal x425=(cj1)*(cj1);
IKReal x426=(px)*(px);
IKReal x427=((cj1)*(py));
IKReal x428=((IKReal(0.0315000000000000))*(sj3));
IKReal x429=((pp)*(px));
IKReal x430=((px)*(py));
IKReal x431=((IKReal(1.10000000000000))*(pz));
IKReal x432=((cj1)*(px));
IKReal x433=((IKReal(0.00405000000000000))*(cj3));
IKReal x434=((IKReal(1.00000000000000))*(pp));
IKReal x435=((px)*(x433));
IKReal x436=((IKReal(1.10000000000000))*(sj1)*(x422));
IKReal x437=((IKReal(1.10000000000000))*(sj1)*(x423));
evalcond[0]=((((IKReal(-1.00000000000000))*(x430)*(x437)))+(((IKReal(-1.00000000000000))*(px)*(x428)))+(((IKReal(-1.00000000000000))*(x431)*(x432)))+(((IKReal(0.175950000000000))*(px)))+(x429)+(x435)+(((IKReal(-1.00000000000000))*(x426)*(x436))));
evalcond[1]=((((x424)*(x437)))+(((py)*(x428)))+(((x430)*(x436)))+(((IKReal(-1.00000000000000))*(py)*(x433)))+(((IKReal(-1.00000000000000))*(py)*(x434)))+(((IKReal(-0.175950000000000))*(py)))+(((x427)*(x431))));
evalcond[2]=((((x427)*(x428)))+(((IKReal(-1.00000000000000))*(x427)*(x433)))+(((IKReal(-1.00000000000000))*(x427)*(x434)))+(((IKReal(-0.175950000000000))*(x427)))+(((px)*(x427)*(x436)))+(((cj1)*(x424)*(x437)))+(((py)*(x425)*(x431))));
evalcond[3]=((((x428)*(x432)))+(((IKReal(-0.175950000000000))*(x432)))+(((IKReal(-1.00000000000000))*(x432)*(x433)))+(((px)*(x427)*(x437)))+(((px)*(x425)*(x431)))+(((cj1)*(x426)*(x436)))+(((IKReal(-1.00000000000000))*(cj1)*(x429))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  || IKabs(evalcond[3]) > 0.000001  )
{
continue;
}
}

{
IKReal dummyeval[1];
IKReal gconst0;
gconst0=IKsign(((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))));
dummyeval[0]=((IKReal(1.00000000000000))+(((IKReal(7.77777777777778))*(sj3)))+(((IKReal(-1.00000000000000))*(cj3))));
if( IKabs(dummyeval[0]) < 0.0000010000000000  )
{
{
IKReal evalcond[5];
IKReal x438=((cj0)*(px));
IKReal x439=((py)*(sj0));
IKReal x440=((IKReal(1.00000000000000))*(cj1));
evalcond[0]=((IKReal(-3.14159265358979))+(IKfmod(((IKReal(3.14159265358979))+(j3)), IKReal(6.28318530717959))));
evalcond[1]=((IKReal(0.810000000000000))+(((IKReal(-1.00000000000000))*(pp))));
evalcond[2]=((IKReal(-0.900000000000000))+(((cj1)*(pz)))+(((sj1)*(x439)))+(((sj1)*(x438))));
evalcond[3]=((((px)*(sj0)))+(((IKReal(-1.00000000000000))*(cj0)*(py))));
evalcond[4]=((((IKReal(-1.00000000000000))*(x438)*(x440)))+(((IKReal(-1.00000000000000))*(x439)*(x440)))+(((pz)*(sj1))));
if( IKabs(evalcond[0]) < 0.0000010000000000  && IKabs(evalcond[1]) < 0.0000010000000000  && IKabs(evalcond[2]) < 0.0000010000000000  && IKabs(evalcond[3]) < 0.0000010000000000  && IKabs(evalcond[4]) < 0.0000010000000000  )
{
{
IKReal dummyeval[1];
IKReal gconst1;
IKReal x441=(cj1)*(cj1);
IKReal x442=(px)*(px);
IKReal x443=(sj0)*(sj0);
IKReal x444=(cj0)*(cj0);
IKReal x445=(py)*(py);
IKReal x446=((py)*(sj0));
IKReal x447=((IKReal(0.0900000000000000))*(x443));
IKReal x448=((IKReal(0.180000000000000))*(cj0)*(px));
IKReal x449=((cj1)*(pz)*(sj1));
IKReal x450=((IKReal(0.0900000000000000))*(x444));
gconst1=IKsign(((((IKReal(0.0900000000000000))*((pz)*(pz))*((sj1)*(sj1))))+(((x441)*(x442)*(x450)))+(((IKReal(-0.180000000000000))*(x446)*(x449)))+(((IKReal(-1.00000000000000))*(x448)*(x449)))+(((x441)*(x446)*(x448)))+(((x442)*(x447)))+(((x445)*(x450)))+(((x441)*(x445)*(x447)))+(((IKReal(-1.00000000000000))*(x446)*(x448)))));
IKReal x451=(sj0)*(sj0);
IKReal x452=(py)*(py);
IKReal x453=(cj1)*(cj1);
IKReal x454=(cj0)*(cj0);
IKReal x455=(px)*(px);
IKReal x456=((cj0)*(px));
IKReal x457=((py)*(sj0));
IKReal x458=((IKReal(2.00000000000000))*(cj1)*(pz)*(sj1));
dummyeval[0]=((((x451)*(x452)*(x453)))+(((x452)*(x454)))+(((IKReal(-1.00000000000000))*(x456)*(x458)))+(((IKReal(-2.00000000000000))*(x456)*(x457)))+(((x453)*(x454)*(x455)))+((((pz)*(pz))*((sj1)*(sj1))))+(((x451)*(x455)))+(((IKReal(-1.00000000000000))*(x457)*(x458)))+(((IKReal(2.00000000000000))*(x453)*(x456)*(x457))));
if( IKabs(dummyeval[0]) < 0.0000010000000000  )
{
continue;

} else
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
IKReal x459=(sj1)*(sj1);
IKReal x460=(py)*(py);
IKReal x461=(sj0)*(sj0);
IKReal x462=(cj1)*(cj1);
IKReal x463=(cj0)*(cj0);
IKReal x464=(px)*(px);
IKReal x465=((IKReal(1.10000000000000))*(sj1));
IKReal x466=((px)*(py));
IKReal x467=((py)*(sj0));
IKReal x468=((cj1)*(pp));
IKReal x469=((px)*(sj0));
IKReal x470=((IKReal(1.00000000000000))*(pp));
IKReal x471=((cj0)*(py));
IKReal x472=((cj0)*(px));
IKReal x473=((cj0)*(sj0));
IKReal x474=((pz)*(sj1));
IKReal x475=((IKReal(1.10000000000000))*(pz));
IKReal x476=((IKReal(0.180000000000000))*(cj1));
IKReal x477=((x459)*(x475));
if( IKabs(((gconst1)*(((((pp)*(x471)))+(((cj1)*(x469)*(x475)))+(((x464)*(x465)*(x473)))+(((x461)*(x465)*(x466)))+(((IKReal(-0.180000000000000))*(x469)))+(((IKReal(-1.00000000000000))*(x469)*(x470)))+(((IKReal(-1.00000000000000))*(x463)*(x465)*(x466)))+(((IKReal(-1.00000000000000))*(x460)*(x465)*(x473)))+(((IKReal(0.180000000000000))*(x471)))+(((IKReal(-1.00000000000000))*(cj1)*(x471)*(x475))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((gconst1)*(((((x472)*(x476)))+(((x472)*(x477)))+(((cj1)*(x465)*((pz)*(pz))))+(((IKReal(-1.00000000000000))*(x462)*(x467)*(x475)))+(((IKReal(-2.20000000000000))*(cj1)*(sj1)*(x466)*(x473)))+(((IKReal(-1.00000000000000))*(x462)*(x472)*(x475)))+(((IKReal(-1.00000000000000))*(cj1)*(x460)*(x461)*(x465)))+(((IKReal(-0.180000000000000))*(x474)))+(((x467)*(x477)))+(((x467)*(x476)))+(((x467)*(x468)))+(((IKReal(-1.00000000000000))*(x470)*(x474)))+(((IKReal(-1.00000000000000))*(cj1)*(x463)*(x464)*(x465)))+(((x468)*(x472))))))) < IKFAST_ATAN2_MAGTHRESH )
    continue;
j2array[0]=IKatan2(((gconst1)*(((((pp)*(x471)))+(((cj1)*(x469)*(x475)))+(((x464)*(x465)*(x473)))+(((x461)*(x465)*(x466)))+(((IKReal(-0.180000000000000))*(x469)))+(((IKReal(-1.00000000000000))*(x469)*(x470)))+(((IKReal(-1.00000000000000))*(x463)*(x465)*(x466)))+(((IKReal(-1.00000000000000))*(x460)*(x465)*(x473)))+(((IKReal(0.180000000000000))*(x471)))+(((IKReal(-1.00000000000000))*(cj1)*(x471)*(x475)))))), ((gconst1)*(((((x472)*(x476)))+(((x472)*(x477)))+(((cj1)*(x465)*((pz)*(pz))))+(((IKReal(-1.00000000000000))*(x462)*(x467)*(x475)))+(((IKReal(-2.20000000000000))*(cj1)*(sj1)*(x466)*(x473)))+(((IKReal(-1.00000000000000))*(x462)*(x472)*(x475)))+(((IKReal(-1.00000000000000))*(cj1)*(x460)*(x461)*(x465)))+(((IKReal(-0.180000000000000))*(x474)))+(((x467)*(x477)))+(((x467)*(x476)))+(((x467)*(x468)))+(((IKReal(-1.00000000000000))*(x470)*(x474)))+(((IKReal(-1.00000000000000))*(cj1)*(x463)*(x464)*(x465)))+(((x468)*(x472)))))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[3];
IKReal x478=IKsin(j2);
IKReal x479=IKcos(j2);
IKReal x480=((px)*(sj0));
IKReal x481=((IKReal(1.10000000000000))*(sj1));
IKReal x482=((py)*(sj0));
IKReal x483=((pz)*(sj1));
IKReal x484=((cj0)*(px));
IKReal x485=((IKReal(0.0900000000000000))*(x479));
IKReal x486=((cj1)*(x478));
IKReal x487=((IKReal(1.00000000000000))*(x479));
IKReal x488=((cj0)*(py)*(x478));
evalcond[0]=((((x484)*(x486)))+(((IKReal(-1.00000000000000))*(x478)*(x483)))+(((IKReal(-1.00000000000000))*(cj0)*(py)*(x487)))+(((x482)*(x486)))+(((x479)*(x480))));
evalcond[1]=((((IKReal(-1.00000000000000))*(x488)))+(((x478)*(x480)))+(((IKReal(-1.00000000000000))*(cj1)*(x484)*(x487)))+(((x479)*(x483)))+(((IKReal(-1.00000000000000))*(cj1)*(x482)*(x487))));
evalcond[2]=((IKReal(-0.180000000000000))+(((cj1)*(x482)*(x485)))+(((IKReal(-1.00000000000000))*(x483)*(x485)))+(((IKReal(0.0900000000000000))*(x488)))+(((IKReal(-0.0900000000000000))*(x478)*(x480)))+(((IKReal(1.10000000000000))*(cj1)*(pz)))+(((x481)*(x482)))+(((x481)*(x484)))+(((IKReal(-1.00000000000000))*(pp)))+(((cj1)*(x484)*(x485))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

}

}

} else
{
IKReal x489=((cj0)*(px));
IKReal x490=((py)*(sj0));
IKReal x491=((IKReal(1.00000000000000))*(cj1));
evalcond[0]=((IKReal(-3.14159265358979))+(IKfmod(((IKReal(3.14159265358979))+(j3)), IKReal(6.28318530717959))));
evalcond[1]=((IKReal(0.810000000000000))+(((IKReal(-1.00000000000000))*(pp))));
evalcond[2]=((IKReal(-0.900000000000000))+(((sj1)*(x489)))+(((cj1)*(pz)))+(((sj1)*(x490))));
evalcond[3]=((((px)*(sj0)))+(((IKReal(-1.00000000000000))*(cj0)*(py))));
evalcond[4]=((((IKReal(-1.00000000000000))*(x489)*(x491)))+(((IKReal(-1.00000000000000))*(x490)*(x491)))+(((pz)*(sj1))));
if( IKabs(evalcond[0]) < 0.0000010000000000  && IKabs(evalcond[1]) < 0.0000010000000000  && IKabs(evalcond[2]) < 0.0000010000000000  && IKabs(evalcond[3]) < 0.0000010000000000  && IKabs(evalcond[4]) < 0.0000010000000000  )
{
{
IKReal dummyeval[1];
IKReal gconst2;
IKReal x492=(cj1)*(cj1);
IKReal x493=(px)*(px);
IKReal x494=(sj0)*(sj0);
IKReal x495=(cj0)*(cj0);
IKReal x496=(py)*(py);
IKReal x497=((py)*(sj0));
IKReal x498=((IKReal(0.0900000000000000))*(x494));
IKReal x499=((IKReal(0.180000000000000))*(cj0)*(px));
IKReal x500=((cj1)*(pz)*(sj1));
IKReal x501=((IKReal(0.0900000000000000))*(x495));
gconst2=IKsign(((((IKReal(0.0900000000000000))*((pz)*(pz))*((sj1)*(sj1))))+(((IKReal(-1.00000000000000))*(x499)*(x500)))+(((x492)*(x497)*(x499)))+(((x493)*(x498)))+(((IKReal(-1.00000000000000))*(x497)*(x499)))+(((x492)*(x493)*(x501)))+(((x496)*(x501)))+(((IKReal(-0.180000000000000))*(x497)*(x500)))+(((x492)*(x496)*(x498)))));
IKReal x502=(sj0)*(sj0);
IKReal x503=(py)*(py);
IKReal x504=(cj1)*(cj1);
IKReal x505=(cj0)*(cj0);
IKReal x506=(px)*(px);
IKReal x507=((cj0)*(px));
IKReal x508=((py)*(sj0));
IKReal x509=((IKReal(2.00000000000000))*(cj1)*(pz)*(sj1));
dummyeval[0]=((((IKReal(-2.00000000000000))*(x507)*(x508)))+(((IKReal(-1.00000000000000))*(x508)*(x509)))+(((IKReal(-1.00000000000000))*(x507)*(x509)))+(((IKReal(2.00000000000000))*(x504)*(x507)*(x508)))+((((pz)*(pz))*((sj1)*(sj1))))+(((x503)*(x505)))+(((x502)*(x506)))+(((x502)*(x503)*(x504)))+(((x504)*(x505)*(x506))));
if( IKabs(dummyeval[0]) < 0.0000010000000000  )
{
continue;

} else
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
IKReal x510=(sj1)*(sj1);
IKReal x511=(py)*(py);
IKReal x512=(sj0)*(sj0);
IKReal x513=(cj1)*(cj1);
IKReal x514=(cj0)*(cj0);
IKReal x515=(px)*(px);
IKReal x516=((IKReal(1.10000000000000))*(sj1));
IKReal x517=((px)*(py));
IKReal x518=((py)*(sj0));
IKReal x519=((cj1)*(pp));
IKReal x520=((px)*(sj0));
IKReal x521=((IKReal(1.00000000000000))*(pp));
IKReal x522=((cj0)*(sj0));
IKReal x523=((cj0)*(px));
IKReal x524=((cj0)*(py));
IKReal x525=((pz)*(sj1));
IKReal x526=((IKReal(0.180000000000000))*(cj1));
IKReal x527=((IKReal(1.10000000000000))*(pz));
IKReal x528=((x510)*(x527));
if( IKabs(((gconst2)*(((((pp)*(x524)))+(((IKReal(-1.00000000000000))*(x514)*(x516)*(x517)))+(((IKReal(-1.00000000000000))*(x520)*(x521)))+(((IKReal(0.180000000000000))*(x524)))+(((x512)*(x516)*(x517)))+(((IKReal(-1.00000000000000))*(cj1)*(x524)*(x527)))+(((IKReal(-1.00000000000000))*(x511)*(x516)*(x522)))+(((cj1)*(x520)*(x527)))+(((IKReal(-0.180000000000000))*(x520)))+(((x515)*(x516)*(x522))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((gconst2)*(((((IKReal(-2.20000000000000))*(cj1)*(sj1)*(x517)*(x522)))+(((x519)*(x523)))+(((IKReal(-1.00000000000000))*(x521)*(x525)))+(((x518)*(x528)))+(((x518)*(x526)))+(((x518)*(x519)))+(((x523)*(x528)))+(((x523)*(x526)))+(((cj1)*(x516)*((pz)*(pz))))+(((IKReal(-1.00000000000000))*(x513)*(x523)*(x527)))+(((IKReal(-1.00000000000000))*(cj1)*(x514)*(x515)*(x516)))+(((IKReal(-1.00000000000000))*(cj1)*(x511)*(x512)*(x516)))+(((IKReal(-0.180000000000000))*(x525)))+(((IKReal(-1.00000000000000))*(x513)*(x518)*(x527))))))) < IKFAST_ATAN2_MAGTHRESH )
    continue;
j2array[0]=IKatan2(((gconst2)*(((((pp)*(x524)))+(((IKReal(-1.00000000000000))*(x514)*(x516)*(x517)))+(((IKReal(-1.00000000000000))*(x520)*(x521)))+(((IKReal(0.180000000000000))*(x524)))+(((x512)*(x516)*(x517)))+(((IKReal(-1.00000000000000))*(cj1)*(x524)*(x527)))+(((IKReal(-1.00000000000000))*(x511)*(x516)*(x522)))+(((cj1)*(x520)*(x527)))+(((IKReal(-0.180000000000000))*(x520)))+(((x515)*(x516)*(x522)))))), ((gconst2)*(((((IKReal(-2.20000000000000))*(cj1)*(sj1)*(x517)*(x522)))+(((x519)*(x523)))+(((IKReal(-1.00000000000000))*(x521)*(x525)))+(((x518)*(x528)))+(((x518)*(x526)))+(((x518)*(x519)))+(((x523)*(x528)))+(((x523)*(x526)))+(((cj1)*(x516)*((pz)*(pz))))+(((IKReal(-1.00000000000000))*(x513)*(x523)*(x527)))+(((IKReal(-1.00000000000000))*(cj1)*(x514)*(x515)*(x516)))+(((IKReal(-1.00000000000000))*(cj1)*(x511)*(x512)*(x516)))+(((IKReal(-0.180000000000000))*(x525)))+(((IKReal(-1.00000000000000))*(x513)*(x518)*(x527)))))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[3];
IKReal x529=IKsin(j2);
IKReal x530=IKcos(j2);
IKReal x531=((px)*(sj0));
IKReal x532=((IKReal(1.10000000000000))*(sj1));
IKReal x533=((py)*(sj0));
IKReal x534=((pz)*(sj1));
IKReal x535=((cj0)*(px));
IKReal x536=((IKReal(0.0900000000000000))*(x530));
IKReal x537=((cj1)*(x529));
IKReal x538=((IKReal(1.00000000000000))*(x530));
IKReal x539=((cj0)*(py)*(x529));
evalcond[0]=((((IKReal(-1.00000000000000))*(x529)*(x534)))+(((IKReal(-1.00000000000000))*(cj0)*(py)*(x538)))+(((x535)*(x537)))+(((x530)*(x531)))+(((x533)*(x537))));
evalcond[1]=((((IKReal(-1.00000000000000))*(x539)))+(((IKReal(-1.00000000000000))*(cj1)*(x535)*(x538)))+(((IKReal(-1.00000000000000))*(cj1)*(x533)*(x538)))+(((x530)*(x534)))+(((x529)*(x531))));
evalcond[2]=((IKReal(-0.180000000000000))+(((IKReal(-1.00000000000000))*(x534)*(x536)))+(((IKReal(0.0900000000000000))*(x539)))+(((IKReal(1.10000000000000))*(cj1)*(pz)))+(((IKReal(-1.00000000000000))*(pp)))+(((cj1)*(x535)*(x536)))+(((x532)*(x535)))+(((x532)*(x533)))+(((cj1)*(x533)*(x536)))+(((IKReal(-0.0900000000000000))*(x529)*(x531))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

}

}

} else
{
evalcond[0]=((IKReal(-3.14159265358979))+(IKfmod(((IKReal(-0.255739837120000))+(j3)), IKReal(6.28318530717959))));
evalcond[1]=((IKReal(0.0400000003605000))+(((IKReal(-1.00000000000000))*(pp))));
evalcond[2]=((IKReal(-0.200000000250000))+(((cj1)*(pz)))+(((cj0)*(px)*(sj1)))+(((py)*(sj0)*(sj1))));
if( IKabs(evalcond[0]) < 0.0000010000000000  && IKabs(evalcond[1]) < 0.0000010000000000  && IKabs(evalcond[2]) < 0.0000010000000000  )
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
IKReal x540=((IKReal(1052631578.94737))*(py));
IKReal x541=((IKReal(1052631578.94737))*(px));
if( IKabs(((((IKReal(-1.00000000000000))*(sj0)*(x541)))+(((cj0)*(x540))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((IKReal(-1052631578.94737))*(pz)*(sj1)))+(((cj1)*(sj0)*(x540)))+(((cj0)*(cj1)*(x541))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((IKReal(-1.00000000000000))*(sj0)*(x541)))+(((cj0)*(x540)))))+IKsqr(((((IKReal(-1052631578.94737))*(pz)*(sj1)))+(((cj1)*(sj0)*(x540)))+(((cj0)*(cj1)*(x541)))))-1) <= IKFAST_SINCOS_THRESH )
    continue;
j2array[0]=IKatan2(((((IKReal(-1.00000000000000))*(sj0)*(x541)))+(((cj0)*(x540)))), ((((IKReal(-1052631578.94737))*(pz)*(sj1)))+(((cj1)*(sj0)*(x540)))+(((cj0)*(cj1)*(x541)))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[5];
IKReal x542=IKcos(j2);
IKReal x543=IKsin(j2);
IKReal x544=((px)*(sj0));
IKReal x545=((py)*(sj0));
IKReal x546=((IKReal(1.00000000000000))*(cj1));
IKReal x547=((IKReal(1.10000000000000))*(sj1));
IKReal x548=((pz)*(sj1));
IKReal x549=((cj0)*(px));
IKReal x550=((IKReal(0.0900000000000000))*(x543));
IKReal x551=((IKReal(1.00000000000000))*(cj0)*(py));
IKReal x552=((cj1)*(x543));
IKReal x553=((IKReal(0.0900000000000000))*(x542));
evalcond[0]=((((IKReal(9.50000000000000e-10))*(x543)))+(((IKReal(-1.00000000000000))*(x551)))+(x544));
evalcond[1]=((((IKReal(-1.00000000000000))*(x545)*(x546)))+(((IKReal(9.50000000000000e-10))*(x542)))+(x548)+(((IKReal(-1.00000000000000))*(x546)*(x549))));
evalcond[2]=((((x542)*(x544)))+(((x549)*(x552)))+(((IKReal(-1.00000000000000))*(x543)*(x548)))+(((x545)*(x552)))+(((IKReal(-1.00000000000000))*(x542)*(x551))));
evalcond[3]=((IKReal(9.50000000000000e-10))+(((x542)*(x548)))+(((IKReal(-1.00000000000000))*(x542)*(x546)*(x549)))+(((x543)*(x544)))+(((IKReal(-1.00000000000000))*(x542)*(x545)*(x546)))+(((IKReal(-1.00000000000000))*(x543)*(x551))));
evalcond[4]=((IKReal(-0.180000000000000))+(((cj1)*(x545)*(x553)))+(((x547)*(x549)))+(((IKReal(-1.00000000000000))*(x544)*(x550)))+(((cj0)*(py)*(x550)))+(((cj1)*(x549)*(x553)))+(((IKReal(-1.00000000000000))*(x548)*(x553)))+(((IKReal(1.10000000000000))*(cj1)*(pz)))+(((IKReal(-1.00000000000000))*(pp)))+(((x545)*(x547))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  || IKabs(evalcond[3]) > 0.000001  || IKabs(evalcond[4]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

} else
{
if( 1 )
{
continue;

} else
{
}
}
}
}
}

} else
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
if( IKabs(((gconst0)*(((((IKReal(-1.00000000000000))*(px)*(sj0)))+(((cj0)*(py))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((gconst0)*(((((cj1)*(py)*(sj0)))+(((IKReal(-1.00000000000000))*(pz)*(sj1)))+(((cj0)*(cj1)*(px))))))) < IKFAST_ATAN2_MAGTHRESH )
    continue;
j2array[0]=IKatan2(((gconst0)*(((((IKReal(-1.00000000000000))*(px)*(sj0)))+(((cj0)*(py)))))), ((gconst0)*(((((cj1)*(py)*(sj0)))+(((IKReal(-1.00000000000000))*(pz)*(sj1)))+(((cj0)*(cj1)*(px)))))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[5];
IKReal x554=IKsin(j2);
IKReal x555=IKcos(j2);
IKReal x556=((IKReal(0.0450000000000000))*(cj3));
IKReal x557=((px)*(sj0));
IKReal x558=((py)*(sj0));
IKReal x559=((IKReal(1.00000000000000))*(cj0));
IKReal x560=((IKReal(1.10000000000000))*(sj1));
IKReal x561=((IKReal(0.350000000000000))*(sj3));
IKReal x562=((pz)*(sj1));
IKReal x563=((IKReal(0.0900000000000000))*(cj0));
IKReal x564=((cj0)*(px));
IKReal x565=((cj1)*(x555));
IKReal x566=((py)*(x554));
IKReal x567=((cj1)*(x554));
evalcond[0]=((((IKReal(0.0450000000000000))*(x554)))+(((IKReal(-1.00000000000000))*(x554)*(x556)))+(x557)+(((IKReal(-1.00000000000000))*(py)*(x559)))+(((x554)*(x561))));
evalcond[1]=((((IKReal(-1.00000000000000))*(x555)*(x556)))+(((IKReal(0.0450000000000000))*(x555)))+(((IKReal(-1.00000000000000))*(cj1)*(px)*(x559)))+(x562)+(((IKReal(-1.00000000000000))*(cj1)*(x558)))+(((x555)*(x561))));
evalcond[2]=((((x558)*(x567)))+(((x564)*(x567)))+(((x555)*(x557)))+(((IKReal(-1.00000000000000))*(x554)*(x562)))+(((IKReal(-1.00000000000000))*(py)*(x555)*(x559))));
evalcond[3]=((IKReal(0.0450000000000000))+(((IKReal(-1.00000000000000))*(x558)*(x565)))+(((IKReal(-1.00000000000000))*(px)*(x559)*(x565)))+(((x554)*(x557)))+(((IKReal(-1.00000000000000))*(x556)))+(((IKReal(-1.00000000000000))*(x559)*(x566)))+(x561)+(((x555)*(x562))));
evalcond[4]=((IKReal(-0.180000000000000))+(((IKReal(0.0900000000000000))*(x558)*(x565)))+(((x558)*(x560)))+(((IKReal(-0.0900000000000000))*(x554)*(x557)))+(((x563)*(x566)))+(((IKReal(1.10000000000000))*(cj1)*(pz)))+(((x560)*(x564)))+(((IKReal(-1.00000000000000))*(pp)))+(((px)*(x563)*(x565)))+(((IKReal(-0.0900000000000000))*(x555)*(x562))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  || IKabs(evalcond[3]) > 0.000001  || IKabs(evalcond[4]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

}

}
}
}

}

}

} else
{
{
IKReal j0array[2], cj0array[2], sj0array[2];
bool j0valid[2]={false};
_nj0 = 2;
IKReal x568=(sj1)*(sj1);
if( IKabs(((px)*(sj1))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((py)*(sj1))) < IKFAST_ATAN2_MAGTHRESH )
    continue;
IKReal x569=((IKReal(1.00000000000000))*(IKatan2(((px)*(sj1)), ((py)*(sj1)))));
if( (((((x568)*((px)*(px))))+(((x568)*((py)*(py)))))) < (IKReal)-0.00001 )
    continue;
if( (((((IKabs(IKabs(IKsqrt(((((x568)*((px)*(px))))+(((x568)*((py)*(py)))))))) != 0)?((IKReal)1/(IKabs(IKsqrt(((((x568)*((px)*(px))))+(((x568)*((py)*(py))))))))):(IKReal)1.0e30))*(((IKReal(-0.550000000000000))+(((IKReal(-0.0450000000000000))*(sj3)))+(((IKReal(-0.350000000000000))*(cj3)))+(((cj1)*(pz))))))) < -1-IKFAST_SINCOS_THRESH || (((((IKabs(IKabs(IKsqrt(((((x568)*((px)*(px))))+(((x568)*((py)*(py)))))))) != 0)?((IKReal)1/(IKabs(IKsqrt(((((x568)*((px)*(px))))+(((x568)*((py)*(py))))))))):(IKReal)1.0e30))*(((IKReal(-0.550000000000000))+(((IKReal(-0.0450000000000000))*(sj3)))+(((IKReal(-0.350000000000000))*(cj3)))+(((cj1)*(pz))))))) > 1+IKFAST_SINCOS_THRESH )
    continue;
IKReal x570=IKasin(((((IKabs(IKabs(IKsqrt(((((x568)*((px)*(px))))+(((x568)*((py)*(py)))))))) != 0)?((IKReal)1/(IKabs(IKsqrt(((((x568)*((px)*(px))))+(((x568)*((py)*(py))))))))):(IKReal)1.0e30))*(((IKReal(-0.550000000000000))+(((IKReal(-0.0450000000000000))*(sj3)))+(((IKReal(-0.350000000000000))*(cj3)))+(((cj1)*(pz)))))));
j0array[0]=((((IKReal(-1.00000000000000))*(x570)))+(((IKReal(-1.00000000000000))*(x569))));
sj0array[0]=IKsin(j0array[0]);
cj0array[0]=IKcos(j0array[0]);
j0array[1]=((IKReal(3.14159265358979))+(x570)+(((IKReal(-1.00000000000000))*(x569))));
sj0array[1]=IKsin(j0array[1]);
cj0array[1]=IKcos(j0array[1]);
if( j0array[0] > IKPI )
{
    j0array[0]-=IK2PI;
}
else if( j0array[0] < -IKPI )
{    j0array[0]+=IK2PI;
}
j0valid[0] = true;
if( j0array[1] > IKPI )
{
    j0array[1]-=IK2PI;
}
else if( j0array[1] < -IKPI )
{    j0array[1]+=IK2PI;
}
j0valid[1] = true;
for(int ij0 = 0; ij0 < 2; ++ij0)
{
if( !j0valid[ij0] )
{
    continue;
}
_ij0[0] = ij0; _ij0[1] = -1;
for(int iij0 = ij0+1; iij0 < 2; ++iij0)
{
if( j0valid[iij0] && IKabs(cj0array[ij0]-cj0array[iij0]) < IKFAST_SOLUTION_THRESH && IKabs(sj0array[ij0]-sj0array[iij0]) < IKFAST_SOLUTION_THRESH )
{
    j0valid[iij0]=false; _ij0[1] = iij0; break; 
}
}
j0 = j0array[ij0]; cj0 = cj0array[ij0]; sj0 = sj0array[ij0];

{
IKReal dummyeval[1];
IKReal gconst0;
gconst0=IKsign(((IKReal(0.0450000000000000))+(((IKReal(0.350000000000000))*(sj3)))+(((IKReal(-0.0450000000000000))*(cj3)))));
dummyeval[0]=((IKReal(1.00000000000000))+(((IKReal(7.77777777777778))*(sj3)))+(((IKReal(-1.00000000000000))*(cj3))));
if( IKabs(dummyeval[0]) < 0.0000010000000000  )
{
{
IKReal evalcond[5];
IKReal x571=((cj0)*(px));
IKReal x572=((py)*(sj0));
IKReal x573=((IKReal(1.00000000000000))*(cj1));
evalcond[0]=((IKReal(-3.14159265358979))+(IKfmod(((IKReal(3.14159265358979))+(j3)), IKReal(6.28318530717959))));
evalcond[1]=((IKReal(0.810000000000000))+(((IKReal(-1.00000000000000))*(pp))));
evalcond[2]=((IKReal(-0.900000000000000))+(((sj1)*(x572)))+(((sj1)*(x571)))+(((cj1)*(pz))));
evalcond[3]=((((px)*(sj0)))+(((IKReal(-1.00000000000000))*(cj0)*(py))));
evalcond[4]=((((IKReal(-1.00000000000000))*(x571)*(x573)))+(((pz)*(sj1)))+(((IKReal(-1.00000000000000))*(x572)*(x573))));
if( IKabs(evalcond[0]) < 0.0000010000000000  && IKabs(evalcond[1]) < 0.0000010000000000  && IKabs(evalcond[2]) < 0.0000010000000000  && IKabs(evalcond[3]) < 0.0000010000000000  && IKabs(evalcond[4]) < 0.0000010000000000  )
{
{
IKReal dummyeval[1];
IKReal gconst1;
IKReal x574=(cj1)*(cj1);
IKReal x575=(px)*(px);
IKReal x576=(sj0)*(sj0);
IKReal x577=(cj0)*(cj0);
IKReal x578=(py)*(py);
IKReal x579=((py)*(sj0));
IKReal x580=((IKReal(0.0900000000000000))*(x576));
IKReal x581=((IKReal(0.180000000000000))*(cj0)*(px));
IKReal x582=((cj1)*(pz)*(sj1));
IKReal x583=((IKReal(0.0900000000000000))*(x577));
gconst1=IKsign(((((IKReal(0.0900000000000000))*((pz)*(pz))*((sj1)*(sj1))))+(((x578)*(x583)))+(((x574)*(x575)*(x583)))+(((IKReal(-0.180000000000000))*(x579)*(x582)))+(((IKReal(-1.00000000000000))*(x579)*(x581)))+(((x574)*(x579)*(x581)))+(((x574)*(x578)*(x580)))+(((x575)*(x580)))+(((IKReal(-1.00000000000000))*(x581)*(x582)))));
IKReal x584=(sj0)*(sj0);
IKReal x585=(py)*(py);
IKReal x586=(cj1)*(cj1);
IKReal x587=(cj0)*(cj0);
IKReal x588=(px)*(px);
IKReal x589=((cj0)*(px));
IKReal x590=((py)*(sj0));
IKReal x591=((IKReal(2.00000000000000))*(cj1)*(pz)*(sj1));
dummyeval[0]=((((x584)*(x588)))+(((x586)*(x587)*(x588)))+(((IKReal(2.00000000000000))*(x586)*(x589)*(x590)))+(((IKReal(-1.00000000000000))*(x589)*(x591)))+(((IKReal(-1.00000000000000))*(x590)*(x591)))+(((x585)*(x587)))+(((x584)*(x585)*(x586)))+((((pz)*(pz))*((sj1)*(sj1))))+(((IKReal(-2.00000000000000))*(x589)*(x590))));
if( IKabs(dummyeval[0]) < 0.0000010000000000  )
{
continue;

} else
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
IKReal x592=(sj1)*(sj1);
IKReal x593=(py)*(py);
IKReal x594=(sj0)*(sj0);
IKReal x595=(cj1)*(cj1);
IKReal x596=(cj0)*(cj0);
IKReal x597=(px)*(px);
IKReal x598=((IKReal(1.10000000000000))*(sj1));
IKReal x599=((px)*(py));
IKReal x600=((py)*(sj0));
IKReal x601=((cj1)*(pp));
IKReal x602=((px)*(sj0));
IKReal x603=((IKReal(1.00000000000000))*(pp));
IKReal x604=((cj0)*(py));
IKReal x605=((cj0)*(px));
IKReal x606=((cj0)*(sj0));
IKReal x607=((pz)*(sj1));
IKReal x608=((IKReal(1.10000000000000))*(pz));
IKReal x609=((IKReal(0.180000000000000))*(cj1));
IKReal x610=((x592)*(x608));
if( IKabs(((gconst1)*(((((pp)*(x604)))+(((IKReal(-1.00000000000000))*(x602)*(x603)))+(((IKReal(-1.00000000000000))*(cj1)*(x604)*(x608)))+(((IKReal(-0.180000000000000))*(x602)))+(((cj1)*(x602)*(x608)))+(((x594)*(x598)*(x599)))+(((IKReal(-1.00000000000000))*(x596)*(x598)*(x599)))+(((IKReal(0.180000000000000))*(x604)))+(((IKReal(-1.00000000000000))*(x593)*(x598)*(x606)))+(((x597)*(x598)*(x606))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((gconst1)*(((((x605)*(x609)))+(((cj1)*(x598)*((pz)*(pz))))+(((IKReal(-1.00000000000000))*(x603)*(x607)))+(((x600)*(x610)))+(((x601)*(x605)))+(((x605)*(x610)))+(((IKReal(-0.180000000000000))*(x607)))+(((IKReal(-1.00000000000000))*(cj1)*(x596)*(x597)*(x598)))+(((x600)*(x609)))+(((x600)*(x601)))+(((IKReal(-1.00000000000000))*(cj1)*(x593)*(x594)*(x598)))+(((IKReal(-1.00000000000000))*(x595)*(x605)*(x608)))+(((IKReal(-1.00000000000000))*(x595)*(x600)*(x608)))+(((IKReal(-2.20000000000000))*(cj1)*(sj1)*(x599)*(x606))))))) < IKFAST_ATAN2_MAGTHRESH )
    continue;
j2array[0]=IKatan2(((gconst1)*(((((pp)*(x604)))+(((IKReal(-1.00000000000000))*(x602)*(x603)))+(((IKReal(-1.00000000000000))*(cj1)*(x604)*(x608)))+(((IKReal(-0.180000000000000))*(x602)))+(((cj1)*(x602)*(x608)))+(((x594)*(x598)*(x599)))+(((IKReal(-1.00000000000000))*(x596)*(x598)*(x599)))+(((IKReal(0.180000000000000))*(x604)))+(((IKReal(-1.00000000000000))*(x593)*(x598)*(x606)))+(((x597)*(x598)*(x606)))))), ((gconst1)*(((((x605)*(x609)))+(((cj1)*(x598)*((pz)*(pz))))+(((IKReal(-1.00000000000000))*(x603)*(x607)))+(((x600)*(x610)))+(((x601)*(x605)))+(((x605)*(x610)))+(((IKReal(-0.180000000000000))*(x607)))+(((IKReal(-1.00000000000000))*(cj1)*(x596)*(x597)*(x598)))+(((x600)*(x609)))+(((x600)*(x601)))+(((IKReal(-1.00000000000000))*(cj1)*(x593)*(x594)*(x598)))+(((IKReal(-1.00000000000000))*(x595)*(x605)*(x608)))+(((IKReal(-1.00000000000000))*(x595)*(x600)*(x608)))+(((IKReal(-2.20000000000000))*(cj1)*(sj1)*(x599)*(x606)))))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[3];
IKReal x611=IKsin(j2);
IKReal x612=IKcos(j2);
IKReal x613=((px)*(sj0));
IKReal x614=((IKReal(1.10000000000000))*(sj1));
IKReal x615=((py)*(sj0));
IKReal x616=((pz)*(sj1));
IKReal x617=((cj0)*(px));
IKReal x618=((IKReal(0.0900000000000000))*(x612));
IKReal x619=((cj1)*(x611));
IKReal x620=((IKReal(1.00000000000000))*(x612));
IKReal x621=((cj0)*(py)*(x611));
evalcond[0]=((((IKReal(-1.00000000000000))*(x611)*(x616)))+(((IKReal(-1.00000000000000))*(cj0)*(py)*(x620)))+(((x612)*(x613)))+(((x617)*(x619)))+(((x615)*(x619))));
evalcond[1]=((((IKReal(-1.00000000000000))*(cj1)*(x615)*(x620)))+(((x611)*(x613)))+(((IKReal(-1.00000000000000))*(cj1)*(x617)*(x620)))+(((x612)*(x616)))+(((IKReal(-1.00000000000000))*(x621))));
evalcond[2]=((IKReal(-0.180000000000000))+(((IKReal(-0.0900000000000000))*(x611)*(x613)))+(((IKReal(1.10000000000000))*(cj1)*(pz)))+(((IKReal(-1.00000000000000))*(pp)))+(((IKReal(0.0900000000000000))*(x621)))+(((x614)*(x615)))+(((x614)*(x617)))+(((cj1)*(x615)*(x618)))+(((cj1)*(x617)*(x618)))+(((IKReal(-1.00000000000000))*(x616)*(x618))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

}

}

} else
{
IKReal x622=((cj0)*(px));
IKReal x623=((py)*(sj0));
IKReal x624=((IKReal(1.00000000000000))*(cj1));
evalcond[0]=((IKReal(-3.14159265358979))+(IKfmod(((IKReal(3.14159265358979))+(j3)), IKReal(6.28318530717959))));
evalcond[1]=((IKReal(0.810000000000000))+(((IKReal(-1.00000000000000))*(pp))));
evalcond[2]=((IKReal(-0.900000000000000))+(((cj1)*(pz)))+(((sj1)*(x622)))+(((sj1)*(x623))));
evalcond[3]=((((px)*(sj0)))+(((IKReal(-1.00000000000000))*(cj0)*(py))));
evalcond[4]=((((IKReal(-1.00000000000000))*(x623)*(x624)))+(((IKReal(-1.00000000000000))*(x622)*(x624)))+(((pz)*(sj1))));
if( IKabs(evalcond[0]) < 0.0000010000000000  && IKabs(evalcond[1]) < 0.0000010000000000  && IKabs(evalcond[2]) < 0.0000010000000000  && IKabs(evalcond[3]) < 0.0000010000000000  && IKabs(evalcond[4]) < 0.0000010000000000  )
{
{
IKReal dummyeval[1];
IKReal gconst2;
IKReal x625=(cj1)*(cj1);
IKReal x626=(px)*(px);
IKReal x627=(sj0)*(sj0);
IKReal x628=(cj0)*(cj0);
IKReal x629=(py)*(py);
IKReal x630=((py)*(sj0));
IKReal x631=((IKReal(0.0900000000000000))*(x627));
IKReal x632=((IKReal(0.180000000000000))*(cj0)*(px));
IKReal x633=((cj1)*(pz)*(sj1));
IKReal x634=((IKReal(0.0900000000000000))*(x628));
gconst2=IKsign(((((IKReal(0.0900000000000000))*((pz)*(pz))*((sj1)*(sj1))))+(((IKReal(-1.00000000000000))*(x630)*(x632)))+(((x625)*(x630)*(x632)))+(((x629)*(x634)))+(((IKReal(-0.180000000000000))*(x630)*(x633)))+(((x625)*(x626)*(x634)))+(((x625)*(x629)*(x631)))+(((x626)*(x631)))+(((IKReal(-1.00000000000000))*(x632)*(x633)))));
IKReal x635=(sj0)*(sj0);
IKReal x636=(py)*(py);
IKReal x637=(cj1)*(cj1);
IKReal x638=(cj0)*(cj0);
IKReal x639=(px)*(px);
IKReal x640=((cj0)*(px));
IKReal x641=((py)*(sj0));
IKReal x642=((IKReal(2.00000000000000))*(cj1)*(pz)*(sj1));
dummyeval[0]=((((x637)*(x638)*(x639)))+(((x635)*(x636)*(x637)))+(((IKReal(2.00000000000000))*(x637)*(x640)*(x641)))+(((x635)*(x639)))+(((IKReal(-1.00000000000000))*(x640)*(x642)))+(((IKReal(-1.00000000000000))*(x641)*(x642)))+(((x636)*(x638)))+((((pz)*(pz))*((sj1)*(sj1))))+(((IKReal(-2.00000000000000))*(x640)*(x641))));
if( IKabs(dummyeval[0]) < 0.0000010000000000  )
{
continue;

} else
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
IKReal x643=(sj1)*(sj1);
IKReal x644=(py)*(py);
IKReal x645=(sj0)*(sj0);
IKReal x646=(cj1)*(cj1);
IKReal x647=(cj0)*(cj0);
IKReal x648=(px)*(px);
IKReal x649=((IKReal(1.10000000000000))*(sj1));
IKReal x650=((px)*(py));
IKReal x651=((py)*(sj0));
IKReal x652=((cj1)*(pp));
IKReal x653=((px)*(sj0));
IKReal x654=((IKReal(1.00000000000000))*(pp));
IKReal x655=((cj0)*(sj0));
IKReal x656=((cj0)*(px));
IKReal x657=((cj0)*(py));
IKReal x658=((pz)*(sj1));
IKReal x659=((IKReal(0.180000000000000))*(cj1));
IKReal x660=((IKReal(1.10000000000000))*(pz));
IKReal x661=((x643)*(x660));
if( IKabs(((gconst2)*(((((pp)*(x657)))+(((IKReal(-1.00000000000000))*(x644)*(x649)*(x655)))+(((x645)*(x649)*(x650)))+(((x648)*(x649)*(x655)))+(((IKReal(-0.180000000000000))*(x653)))+(((IKReal(0.180000000000000))*(x657)))+(((IKReal(-1.00000000000000))*(cj1)*(x657)*(x660)))+(((IKReal(-1.00000000000000))*(x647)*(x649)*(x650)))+(((IKReal(-1.00000000000000))*(x653)*(x654)))+(((cj1)*(x653)*(x660))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((gconst2)*(((((IKReal(-1.00000000000000))*(x646)*(x651)*(x660)))+(((x651)*(x661)))+(((x652)*(x656)))+(((x656)*(x661)))+(((x651)*(x652)))+(((x651)*(x659)))+(((x656)*(x659)))+(((IKReal(-0.180000000000000))*(x658)))+(((IKReal(-2.20000000000000))*(cj1)*(sj1)*(x650)*(x655)))+(((IKReal(-1.00000000000000))*(cj1)*(x644)*(x645)*(x649)))+(((IKReal(-1.00000000000000))*(cj1)*(x647)*(x648)*(x649)))+(((IKReal(-1.00000000000000))*(x646)*(x656)*(x660)))+(((cj1)*(x649)*((pz)*(pz))))+(((IKReal(-1.00000000000000))*(x654)*(x658))))))) < IKFAST_ATAN2_MAGTHRESH )
    continue;
j2array[0]=IKatan2(((gconst2)*(((((pp)*(x657)))+(((IKReal(-1.00000000000000))*(x644)*(x649)*(x655)))+(((x645)*(x649)*(x650)))+(((x648)*(x649)*(x655)))+(((IKReal(-0.180000000000000))*(x653)))+(((IKReal(0.180000000000000))*(x657)))+(((IKReal(-1.00000000000000))*(cj1)*(x657)*(x660)))+(((IKReal(-1.00000000000000))*(x647)*(x649)*(x650)))+(((IKReal(-1.00000000000000))*(x653)*(x654)))+(((cj1)*(x653)*(x660)))))), ((gconst2)*(((((IKReal(-1.00000000000000))*(x646)*(x651)*(x660)))+(((x651)*(x661)))+(((x652)*(x656)))+(((x656)*(x661)))+(((x651)*(x652)))+(((x651)*(x659)))+(((x656)*(x659)))+(((IKReal(-0.180000000000000))*(x658)))+(((IKReal(-2.20000000000000))*(cj1)*(sj1)*(x650)*(x655)))+(((IKReal(-1.00000000000000))*(cj1)*(x644)*(x645)*(x649)))+(((IKReal(-1.00000000000000))*(cj1)*(x647)*(x648)*(x649)))+(((IKReal(-1.00000000000000))*(x646)*(x656)*(x660)))+(((cj1)*(x649)*((pz)*(pz))))+(((IKReal(-1.00000000000000))*(x654)*(x658)))))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[3];
IKReal x662=IKsin(j2);
IKReal x663=IKcos(j2);
IKReal x664=((px)*(sj0));
IKReal x665=((IKReal(1.10000000000000))*(sj1));
IKReal x666=((py)*(sj0));
IKReal x667=((pz)*(sj1));
IKReal x668=((cj0)*(px));
IKReal x669=((IKReal(0.0900000000000000))*(x663));
IKReal x670=((cj1)*(x662));
IKReal x671=((IKReal(1.00000000000000))*(x663));
IKReal x672=((cj0)*(py)*(x662));
evalcond[0]=((((x663)*(x664)))+(((x666)*(x670)))+(((IKReal(-1.00000000000000))*(cj0)*(py)*(x671)))+(((x668)*(x670)))+(((IKReal(-1.00000000000000))*(x662)*(x667))));
evalcond[1]=((((x662)*(x664)))+(((x663)*(x667)))+(((IKReal(-1.00000000000000))*(cj1)*(x666)*(x671)))+(((IKReal(-1.00000000000000))*(x672)))+(((IKReal(-1.00000000000000))*(cj1)*(x668)*(x671))));
evalcond[2]=((IKReal(-0.180000000000000))+(((x665)*(x666)))+(((x665)*(x668)))+(((IKReal(-0.0900000000000000))*(x662)*(x664)))+(((IKReal(0.0900000000000000))*(x672)))+(((IKReal(1.10000000000000))*(cj1)*(pz)))+(((cj1)*(x668)*(x669)))+(((IKReal(-1.00000000000000))*(pp)))+(((IKReal(-1.00000000000000))*(x667)*(x669)))+(((cj1)*(x666)*(x669))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

}

}

} else
{
evalcond[0]=((IKReal(-3.14159265358979))+(IKfmod(((IKReal(-0.255739837120000))+(j3)), IKReal(6.28318530717959))));
evalcond[1]=((IKReal(0.0400000003605000))+(((IKReal(-1.00000000000000))*(pp))));
evalcond[2]=((IKReal(-0.200000000250000))+(((cj1)*(pz)))+(((cj0)*(px)*(sj1)))+(((py)*(sj0)*(sj1))));
if( IKabs(evalcond[0]) < 0.0000010000000000  && IKabs(evalcond[1]) < 0.0000010000000000  && IKabs(evalcond[2]) < 0.0000010000000000  )
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
IKReal x673=((IKReal(1052631578.94737))*(py));
IKReal x674=((IKReal(1052631578.94737))*(px));
if( IKabs(((((cj0)*(x673)))+(((IKReal(-1.00000000000000))*(sj0)*(x674))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((IKReal(-1052631578.94737))*(pz)*(sj1)))+(((cj0)*(cj1)*(x674)))+(((cj1)*(sj0)*(x673))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((cj0)*(x673)))+(((IKReal(-1.00000000000000))*(sj0)*(x674)))))+IKsqr(((((IKReal(-1052631578.94737))*(pz)*(sj1)))+(((cj0)*(cj1)*(x674)))+(((cj1)*(sj0)*(x673)))))-1) <= IKFAST_SINCOS_THRESH )
    continue;
j2array[0]=IKatan2(((((cj0)*(x673)))+(((IKReal(-1.00000000000000))*(sj0)*(x674)))), ((((IKReal(-1052631578.94737))*(pz)*(sj1)))+(((cj0)*(cj1)*(x674)))+(((cj1)*(sj0)*(x673)))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[5];
IKReal x675=IKcos(j2);
IKReal x676=IKsin(j2);
IKReal x677=((px)*(sj0));
IKReal x678=((py)*(sj0));
IKReal x679=((IKReal(1.00000000000000))*(cj1));
IKReal x680=((IKReal(1.10000000000000))*(sj1));
IKReal x681=((pz)*(sj1));
IKReal x682=((cj0)*(px));
IKReal x683=((IKReal(0.0900000000000000))*(x676));
IKReal x684=((IKReal(1.00000000000000))*(cj0)*(py));
IKReal x685=((cj1)*(x676));
IKReal x686=((IKReal(0.0900000000000000))*(x675));
evalcond[0]=((((IKReal(-1.00000000000000))*(x684)))+(((IKReal(9.50000000000000e-10))*(x676)))+(x677));
evalcond[1]=((((IKReal(-1.00000000000000))*(x678)*(x679)))+(((IKReal(-1.00000000000000))*(x679)*(x682)))+(((IKReal(9.50000000000000e-10))*(x675)))+(x681));
evalcond[2]=((((x678)*(x685)))+(((x682)*(x685)))+(((IKReal(-1.00000000000000))*(x675)*(x684)))+(((IKReal(-1.00000000000000))*(x676)*(x681)))+(((x675)*(x677))));
evalcond[3]=((IKReal(9.50000000000000e-10))+(((IKReal(-1.00000000000000))*(x675)*(x679)*(x682)))+(((x676)*(x677)))+(((IKReal(-1.00000000000000))*(x675)*(x678)*(x679)))+(((x675)*(x681)))+(((IKReal(-1.00000000000000))*(x676)*(x684))));
evalcond[4]=((IKReal(-0.180000000000000))+(((x678)*(x680)))+(((IKReal(-1.00000000000000))*(x681)*(x686)))+(((cj1)*(x678)*(x686)))+(((cj0)*(py)*(x683)))+(((IKReal(1.10000000000000))*(cj1)*(pz)))+(((IKReal(-1.00000000000000))*(pp)))+(((x680)*(x682)))+(((IKReal(-1.00000000000000))*(x677)*(x683)))+(((cj1)*(x682)*(x686))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  || IKabs(evalcond[3]) > 0.000001  || IKabs(evalcond[4]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

} else
{
if( 1 )
{
continue;

} else
{
}
}
}
}
}

} else
{
{
IKReal j2array[1], cj2array[1], sj2array[1];
bool j2valid[1]={false};
_nj2 = 1;
if( IKabs(((gconst0)*(((((IKReal(-1.00000000000000))*(px)*(sj0)))+(((cj0)*(py))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((gconst0)*(((((cj1)*(py)*(sj0)))+(((IKReal(-1.00000000000000))*(pz)*(sj1)))+(((cj0)*(cj1)*(px))))))) < IKFAST_ATAN2_MAGTHRESH )
    continue;
j2array[0]=IKatan2(((gconst0)*(((((IKReal(-1.00000000000000))*(px)*(sj0)))+(((cj0)*(py)))))), ((gconst0)*(((((cj1)*(py)*(sj0)))+(((IKReal(-1.00000000000000))*(pz)*(sj1)))+(((cj0)*(cj1)*(px)))))));
sj2array[0]=IKsin(j2array[0]);
cj2array[0]=IKcos(j2array[0]);
if( j2array[0] > IKPI )
{
    j2array[0]-=IK2PI;
}
else if( j2array[0] < -IKPI )
{    j2array[0]+=IK2PI;
}
j2valid[0] = true;
for(int ij2 = 0; ij2 < 1; ++ij2)
{
if( !j2valid[ij2] )
{
    continue;
}
_ij2[0] = ij2; _ij2[1] = -1;
for(int iij2 = ij2+1; iij2 < 1; ++iij2)
{
if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
{
    j2valid[iij2]=false; _ij2[1] = iij2; break; 
}
}
j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
{
IKReal evalcond[5];
IKReal x687=IKsin(j2);
IKReal x688=IKcos(j2);
IKReal x689=((IKReal(0.0450000000000000))*(cj3));
IKReal x690=((px)*(sj0));
IKReal x691=((py)*(sj0));
IKReal x692=((IKReal(1.00000000000000))*(cj0));
IKReal x693=((IKReal(1.10000000000000))*(sj1));
IKReal x694=((IKReal(0.350000000000000))*(sj3));
IKReal x695=((pz)*(sj1));
IKReal x696=((IKReal(0.0900000000000000))*(cj0));
IKReal x697=((cj0)*(px));
IKReal x698=((cj1)*(x688));
IKReal x699=((py)*(x687));
IKReal x700=((cj1)*(x687));
evalcond[0]=((((IKReal(0.0450000000000000))*(x687)))+(((IKReal(-1.00000000000000))*(x687)*(x689)))+(((x687)*(x694)))+(x690)+(((IKReal(-1.00000000000000))*(py)*(x692))));
evalcond[1]=((((IKReal(0.0450000000000000))*(x688)))+(((IKReal(-1.00000000000000))*(x688)*(x689)))+(((x688)*(x694)))+(((IKReal(-1.00000000000000))*(cj1)*(x691)))+(x695)+(((IKReal(-1.00000000000000))*(cj1)*(px)*(x692))));
evalcond[2]=((((x688)*(x690)))+(((x691)*(x700)))+(((IKReal(-1.00000000000000))*(x687)*(x695)))+(((x697)*(x700)))+(((IKReal(-1.00000000000000))*(py)*(x688)*(x692))));
evalcond[3]=((IKReal(0.0450000000000000))+(((x688)*(x695)))+(((IKReal(-1.00000000000000))*(x689)))+(((x687)*(x690)))+(((IKReal(-1.00000000000000))*(x691)*(x698)))+(((IKReal(-1.00000000000000))*(x692)*(x699)))+(x694)+(((IKReal(-1.00000000000000))*(px)*(x692)*(x698))));
evalcond[4]=((IKReal(-0.180000000000000))+(((IKReal(-0.0900000000000000))*(x688)*(x695)))+(((x696)*(x699)))+(((IKReal(0.0900000000000000))*(x691)*(x698)))+(((x691)*(x693)))+(((IKReal(-0.0900000000000000))*(x687)*(x690)))+(((IKReal(1.10000000000000))*(cj1)*(pz)))+(((IKReal(-1.00000000000000))*(pp)))+(((x693)*(x697)))+(((px)*(x696)*(x698))));
if( IKabs(evalcond[0]) > 0.000001  || IKabs(evalcond[1]) > 0.000001  || IKabs(evalcond[2]) > 0.000001  || IKabs(evalcond[3]) > 0.000001  || IKabs(evalcond[4]) > 0.000001  )
{
continue;
}
}

{
vsolutions.push_back(IKSolution()); IKSolution& solution = vsolutions.back();
solution.basesol.resize(4);
solution.basesol[0].foffset = j0;
solution.basesol[0].indices[0] = _ij0[0];
solution.basesol[0].indices[1] = _ij0[1];
solution.basesol[0].maxsolutions = _nj0;
solution.basesol[1].foffset = j1;
solution.basesol[1].indices[0] = _ij1[0];
solution.basesol[1].indices[1] = _ij1[1];
solution.basesol[1].maxsolutions = _nj1;
solution.basesol[2].foffset = j2;
solution.basesol[2].indices[0] = _ij2[0];
solution.basesol[2].indices[1] = _ij2[1];
solution.basesol[2].maxsolutions = _nj2;
solution.basesol[3].foffset = j3;
solution.basesol[3].indices[0] = _ij3[0];
solution.basesol[3].indices[1] = _ij3[1];
solution.basesol[3].maxsolutions = _nj3;
solution.vfree.resize(0);
}
}
}

}

}
}
}

}

}
}
}
}
return vsolutions.size()>0;
}
static inline void polyroots8(IKReal rawcoeffs[8+1], IKReal rawroots[8], int& numroots)
{
    using std::complex;
    IKFAST_ASSERT(rawcoeffs[0] != 0);
    const IKReal tol = 128.0*std::numeric_limits<IKReal>::epsilon();
    const IKReal tolsqrt = sqrt(std::numeric_limits<IKReal>::epsilon());
    complex<IKReal> coeffs[8];
    const int maxsteps = 110;
    for(int i = 0; i < 8; ++i) {
        coeffs[i] = complex<IKReal>(rawcoeffs[i+1]/rawcoeffs[0]);
    }
    complex<IKReal> roots[8];
    IKReal err[8];
    roots[0] = complex<IKReal>(1,0);
    roots[1] = complex<IKReal>(0.4,0.9); // any complex number not a root of unity works
    err[0] = 1.0;
    err[1] = 1.0;
    for(int i = 2; i < 8; ++i) {
        roots[i] = roots[i-1]*roots[1];
        err[i] = 1.0;
    }
    for(int step = 0; step < maxsteps; ++step) {
        bool changed = false;
        for(int i = 0; i < 8; ++i) {
            if ( err[i] >= tol ) {
                changed = true;
                // evaluate
                complex<IKReal> x = roots[i] + coeffs[0];
                for(int j = 1; j < 8; ++j) {
                    x = roots[i] * x + coeffs[j];
                }
                for(int j = 0; j < 8; ++j) {
                    if( i != j ) {
                        if( roots[i] != roots[j] ) {
                            x /= (roots[i] - roots[j]);
                        }
                    }
                }
                roots[i] -= x;
                err[i] = abs(x);
            }
        }
        if( !changed ) {
            break;
        }
    }

    numroots = 0;
    bool visited[8] = {false};
    for(int i = 0; i < 8; ++i) {
        if( !visited[i] ) {
            // might be a multiple root, in which case it will have more error than the other roots
            // find any neighboring roots, and take the average
            complex<IKReal> newroot=roots[i];
            int n = 1;
            for(int j = i+1; j < 8; ++j) {
                if( abs(roots[i]-roots[j]) < 8*tolsqrt ) {
                    newroot += roots[j];
                    n += 1;
                    visited[j] = true;
                }
            }
            if( n > 1 ) {
                newroot /= n;
            }
            // there are still cases where even the mean is not accurate enough, until a better multi-root algorithm is used, need to use the sqrt
            if( IKabs(imag(newroot)) < tolsqrt ) {
                rawroots[numroots++] = real(newroot);
            }
        }
    }
}
};


/// solves the inverse kinematics equations.
/// \param pfree is an array specifying the free joints of the chain.
IKFAST_API bool ik(const IKReal* eetrans, const IKReal* eerot, const IKReal* pfree, std::vector<IKSolution>& vsolutions) {
IKSolver solver;
return solver.ik(eetrans,eerot,pfree,vsolutions);
}

IKFAST_API const char* getKinematicsHash() { return "4382fadc0284794e13f46b1dd48b52ef"; }

IKFAST_API const char* getIKFastVersion() { return "59"; }

#ifdef IKFAST_NAMESPACE
} // end namespace
#endif

#ifndef IKFAST_NO_MAIN
#include <stdio.h>
#include <stdlib.h>
#ifdef IKFAST_NAMESPACE
using namespace IKFAST_NAMESPACE;
#endif
int main(int argc, char** argv)
{
    if( argc != 12+getNumFreeParameters()+1 ) {
        printf("\nUsage: ./ik r00 r01 r02 t0 r10 r11 r12 t1 r20 r21 r22 t2 free0 ...\n\n"
               "Returns the ik solutions given the transformation of the end effector specified by\n"
               "a 3x3 rotation R (rXX), and a 3x1 translation (tX).\n"
               "There are %d free parameters that have to be specified.\n\n",getNumFreeParameters());
        return 1;
    }

    std::vector<IKSolution> vsolutions;
    std::vector<IKReal> vfree(getNumFreeParameters());
    IKReal eerot[9],eetrans[3];
    eerot[0] = atof(argv[1]); eerot[1] = atof(argv[2]); eerot[2] = atof(argv[3]); eetrans[0] = atof(argv[4]);
    eerot[3] = atof(argv[5]); eerot[4] = atof(argv[6]); eerot[5] = atof(argv[7]); eetrans[1] = atof(argv[8]);
    eerot[6] = atof(argv[9]); eerot[7] = atof(argv[10]); eerot[8] = atof(argv[11]); eetrans[2] = atof(argv[12]);
    for(std::size_t i = 0; i < vfree.size(); ++i)
        vfree[i] = atof(argv[13+i]);
    bool bSuccess = ik(eetrans, eerot, vfree.size() > 0 ? &vfree[0] : NULL, vsolutions);

    if( !bSuccess ) {
        fprintf(stderr,"Failed to get ik solution\n");
        return -1;
    }

    printf("Found %d ik solutions:\n", (int)vsolutions.size());
    std::vector<IKReal> sol(getNumJoints());
    for(std::size_t i = 0; i < vsolutions.size(); ++i) {
        printf("sol%d (free=%d): ", (int)i, (int)vsolutions[i].GetFree().size());
        std::vector<IKReal> vsolfree(vsolutions[i].GetFree().size());
        vsolutions[i].GetSolution(&sol[0],vsolfree.size()>0?&vsolfree[0]:NULL);
        for( std::size_t j = 0; j < sol.size(); ++j)
            printf("%.15f, ", sol[j]);
        printf("\n");
    }
    return 0;
}

#endif
