Files
github-actions[bot] 8383cc6688 sunnypilot v2025.002.000
2025-11-07 04:50:05 +00:00

1988 lines
91 KiB
C++

#include "live.h"
namespace {
#define DIM 22
#define EDIM 21
#define MEDIM 21
typedef void (*Hfun)(double *, double *, double *);
const static double MAHA_THRESH_4 = 7.814727903251177;
const static double MAHA_THRESH_9 = 7.814727903251177;
const static double MAHA_THRESH_10 = 7.814727903251177;
const static double MAHA_THRESH_12 = 7.814727903251177;
const static double MAHA_THRESH_35 = 7.814727903251177;
const static double MAHA_THRESH_32 = 9.487729036781154;
const static double MAHA_THRESH_13 = 7.814727903251177;
const static double MAHA_THRESH_14 = 7.814727903251177;
const static double MAHA_THRESH_33 = 7.814727903251177;
/******************************************************************************
* Code generated with SymPy 1.14.0 *
* *
* See http://www.sympy.org/ for more information. *
* *
* This file is part of 'ekf' *
******************************************************************************/
void H(double *in_vec, double *out_4323635268615141267) {
out_4323635268615141267[0] = 0;
out_4323635268615141267[1] = -sin(in_vec[1])*sin(in_vec[2])*in_vec[4] - sin(in_vec[1])*cos(in_vec[2])*in_vec[3] - cos(in_vec[1])*in_vec[5];
out_4323635268615141267[2] = -sin(in_vec[2])*cos(in_vec[1])*in_vec[3] + cos(in_vec[1])*cos(in_vec[2])*in_vec[4];
out_4323635268615141267[3] = cos(in_vec[1])*cos(in_vec[2]);
out_4323635268615141267[4] = sin(in_vec[2])*cos(in_vec[1]);
out_4323635268615141267[5] = -sin(in_vec[1]);
out_4323635268615141267[6] = (sin(in_vec[0])*sin(in_vec[2]) + sin(in_vec[1])*cos(in_vec[0])*cos(in_vec[2]))*in_vec[3] + (-sin(in_vec[0])*cos(in_vec[2]) + sin(in_vec[1])*sin(in_vec[2])*cos(in_vec[0]))*in_vec[4] + cos(in_vec[0])*cos(in_vec[1])*in_vec[5];
out_4323635268615141267[7] = -sin(in_vec[0])*sin(in_vec[1])*in_vec[5] + sin(in_vec[0])*sin(in_vec[2])*cos(in_vec[1])*in_vec[4] + sin(in_vec[0])*cos(in_vec[1])*cos(in_vec[2])*in_vec[3];
out_4323635268615141267[8] = (-sin(in_vec[0])*sin(in_vec[1])*sin(in_vec[2]) - cos(in_vec[0])*cos(in_vec[2]))*in_vec[3] + (sin(in_vec[0])*sin(in_vec[1])*cos(in_vec[2]) - sin(in_vec[2])*cos(in_vec[0]))*in_vec[4];
out_4323635268615141267[9] = sin(in_vec[0])*sin(in_vec[1])*cos(in_vec[2]) - sin(in_vec[2])*cos(in_vec[0]);
out_4323635268615141267[10] = sin(in_vec[0])*sin(in_vec[1])*sin(in_vec[2]) + cos(in_vec[0])*cos(in_vec[2]);
out_4323635268615141267[11] = sin(in_vec[0])*cos(in_vec[1]);
out_4323635268615141267[12] = (-sin(in_vec[0])*sin(in_vec[1])*sin(in_vec[2]) - cos(in_vec[0])*cos(in_vec[2]))*in_vec[4] + (-sin(in_vec[0])*sin(in_vec[1])*cos(in_vec[2]) + sin(in_vec[2])*cos(in_vec[0]))*in_vec[3] - sin(in_vec[0])*cos(in_vec[1])*in_vec[5];
out_4323635268615141267[13] = -sin(in_vec[1])*cos(in_vec[0])*in_vec[5] + sin(in_vec[2])*cos(in_vec[0])*cos(in_vec[1])*in_vec[4] + cos(in_vec[0])*cos(in_vec[1])*cos(in_vec[2])*in_vec[3];
out_4323635268615141267[14] = (sin(in_vec[0])*sin(in_vec[2]) + sin(in_vec[1])*cos(in_vec[0])*cos(in_vec[2]))*in_vec[4] + (sin(in_vec[0])*cos(in_vec[2]) - sin(in_vec[1])*sin(in_vec[2])*cos(in_vec[0]))*in_vec[3];
out_4323635268615141267[15] = sin(in_vec[0])*sin(in_vec[2]) + sin(in_vec[1])*cos(in_vec[0])*cos(in_vec[2]);
out_4323635268615141267[16] = -sin(in_vec[0])*cos(in_vec[2]) + sin(in_vec[1])*sin(in_vec[2])*cos(in_vec[0]);
out_4323635268615141267[17] = cos(in_vec[0])*cos(in_vec[1]);
}
void err_fun(double *nom_x, double *delta_x, double *out_6197074480032553231) {
out_6197074480032553231[0] = delta_x[0] + nom_x[0];
out_6197074480032553231[1] = delta_x[1] + nom_x[1];
out_6197074480032553231[2] = delta_x[2] + nom_x[2];
out_6197074480032553231[3] = -0.5*delta_x[3]*nom_x[4] - 0.5*delta_x[4]*nom_x[5] - 0.5*delta_x[5]*nom_x[6] + 1.0*nom_x[3];
out_6197074480032553231[4] = 0.5*delta_x[3]*nom_x[3] + 0.5*delta_x[4]*nom_x[6] - 0.5*delta_x[5]*nom_x[5] + 1.0*nom_x[4];
out_6197074480032553231[5] = -0.5*delta_x[3]*nom_x[6] + 0.5*delta_x[4]*nom_x[3] + 0.5*delta_x[5]*nom_x[4] + 1.0*nom_x[5];
out_6197074480032553231[6] = 0.5*delta_x[3]*nom_x[5] - 0.5*delta_x[4]*nom_x[4] + 0.5*delta_x[5]*nom_x[3] + 1.0*nom_x[6];
out_6197074480032553231[7] = delta_x[6] + nom_x[7];
out_6197074480032553231[8] = delta_x[7] + nom_x[8];
out_6197074480032553231[9] = delta_x[8] + nom_x[9];
out_6197074480032553231[10] = delta_x[9] + nom_x[10];
out_6197074480032553231[11] = delta_x[10] + nom_x[11];
out_6197074480032553231[12] = delta_x[11] + nom_x[12];
out_6197074480032553231[13] = delta_x[12] + nom_x[13];
out_6197074480032553231[14] = delta_x[13] + nom_x[14];
out_6197074480032553231[15] = delta_x[14] + nom_x[15];
out_6197074480032553231[16] = delta_x[15] + nom_x[16];
out_6197074480032553231[17] = delta_x[16] + nom_x[17];
out_6197074480032553231[18] = delta_x[17] + nom_x[18];
out_6197074480032553231[19] = delta_x[18] + nom_x[19];
out_6197074480032553231[20] = delta_x[19] + nom_x[20];
out_6197074480032553231[21] = delta_x[20] + nom_x[21];
}
void inv_err_fun(double *nom_x, double *true_x, double *out_2989387618240936660) {
out_2989387618240936660[0] = -nom_x[0] + true_x[0];
out_2989387618240936660[1] = -nom_x[1] + true_x[1];
out_2989387618240936660[2] = -nom_x[2] + true_x[2];
out_2989387618240936660[3] = 2*nom_x[3]*true_x[4] - 2*nom_x[4]*true_x[3] + 2*nom_x[5]*true_x[6] - 2*nom_x[6]*true_x[5];
out_2989387618240936660[4] = 2*nom_x[3]*true_x[5] - 2*nom_x[4]*true_x[6] - 2*nom_x[5]*true_x[3] + 2*nom_x[6]*true_x[4];
out_2989387618240936660[5] = 2*nom_x[3]*true_x[6] + 2*nom_x[4]*true_x[5] - 2*nom_x[5]*true_x[4] - 2*nom_x[6]*true_x[3];
out_2989387618240936660[6] = -nom_x[7] + true_x[7];
out_2989387618240936660[7] = -nom_x[8] + true_x[8];
out_2989387618240936660[8] = -nom_x[9] + true_x[9];
out_2989387618240936660[9] = -nom_x[10] + true_x[10];
out_2989387618240936660[10] = -nom_x[11] + true_x[11];
out_2989387618240936660[11] = -nom_x[12] + true_x[12];
out_2989387618240936660[12] = -nom_x[13] + true_x[13];
out_2989387618240936660[13] = -nom_x[14] + true_x[14];
out_2989387618240936660[14] = -nom_x[15] + true_x[15];
out_2989387618240936660[15] = -nom_x[16] + true_x[16];
out_2989387618240936660[16] = -nom_x[17] + true_x[17];
out_2989387618240936660[17] = -nom_x[18] + true_x[18];
out_2989387618240936660[18] = -nom_x[19] + true_x[19];
out_2989387618240936660[19] = -nom_x[20] + true_x[20];
out_2989387618240936660[20] = -nom_x[21] + true_x[21];
}
void H_mod_fun(double *state, double *out_6613539539070352198) {
out_6613539539070352198[0] = 1.0;
out_6613539539070352198[1] = 0;
out_6613539539070352198[2] = 0;
out_6613539539070352198[3] = 0.0;
out_6613539539070352198[4] = 0.0;
out_6613539539070352198[5] = 0.0;
out_6613539539070352198[6] = 0.0;
out_6613539539070352198[7] = 0.0;
out_6613539539070352198[8] = 0.0;
out_6613539539070352198[9] = 0.0;
out_6613539539070352198[10] = 0.0;
out_6613539539070352198[11] = 0.0;
out_6613539539070352198[12] = 0.0;
out_6613539539070352198[13] = 0.0;
out_6613539539070352198[14] = 0.0;
out_6613539539070352198[15] = 0.0;
out_6613539539070352198[16] = 0.0;
out_6613539539070352198[17] = 0.0;
out_6613539539070352198[18] = 0.0;
out_6613539539070352198[19] = 0.0;
out_6613539539070352198[20] = 0.0;
out_6613539539070352198[21] = 0;
out_6613539539070352198[22] = 1.0;
out_6613539539070352198[23] = 0;
out_6613539539070352198[24] = 0.0;
out_6613539539070352198[25] = 0.0;
out_6613539539070352198[26] = 0.0;
out_6613539539070352198[27] = 0.0;
out_6613539539070352198[28] = 0.0;
out_6613539539070352198[29] = 0.0;
out_6613539539070352198[30] = 0.0;
out_6613539539070352198[31] = 0.0;
out_6613539539070352198[32] = 0.0;
out_6613539539070352198[33] = 0.0;
out_6613539539070352198[34] = 0.0;
out_6613539539070352198[35] = 0.0;
out_6613539539070352198[36] = 0.0;
out_6613539539070352198[37] = 0.0;
out_6613539539070352198[38] = 0.0;
out_6613539539070352198[39] = 0.0;
out_6613539539070352198[40] = 0.0;
out_6613539539070352198[41] = 0.0;
out_6613539539070352198[42] = 0;
out_6613539539070352198[43] = 0;
out_6613539539070352198[44] = 1.0;
out_6613539539070352198[45] = 0.0;
out_6613539539070352198[46] = 0.0;
out_6613539539070352198[47] = 0.0;
out_6613539539070352198[48] = 0.0;
out_6613539539070352198[49] = 0.0;
out_6613539539070352198[50] = 0.0;
out_6613539539070352198[51] = 0.0;
out_6613539539070352198[52] = 0.0;
out_6613539539070352198[53] = 0.0;
out_6613539539070352198[54] = 0.0;
out_6613539539070352198[55] = 0.0;
out_6613539539070352198[56] = 0.0;
out_6613539539070352198[57] = 0.0;
out_6613539539070352198[58] = 0.0;
out_6613539539070352198[59] = 0.0;
out_6613539539070352198[60] = 0.0;
out_6613539539070352198[61] = 0.0;
out_6613539539070352198[62] = 0.0;
out_6613539539070352198[63] = 0.0;
out_6613539539070352198[64] = 0.0;
out_6613539539070352198[65] = 0.0;
out_6613539539070352198[66] = -0.5*state[4];
out_6613539539070352198[67] = -0.5*state[5];
out_6613539539070352198[68] = -0.5*state[6];
out_6613539539070352198[69] = 0.0;
out_6613539539070352198[70] = 0.0;
out_6613539539070352198[71] = 0.0;
out_6613539539070352198[72] = 0.0;
out_6613539539070352198[73] = 0.0;
out_6613539539070352198[74] = 0.0;
out_6613539539070352198[75] = 0.0;
out_6613539539070352198[76] = 0.0;
out_6613539539070352198[77] = 0.0;
out_6613539539070352198[78] = 0.0;
out_6613539539070352198[79] = 0.0;
out_6613539539070352198[80] = 0.0;
out_6613539539070352198[81] = 0.0;
out_6613539539070352198[82] = 0.0;
out_6613539539070352198[83] = 0.0;
out_6613539539070352198[84] = 0.0;
out_6613539539070352198[85] = 0.0;
out_6613539539070352198[86] = 0.0;
out_6613539539070352198[87] = 0.5*state[3];
out_6613539539070352198[88] = 0.5*state[6];
out_6613539539070352198[89] = -0.5*state[5];
out_6613539539070352198[90] = 0.0;
out_6613539539070352198[91] = 0.0;
out_6613539539070352198[92] = 0.0;
out_6613539539070352198[93] = 0.0;
out_6613539539070352198[94] = 0.0;
out_6613539539070352198[95] = 0.0;
out_6613539539070352198[96] = 0.0;
out_6613539539070352198[97] = 0.0;
out_6613539539070352198[98] = 0.0;
out_6613539539070352198[99] = 0.0;
out_6613539539070352198[100] = 0.0;
out_6613539539070352198[101] = 0.0;
out_6613539539070352198[102] = 0.0;
out_6613539539070352198[103] = 0.0;
out_6613539539070352198[104] = 0.0;
out_6613539539070352198[105] = 0.0;
out_6613539539070352198[106] = 0.0;
out_6613539539070352198[107] = 0.0;
out_6613539539070352198[108] = -0.5*state[6];
out_6613539539070352198[109] = 0.5*state[3];
out_6613539539070352198[110] = 0.5*state[4];
out_6613539539070352198[111] = 0.0;
out_6613539539070352198[112] = 0.0;
out_6613539539070352198[113] = 0.0;
out_6613539539070352198[114] = 0.0;
out_6613539539070352198[115] = 0.0;
out_6613539539070352198[116] = 0.0;
out_6613539539070352198[117] = 0.0;
out_6613539539070352198[118] = 0.0;
out_6613539539070352198[119] = 0.0;
out_6613539539070352198[120] = 0.0;
out_6613539539070352198[121] = 0.0;
out_6613539539070352198[122] = 0.0;
out_6613539539070352198[123] = 0.0;
out_6613539539070352198[124] = 0.0;
out_6613539539070352198[125] = 0.0;
out_6613539539070352198[126] = 0.0;
out_6613539539070352198[127] = 0.0;
out_6613539539070352198[128] = 0.0;
out_6613539539070352198[129] = 0.5*state[5];
out_6613539539070352198[130] = -0.5*state[4];
out_6613539539070352198[131] = 0.5*state[3];
out_6613539539070352198[132] = 0.0;
out_6613539539070352198[133] = 0.0;
out_6613539539070352198[134] = 0.0;
out_6613539539070352198[135] = 0.0;
out_6613539539070352198[136] = 0.0;
out_6613539539070352198[137] = 0.0;
out_6613539539070352198[138] = 0.0;
out_6613539539070352198[139] = 0.0;
out_6613539539070352198[140] = 0.0;
out_6613539539070352198[141] = 0.0;
out_6613539539070352198[142] = 0.0;
out_6613539539070352198[143] = 0.0;
out_6613539539070352198[144] = 0.0;
out_6613539539070352198[145] = 0.0;
out_6613539539070352198[146] = 0.0;
out_6613539539070352198[147] = 0.0;
out_6613539539070352198[148] = 0.0;
out_6613539539070352198[149] = 0.0;
out_6613539539070352198[150] = 0.0;
out_6613539539070352198[151] = 0.0;
out_6613539539070352198[152] = 0.0;
out_6613539539070352198[153] = 1.0;
out_6613539539070352198[154] = 0;
out_6613539539070352198[155] = 0;
out_6613539539070352198[156] = 0;
out_6613539539070352198[157] = 0;
out_6613539539070352198[158] = 0;
out_6613539539070352198[159] = 0;
out_6613539539070352198[160] = 0;
out_6613539539070352198[161] = 0;
out_6613539539070352198[162] = 0;
out_6613539539070352198[163] = 0;
out_6613539539070352198[164] = 0;
out_6613539539070352198[165] = 0;
out_6613539539070352198[166] = 0;
out_6613539539070352198[167] = 0;
out_6613539539070352198[168] = 0.0;
out_6613539539070352198[169] = 0.0;
out_6613539539070352198[170] = 0.0;
out_6613539539070352198[171] = 0.0;
out_6613539539070352198[172] = 0.0;
out_6613539539070352198[173] = 0.0;
out_6613539539070352198[174] = 0;
out_6613539539070352198[175] = 1.0;
out_6613539539070352198[176] = 0;
out_6613539539070352198[177] = 0;
out_6613539539070352198[178] = 0;
out_6613539539070352198[179] = 0;
out_6613539539070352198[180] = 0;
out_6613539539070352198[181] = 0;
out_6613539539070352198[182] = 0;
out_6613539539070352198[183] = 0;
out_6613539539070352198[184] = 0;
out_6613539539070352198[185] = 0;
out_6613539539070352198[186] = 0;
out_6613539539070352198[187] = 0;
out_6613539539070352198[188] = 0;
out_6613539539070352198[189] = 0.0;
out_6613539539070352198[190] = 0.0;
out_6613539539070352198[191] = 0.0;
out_6613539539070352198[192] = 0.0;
out_6613539539070352198[193] = 0.0;
out_6613539539070352198[194] = 0.0;
out_6613539539070352198[195] = 0;
out_6613539539070352198[196] = 0;
out_6613539539070352198[197] = 1.0;
out_6613539539070352198[198] = 0;
out_6613539539070352198[199] = 0;
out_6613539539070352198[200] = 0;
out_6613539539070352198[201] = 0;
out_6613539539070352198[202] = 0;
out_6613539539070352198[203] = 0;
out_6613539539070352198[204] = 0;
out_6613539539070352198[205] = 0;
out_6613539539070352198[206] = 0;
out_6613539539070352198[207] = 0;
out_6613539539070352198[208] = 0;
out_6613539539070352198[209] = 0;
out_6613539539070352198[210] = 0.0;
out_6613539539070352198[211] = 0.0;
out_6613539539070352198[212] = 0.0;
out_6613539539070352198[213] = 0.0;
out_6613539539070352198[214] = 0.0;
out_6613539539070352198[215] = 0.0;
out_6613539539070352198[216] = 0;
out_6613539539070352198[217] = 0;
out_6613539539070352198[218] = 0;
out_6613539539070352198[219] = 1.0;
out_6613539539070352198[220] = 0;
out_6613539539070352198[221] = 0;
out_6613539539070352198[222] = 0;
out_6613539539070352198[223] = 0;
out_6613539539070352198[224] = 0;
out_6613539539070352198[225] = 0;
out_6613539539070352198[226] = 0;
out_6613539539070352198[227] = 0;
out_6613539539070352198[228] = 0;
out_6613539539070352198[229] = 0;
out_6613539539070352198[230] = 0;
out_6613539539070352198[231] = 0.0;
out_6613539539070352198[232] = 0.0;
out_6613539539070352198[233] = 0.0;
out_6613539539070352198[234] = 0.0;
out_6613539539070352198[235] = 0.0;
out_6613539539070352198[236] = 0.0;
out_6613539539070352198[237] = 0;
out_6613539539070352198[238] = 0;
out_6613539539070352198[239] = 0;
out_6613539539070352198[240] = 0;
out_6613539539070352198[241] = 1.0;
out_6613539539070352198[242] = 0;
out_6613539539070352198[243] = 0;
out_6613539539070352198[244] = 0;
out_6613539539070352198[245] = 0;
out_6613539539070352198[246] = 0;
out_6613539539070352198[247] = 0;
out_6613539539070352198[248] = 0;
out_6613539539070352198[249] = 0;
out_6613539539070352198[250] = 0;
out_6613539539070352198[251] = 0;
out_6613539539070352198[252] = 0.0;
out_6613539539070352198[253] = 0.0;
out_6613539539070352198[254] = 0.0;
out_6613539539070352198[255] = 0.0;
out_6613539539070352198[256] = 0.0;
out_6613539539070352198[257] = 0.0;
out_6613539539070352198[258] = 0;
out_6613539539070352198[259] = 0;
out_6613539539070352198[260] = 0;
out_6613539539070352198[261] = 0;
out_6613539539070352198[262] = 0;
out_6613539539070352198[263] = 1.0;
out_6613539539070352198[264] = 0;
out_6613539539070352198[265] = 0;
out_6613539539070352198[266] = 0;
out_6613539539070352198[267] = 0;
out_6613539539070352198[268] = 0;
out_6613539539070352198[269] = 0;
out_6613539539070352198[270] = 0;
out_6613539539070352198[271] = 0;
out_6613539539070352198[272] = 0;
out_6613539539070352198[273] = 0.0;
out_6613539539070352198[274] = 0.0;
out_6613539539070352198[275] = 0.0;
out_6613539539070352198[276] = 0.0;
out_6613539539070352198[277] = 0.0;
out_6613539539070352198[278] = 0.0;
out_6613539539070352198[279] = 0;
out_6613539539070352198[280] = 0;
out_6613539539070352198[281] = 0;
out_6613539539070352198[282] = 0;
out_6613539539070352198[283] = 0;
out_6613539539070352198[284] = 0;
out_6613539539070352198[285] = 1.0;
out_6613539539070352198[286] = 0;
out_6613539539070352198[287] = 0;
out_6613539539070352198[288] = 0;
out_6613539539070352198[289] = 0;
out_6613539539070352198[290] = 0;
out_6613539539070352198[291] = 0;
out_6613539539070352198[292] = 0;
out_6613539539070352198[293] = 0;
out_6613539539070352198[294] = 0.0;
out_6613539539070352198[295] = 0.0;
out_6613539539070352198[296] = 0.0;
out_6613539539070352198[297] = 0.0;
out_6613539539070352198[298] = 0.0;
out_6613539539070352198[299] = 0.0;
out_6613539539070352198[300] = 0;
out_6613539539070352198[301] = 0;
out_6613539539070352198[302] = 0;
out_6613539539070352198[303] = 0;
out_6613539539070352198[304] = 0;
out_6613539539070352198[305] = 0;
out_6613539539070352198[306] = 0;
out_6613539539070352198[307] = 1.0;
out_6613539539070352198[308] = 0;
out_6613539539070352198[309] = 0;
out_6613539539070352198[310] = 0;
out_6613539539070352198[311] = 0;
out_6613539539070352198[312] = 0;
out_6613539539070352198[313] = 0;
out_6613539539070352198[314] = 0;
out_6613539539070352198[315] = 0.0;
out_6613539539070352198[316] = 0.0;
out_6613539539070352198[317] = 0.0;
out_6613539539070352198[318] = 0.0;
out_6613539539070352198[319] = 0.0;
out_6613539539070352198[320] = 0.0;
out_6613539539070352198[321] = 0;
out_6613539539070352198[322] = 0;
out_6613539539070352198[323] = 0;
out_6613539539070352198[324] = 0;
out_6613539539070352198[325] = 0;
out_6613539539070352198[326] = 0;
out_6613539539070352198[327] = 0;
out_6613539539070352198[328] = 0;
out_6613539539070352198[329] = 1.0;
out_6613539539070352198[330] = 0;
out_6613539539070352198[331] = 0;
out_6613539539070352198[332] = 0;
out_6613539539070352198[333] = 0;
out_6613539539070352198[334] = 0;
out_6613539539070352198[335] = 0;
out_6613539539070352198[336] = 0.0;
out_6613539539070352198[337] = 0.0;
out_6613539539070352198[338] = 0.0;
out_6613539539070352198[339] = 0.0;
out_6613539539070352198[340] = 0.0;
out_6613539539070352198[341] = 0.0;
out_6613539539070352198[342] = 0;
out_6613539539070352198[343] = 0;
out_6613539539070352198[344] = 0;
out_6613539539070352198[345] = 0;
out_6613539539070352198[346] = 0;
out_6613539539070352198[347] = 0;
out_6613539539070352198[348] = 0;
out_6613539539070352198[349] = 0;
out_6613539539070352198[350] = 0;
out_6613539539070352198[351] = 1.0;
out_6613539539070352198[352] = 0;
out_6613539539070352198[353] = 0;
out_6613539539070352198[354] = 0;
out_6613539539070352198[355] = 0;
out_6613539539070352198[356] = 0;
out_6613539539070352198[357] = 0.0;
out_6613539539070352198[358] = 0.0;
out_6613539539070352198[359] = 0.0;
out_6613539539070352198[360] = 0.0;
out_6613539539070352198[361] = 0.0;
out_6613539539070352198[362] = 0.0;
out_6613539539070352198[363] = 0;
out_6613539539070352198[364] = 0;
out_6613539539070352198[365] = 0;
out_6613539539070352198[366] = 0;
out_6613539539070352198[367] = 0;
out_6613539539070352198[368] = 0;
out_6613539539070352198[369] = 0;
out_6613539539070352198[370] = 0;
out_6613539539070352198[371] = 0;
out_6613539539070352198[372] = 0;
out_6613539539070352198[373] = 1.0;
out_6613539539070352198[374] = 0;
out_6613539539070352198[375] = 0;
out_6613539539070352198[376] = 0;
out_6613539539070352198[377] = 0;
out_6613539539070352198[378] = 0.0;
out_6613539539070352198[379] = 0.0;
out_6613539539070352198[380] = 0.0;
out_6613539539070352198[381] = 0.0;
out_6613539539070352198[382] = 0.0;
out_6613539539070352198[383] = 0.0;
out_6613539539070352198[384] = 0;
out_6613539539070352198[385] = 0;
out_6613539539070352198[386] = 0;
out_6613539539070352198[387] = 0;
out_6613539539070352198[388] = 0;
out_6613539539070352198[389] = 0;
out_6613539539070352198[390] = 0;
out_6613539539070352198[391] = 0;
out_6613539539070352198[392] = 0;
out_6613539539070352198[393] = 0;
out_6613539539070352198[394] = 0;
out_6613539539070352198[395] = 1.0;
out_6613539539070352198[396] = 0;
out_6613539539070352198[397] = 0;
out_6613539539070352198[398] = 0;
out_6613539539070352198[399] = 0.0;
out_6613539539070352198[400] = 0.0;
out_6613539539070352198[401] = 0.0;
out_6613539539070352198[402] = 0.0;
out_6613539539070352198[403] = 0.0;
out_6613539539070352198[404] = 0.0;
out_6613539539070352198[405] = 0;
out_6613539539070352198[406] = 0;
out_6613539539070352198[407] = 0;
out_6613539539070352198[408] = 0;
out_6613539539070352198[409] = 0;
out_6613539539070352198[410] = 0;
out_6613539539070352198[411] = 0;
out_6613539539070352198[412] = 0;
out_6613539539070352198[413] = 0;
out_6613539539070352198[414] = 0;
out_6613539539070352198[415] = 0;
out_6613539539070352198[416] = 0;
out_6613539539070352198[417] = 1.0;
out_6613539539070352198[418] = 0;
out_6613539539070352198[419] = 0;
out_6613539539070352198[420] = 0.0;
out_6613539539070352198[421] = 0.0;
out_6613539539070352198[422] = 0.0;
out_6613539539070352198[423] = 0.0;
out_6613539539070352198[424] = 0.0;
out_6613539539070352198[425] = 0.0;
out_6613539539070352198[426] = 0;
out_6613539539070352198[427] = 0;
out_6613539539070352198[428] = 0;
out_6613539539070352198[429] = 0;
out_6613539539070352198[430] = 0;
out_6613539539070352198[431] = 0;
out_6613539539070352198[432] = 0;
out_6613539539070352198[433] = 0;
out_6613539539070352198[434] = 0;
out_6613539539070352198[435] = 0;
out_6613539539070352198[436] = 0;
out_6613539539070352198[437] = 0;
out_6613539539070352198[438] = 0;
out_6613539539070352198[439] = 1.0;
out_6613539539070352198[440] = 0;
out_6613539539070352198[441] = 0.0;
out_6613539539070352198[442] = 0.0;
out_6613539539070352198[443] = 0.0;
out_6613539539070352198[444] = 0.0;
out_6613539539070352198[445] = 0.0;
out_6613539539070352198[446] = 0.0;
out_6613539539070352198[447] = 0;
out_6613539539070352198[448] = 0;
out_6613539539070352198[449] = 0;
out_6613539539070352198[450] = 0;
out_6613539539070352198[451] = 0;
out_6613539539070352198[452] = 0;
out_6613539539070352198[453] = 0;
out_6613539539070352198[454] = 0;
out_6613539539070352198[455] = 0;
out_6613539539070352198[456] = 0;
out_6613539539070352198[457] = 0;
out_6613539539070352198[458] = 0;
out_6613539539070352198[459] = 0;
out_6613539539070352198[460] = 0;
out_6613539539070352198[461] = 1.0;
}
void f_fun(double *state, double dt, double *out_8933377197583675948) {
out_8933377197583675948[0] = dt*state[7] + state[0];
out_8933377197583675948[1] = dt*state[8] + state[1];
out_8933377197583675948[2] = dt*state[9] + state[2];
out_8933377197583675948[3] = dt*(-0.5*state[4]*state[10] - 0.5*state[5]*state[11] - 0.5*state[6]*state[12]) + state[3];
out_8933377197583675948[4] = dt*(0.5*state[3]*state[10] + 0.5*state[5]*state[12] - 0.5*state[6]*state[11]) + state[4];
out_8933377197583675948[5] = dt*(0.5*state[3]*state[11] - 0.5*state[4]*state[12] + 0.5*state[6]*state[10]) + state[5];
out_8933377197583675948[6] = dt*(0.5*state[3]*state[12] + 0.5*state[4]*state[11] - 0.5*state[5]*state[10]) + state[6];
out_8933377197583675948[7] = dt*((2*state[3]*state[5] + 2*state[4]*state[6])*state[18] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[17] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[16]) + state[7];
out_8933377197583675948[8] = dt*((-2*state[3]*state[4] + 2*state[5]*state[6])*state[18] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[16] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[17]) + state[8];
out_8933377197583675948[9] = dt*((2*state[3]*state[4] + 2*state[5]*state[6])*state[17] + (-2*state[3]*state[5] + 2*state[4]*state[6])*state[16] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[18]) + state[9];
out_8933377197583675948[10] = state[10];
out_8933377197583675948[11] = state[11];
out_8933377197583675948[12] = state[12];
out_8933377197583675948[13] = state[13];
out_8933377197583675948[14] = state[14];
out_8933377197583675948[15] = state[15];
out_8933377197583675948[16] = state[16];
out_8933377197583675948[17] = state[17];
out_8933377197583675948[18] = state[18];
out_8933377197583675948[19] = state[19];
out_8933377197583675948[20] = state[20];
out_8933377197583675948[21] = state[21];
}
void F_fun(double *state, double dt, double *out_3718350443949690231) {
out_3718350443949690231[0] = 1;
out_3718350443949690231[1] = 0;
out_3718350443949690231[2] = 0;
out_3718350443949690231[3] = 0;
out_3718350443949690231[4] = 0;
out_3718350443949690231[5] = 0;
out_3718350443949690231[6] = dt;
out_3718350443949690231[7] = 0;
out_3718350443949690231[8] = 0;
out_3718350443949690231[9] = 0;
out_3718350443949690231[10] = 0;
out_3718350443949690231[11] = 0;
out_3718350443949690231[12] = 0;
out_3718350443949690231[13] = 0;
out_3718350443949690231[14] = 0;
out_3718350443949690231[15] = 0;
out_3718350443949690231[16] = 0;
out_3718350443949690231[17] = 0;
out_3718350443949690231[18] = 0;
out_3718350443949690231[19] = 0;
out_3718350443949690231[20] = 0;
out_3718350443949690231[21] = 0;
out_3718350443949690231[22] = 1;
out_3718350443949690231[23] = 0;
out_3718350443949690231[24] = 0;
out_3718350443949690231[25] = 0;
out_3718350443949690231[26] = 0;
out_3718350443949690231[27] = 0;
out_3718350443949690231[28] = dt;
out_3718350443949690231[29] = 0;
out_3718350443949690231[30] = 0;
out_3718350443949690231[31] = 0;
out_3718350443949690231[32] = 0;
out_3718350443949690231[33] = 0;
out_3718350443949690231[34] = 0;
out_3718350443949690231[35] = 0;
out_3718350443949690231[36] = 0;
out_3718350443949690231[37] = 0;
out_3718350443949690231[38] = 0;
out_3718350443949690231[39] = 0;
out_3718350443949690231[40] = 0;
out_3718350443949690231[41] = 0;
out_3718350443949690231[42] = 0;
out_3718350443949690231[43] = 0;
out_3718350443949690231[44] = 1;
out_3718350443949690231[45] = 0;
out_3718350443949690231[46] = 0;
out_3718350443949690231[47] = 0;
out_3718350443949690231[48] = 0;
out_3718350443949690231[49] = 0;
out_3718350443949690231[50] = dt;
out_3718350443949690231[51] = 0;
out_3718350443949690231[52] = 0;
out_3718350443949690231[53] = 0;
out_3718350443949690231[54] = 0;
out_3718350443949690231[55] = 0;
out_3718350443949690231[56] = 0;
out_3718350443949690231[57] = 0;
out_3718350443949690231[58] = 0;
out_3718350443949690231[59] = 0;
out_3718350443949690231[60] = 0;
out_3718350443949690231[61] = 0;
out_3718350443949690231[62] = 0;
out_3718350443949690231[63] = 0;
out_3718350443949690231[64] = 0;
out_3718350443949690231[65] = 0;
out_3718350443949690231[66] = 1;
out_3718350443949690231[67] = dt*((2*state[3]*state[4] + 2*state[5]*state[6])*state[11] + (-2*state[3]*state[5] + 2*state[4]*state[6])*state[10] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[12]);
out_3718350443949690231[68] = dt*((2*state[3]*state[4] - 2*state[5]*state[6])*state[12] + (-2*state[3]*state[6] - 2*state[4]*state[5])*state[10] + (-pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[11]);
out_3718350443949690231[69] = 0;
out_3718350443949690231[70] = 0;
out_3718350443949690231[71] = 0;
out_3718350443949690231[72] = dt*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2));
out_3718350443949690231[73] = dt*(-2*state[3]*state[6] + 2*state[4]*state[5]);
out_3718350443949690231[74] = dt*(2*state[3]*state[5] + 2*state[4]*state[6]);
out_3718350443949690231[75] = 0;
out_3718350443949690231[76] = 0;
out_3718350443949690231[77] = 0;
out_3718350443949690231[78] = 0;
out_3718350443949690231[79] = 0;
out_3718350443949690231[80] = 0;
out_3718350443949690231[81] = 0;
out_3718350443949690231[82] = 0;
out_3718350443949690231[83] = 0;
out_3718350443949690231[84] = 0;
out_3718350443949690231[85] = 0;
out_3718350443949690231[86] = 0;
out_3718350443949690231[87] = dt*(-(2*state[3]*state[4] + 2*state[5]*state[6])*state[11] - (-2*state[3]*state[5] + 2*state[4]*state[6])*state[10] - (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[12]);
out_3718350443949690231[88] = 1;
out_3718350443949690231[89] = dt*((2*state[3]*state[5] + 2*state[4]*state[6])*state[12] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[11] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[10]);
out_3718350443949690231[90] = 0;
out_3718350443949690231[91] = 0;
out_3718350443949690231[92] = 0;
out_3718350443949690231[93] = dt*(2*state[3]*state[6] + 2*state[4]*state[5]);
out_3718350443949690231[94] = dt*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2));
out_3718350443949690231[95] = dt*(-2*state[3]*state[4] + 2*state[5]*state[6]);
out_3718350443949690231[96] = 0;
out_3718350443949690231[97] = 0;
out_3718350443949690231[98] = 0;
out_3718350443949690231[99] = 0;
out_3718350443949690231[100] = 0;
out_3718350443949690231[101] = 0;
out_3718350443949690231[102] = 0;
out_3718350443949690231[103] = 0;
out_3718350443949690231[104] = 0;
out_3718350443949690231[105] = 0;
out_3718350443949690231[106] = 0;
out_3718350443949690231[107] = 0;
out_3718350443949690231[108] = dt*((-2*state[3]*state[4] + 2*state[5]*state[6])*state[12] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[10] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[11]);
out_3718350443949690231[109] = dt*((-2*state[3]*state[5] - 2*state[4]*state[6])*state[12] + (2*state[3]*state[6] - 2*state[4]*state[5])*state[11] + (-pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) + pow(state[6], 2))*state[10]);
out_3718350443949690231[110] = 1;
out_3718350443949690231[111] = 0;
out_3718350443949690231[112] = 0;
out_3718350443949690231[113] = 0;
out_3718350443949690231[114] = dt*(-2*state[3]*state[5] + 2*state[4]*state[6]);
out_3718350443949690231[115] = dt*(2*state[3]*state[4] + 2*state[5]*state[6]);
out_3718350443949690231[116] = dt*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2));
out_3718350443949690231[117] = 0;
out_3718350443949690231[118] = 0;
out_3718350443949690231[119] = 0;
out_3718350443949690231[120] = 0;
out_3718350443949690231[121] = 0;
out_3718350443949690231[122] = 0;
out_3718350443949690231[123] = 0;
out_3718350443949690231[124] = 0;
out_3718350443949690231[125] = 0;
out_3718350443949690231[126] = 0;
out_3718350443949690231[127] = 0;
out_3718350443949690231[128] = 0;
out_3718350443949690231[129] = 0;
out_3718350443949690231[130] = dt*((2*state[3]*state[4] + 2*state[5]*state[6])*state[17] + (-2*state[3]*state[5] + 2*state[4]*state[6])*state[16] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[18]);
out_3718350443949690231[131] = dt*((2*state[3]*state[4] - 2*state[5]*state[6])*state[18] + (-2*state[3]*state[6] - 2*state[4]*state[5])*state[16] + (-pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[17]);
out_3718350443949690231[132] = 1;
out_3718350443949690231[133] = 0;
out_3718350443949690231[134] = 0;
out_3718350443949690231[135] = 0;
out_3718350443949690231[136] = 0;
out_3718350443949690231[137] = 0;
out_3718350443949690231[138] = 0;
out_3718350443949690231[139] = 0;
out_3718350443949690231[140] = 0;
out_3718350443949690231[141] = dt*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2));
out_3718350443949690231[142] = dt*(-2*state[3]*state[6] + 2*state[4]*state[5]);
out_3718350443949690231[143] = dt*(2*state[3]*state[5] + 2*state[4]*state[6]);
out_3718350443949690231[144] = 0;
out_3718350443949690231[145] = 0;
out_3718350443949690231[146] = 0;
out_3718350443949690231[147] = 0;
out_3718350443949690231[148] = 0;
out_3718350443949690231[149] = 0;
out_3718350443949690231[150] = dt*(-(2*state[3]*state[4] + 2*state[5]*state[6])*state[17] - (-2*state[3]*state[5] + 2*state[4]*state[6])*state[16] - (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[18]);
out_3718350443949690231[151] = 0;
out_3718350443949690231[152] = dt*((2*state[3]*state[5] + 2*state[4]*state[6])*state[18] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[17] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[16]);
out_3718350443949690231[153] = 0;
out_3718350443949690231[154] = 1;
out_3718350443949690231[155] = 0;
out_3718350443949690231[156] = 0;
out_3718350443949690231[157] = 0;
out_3718350443949690231[158] = 0;
out_3718350443949690231[159] = 0;
out_3718350443949690231[160] = 0;
out_3718350443949690231[161] = 0;
out_3718350443949690231[162] = dt*(2*state[3]*state[6] + 2*state[4]*state[5]);
out_3718350443949690231[163] = dt*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2));
out_3718350443949690231[164] = dt*(-2*state[3]*state[4] + 2*state[5]*state[6]);
out_3718350443949690231[165] = 0;
out_3718350443949690231[166] = 0;
out_3718350443949690231[167] = 0;
out_3718350443949690231[168] = 0;
out_3718350443949690231[169] = 0;
out_3718350443949690231[170] = 0;
out_3718350443949690231[171] = dt*((-2*state[3]*state[4] + 2*state[5]*state[6])*state[18] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[16] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[17]);
out_3718350443949690231[172] = dt*((-2*state[3]*state[5] - 2*state[4]*state[6])*state[18] + (2*state[3]*state[6] - 2*state[4]*state[5])*state[17] + (-pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) + pow(state[6], 2))*state[16]);
out_3718350443949690231[173] = 0;
out_3718350443949690231[174] = 0;
out_3718350443949690231[175] = 0;
out_3718350443949690231[176] = 1;
out_3718350443949690231[177] = 0;
out_3718350443949690231[178] = 0;
out_3718350443949690231[179] = 0;
out_3718350443949690231[180] = 0;
out_3718350443949690231[181] = 0;
out_3718350443949690231[182] = 0;
out_3718350443949690231[183] = dt*(-2*state[3]*state[5] + 2*state[4]*state[6]);
out_3718350443949690231[184] = dt*(2*state[3]*state[4] + 2*state[5]*state[6]);
out_3718350443949690231[185] = dt*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2));
out_3718350443949690231[186] = 0;
out_3718350443949690231[187] = 0;
out_3718350443949690231[188] = 0;
out_3718350443949690231[189] = 0;
out_3718350443949690231[190] = 0;
out_3718350443949690231[191] = 0;
out_3718350443949690231[192] = 0;
out_3718350443949690231[193] = 0;
out_3718350443949690231[194] = 0;
out_3718350443949690231[195] = 0;
out_3718350443949690231[196] = 0;
out_3718350443949690231[197] = 0;
out_3718350443949690231[198] = 1;
out_3718350443949690231[199] = 0;
out_3718350443949690231[200] = 0;
out_3718350443949690231[201] = 0;
out_3718350443949690231[202] = 0;
out_3718350443949690231[203] = 0;
out_3718350443949690231[204] = 0;
out_3718350443949690231[205] = 0;
out_3718350443949690231[206] = 0;
out_3718350443949690231[207] = 0;
out_3718350443949690231[208] = 0;
out_3718350443949690231[209] = 0;
out_3718350443949690231[210] = 0;
out_3718350443949690231[211] = 0;
out_3718350443949690231[212] = 0;
out_3718350443949690231[213] = 0;
out_3718350443949690231[214] = 0;
out_3718350443949690231[215] = 0;
out_3718350443949690231[216] = 0;
out_3718350443949690231[217] = 0;
out_3718350443949690231[218] = 0;
out_3718350443949690231[219] = 0;
out_3718350443949690231[220] = 1;
out_3718350443949690231[221] = 0;
out_3718350443949690231[222] = 0;
out_3718350443949690231[223] = 0;
out_3718350443949690231[224] = 0;
out_3718350443949690231[225] = 0;
out_3718350443949690231[226] = 0;
out_3718350443949690231[227] = 0;
out_3718350443949690231[228] = 0;
out_3718350443949690231[229] = 0;
out_3718350443949690231[230] = 0;
out_3718350443949690231[231] = 0;
out_3718350443949690231[232] = 0;
out_3718350443949690231[233] = 0;
out_3718350443949690231[234] = 0;
out_3718350443949690231[235] = 0;
out_3718350443949690231[236] = 0;
out_3718350443949690231[237] = 0;
out_3718350443949690231[238] = 0;
out_3718350443949690231[239] = 0;
out_3718350443949690231[240] = 0;
out_3718350443949690231[241] = 0;
out_3718350443949690231[242] = 1;
out_3718350443949690231[243] = 0;
out_3718350443949690231[244] = 0;
out_3718350443949690231[245] = 0;
out_3718350443949690231[246] = 0;
out_3718350443949690231[247] = 0;
out_3718350443949690231[248] = 0;
out_3718350443949690231[249] = 0;
out_3718350443949690231[250] = 0;
out_3718350443949690231[251] = 0;
out_3718350443949690231[252] = 0;
out_3718350443949690231[253] = 0;
out_3718350443949690231[254] = 0;
out_3718350443949690231[255] = 0;
out_3718350443949690231[256] = 0;
out_3718350443949690231[257] = 0;
out_3718350443949690231[258] = 0;
out_3718350443949690231[259] = 0;
out_3718350443949690231[260] = 0;
out_3718350443949690231[261] = 0;
out_3718350443949690231[262] = 0;
out_3718350443949690231[263] = 0;
out_3718350443949690231[264] = 1;
out_3718350443949690231[265] = 0;
out_3718350443949690231[266] = 0;
out_3718350443949690231[267] = 0;
out_3718350443949690231[268] = 0;
out_3718350443949690231[269] = 0;
out_3718350443949690231[270] = 0;
out_3718350443949690231[271] = 0;
out_3718350443949690231[272] = 0;
out_3718350443949690231[273] = 0;
out_3718350443949690231[274] = 0;
out_3718350443949690231[275] = 0;
out_3718350443949690231[276] = 0;
out_3718350443949690231[277] = 0;
out_3718350443949690231[278] = 0;
out_3718350443949690231[279] = 0;
out_3718350443949690231[280] = 0;
out_3718350443949690231[281] = 0;
out_3718350443949690231[282] = 0;
out_3718350443949690231[283] = 0;
out_3718350443949690231[284] = 0;
out_3718350443949690231[285] = 0;
out_3718350443949690231[286] = 1;
out_3718350443949690231[287] = 0;
out_3718350443949690231[288] = 0;
out_3718350443949690231[289] = 0;
out_3718350443949690231[290] = 0;
out_3718350443949690231[291] = 0;
out_3718350443949690231[292] = 0;
out_3718350443949690231[293] = 0;
out_3718350443949690231[294] = 0;
out_3718350443949690231[295] = 0;
out_3718350443949690231[296] = 0;
out_3718350443949690231[297] = 0;
out_3718350443949690231[298] = 0;
out_3718350443949690231[299] = 0;
out_3718350443949690231[300] = 0;
out_3718350443949690231[301] = 0;
out_3718350443949690231[302] = 0;
out_3718350443949690231[303] = 0;
out_3718350443949690231[304] = 0;
out_3718350443949690231[305] = 0;
out_3718350443949690231[306] = 0;
out_3718350443949690231[307] = 0;
out_3718350443949690231[308] = 1;
out_3718350443949690231[309] = 0;
out_3718350443949690231[310] = 0;
out_3718350443949690231[311] = 0;
out_3718350443949690231[312] = 0;
out_3718350443949690231[313] = 0;
out_3718350443949690231[314] = 0;
out_3718350443949690231[315] = 0;
out_3718350443949690231[316] = 0;
out_3718350443949690231[317] = 0;
out_3718350443949690231[318] = 0;
out_3718350443949690231[319] = 0;
out_3718350443949690231[320] = 0;
out_3718350443949690231[321] = 0;
out_3718350443949690231[322] = 0;
out_3718350443949690231[323] = 0;
out_3718350443949690231[324] = 0;
out_3718350443949690231[325] = 0;
out_3718350443949690231[326] = 0;
out_3718350443949690231[327] = 0;
out_3718350443949690231[328] = 0;
out_3718350443949690231[329] = 0;
out_3718350443949690231[330] = 1;
out_3718350443949690231[331] = 0;
out_3718350443949690231[332] = 0;
out_3718350443949690231[333] = 0;
out_3718350443949690231[334] = 0;
out_3718350443949690231[335] = 0;
out_3718350443949690231[336] = 0;
out_3718350443949690231[337] = 0;
out_3718350443949690231[338] = 0;
out_3718350443949690231[339] = 0;
out_3718350443949690231[340] = 0;
out_3718350443949690231[341] = 0;
out_3718350443949690231[342] = 0;
out_3718350443949690231[343] = 0;
out_3718350443949690231[344] = 0;
out_3718350443949690231[345] = 0;
out_3718350443949690231[346] = 0;
out_3718350443949690231[347] = 0;
out_3718350443949690231[348] = 0;
out_3718350443949690231[349] = 0;
out_3718350443949690231[350] = 0;
out_3718350443949690231[351] = 0;
out_3718350443949690231[352] = 1;
out_3718350443949690231[353] = 0;
out_3718350443949690231[354] = 0;
out_3718350443949690231[355] = 0;
out_3718350443949690231[356] = 0;
out_3718350443949690231[357] = 0;
out_3718350443949690231[358] = 0;
out_3718350443949690231[359] = 0;
out_3718350443949690231[360] = 0;
out_3718350443949690231[361] = 0;
out_3718350443949690231[362] = 0;
out_3718350443949690231[363] = 0;
out_3718350443949690231[364] = 0;
out_3718350443949690231[365] = 0;
out_3718350443949690231[366] = 0;
out_3718350443949690231[367] = 0;
out_3718350443949690231[368] = 0;
out_3718350443949690231[369] = 0;
out_3718350443949690231[370] = 0;
out_3718350443949690231[371] = 0;
out_3718350443949690231[372] = 0;
out_3718350443949690231[373] = 0;
out_3718350443949690231[374] = 1;
out_3718350443949690231[375] = 0;
out_3718350443949690231[376] = 0;
out_3718350443949690231[377] = 0;
out_3718350443949690231[378] = 0;
out_3718350443949690231[379] = 0;
out_3718350443949690231[380] = 0;
out_3718350443949690231[381] = 0;
out_3718350443949690231[382] = 0;
out_3718350443949690231[383] = 0;
out_3718350443949690231[384] = 0;
out_3718350443949690231[385] = 0;
out_3718350443949690231[386] = 0;
out_3718350443949690231[387] = 0;
out_3718350443949690231[388] = 0;
out_3718350443949690231[389] = 0;
out_3718350443949690231[390] = 0;
out_3718350443949690231[391] = 0;
out_3718350443949690231[392] = 0;
out_3718350443949690231[393] = 0;
out_3718350443949690231[394] = 0;
out_3718350443949690231[395] = 0;
out_3718350443949690231[396] = 1;
out_3718350443949690231[397] = 0;
out_3718350443949690231[398] = 0;
out_3718350443949690231[399] = 0;
out_3718350443949690231[400] = 0;
out_3718350443949690231[401] = 0;
out_3718350443949690231[402] = 0;
out_3718350443949690231[403] = 0;
out_3718350443949690231[404] = 0;
out_3718350443949690231[405] = 0;
out_3718350443949690231[406] = 0;
out_3718350443949690231[407] = 0;
out_3718350443949690231[408] = 0;
out_3718350443949690231[409] = 0;
out_3718350443949690231[410] = 0;
out_3718350443949690231[411] = 0;
out_3718350443949690231[412] = 0;
out_3718350443949690231[413] = 0;
out_3718350443949690231[414] = 0;
out_3718350443949690231[415] = 0;
out_3718350443949690231[416] = 0;
out_3718350443949690231[417] = 0;
out_3718350443949690231[418] = 1;
out_3718350443949690231[419] = 0;
out_3718350443949690231[420] = 0;
out_3718350443949690231[421] = 0;
out_3718350443949690231[422] = 0;
out_3718350443949690231[423] = 0;
out_3718350443949690231[424] = 0;
out_3718350443949690231[425] = 0;
out_3718350443949690231[426] = 0;
out_3718350443949690231[427] = 0;
out_3718350443949690231[428] = 0;
out_3718350443949690231[429] = 0;
out_3718350443949690231[430] = 0;
out_3718350443949690231[431] = 0;
out_3718350443949690231[432] = 0;
out_3718350443949690231[433] = 0;
out_3718350443949690231[434] = 0;
out_3718350443949690231[435] = 0;
out_3718350443949690231[436] = 0;
out_3718350443949690231[437] = 0;
out_3718350443949690231[438] = 0;
out_3718350443949690231[439] = 0;
out_3718350443949690231[440] = 1;
}
void h_4(double *state, double *unused, double *out_6331268052836927497) {
out_6331268052836927497[0] = state[10] + state[13];
out_6331268052836927497[1] = state[11] + state[14];
out_6331268052836927497[2] = state[12] + state[15];
}
void H_4(double *state, double *unused, double *out_1163708809003022022) {
out_1163708809003022022[0] = 0;
out_1163708809003022022[1] = 0;
out_1163708809003022022[2] = 0;
out_1163708809003022022[3] = 0;
out_1163708809003022022[4] = 0;
out_1163708809003022022[5] = 0;
out_1163708809003022022[6] = 0;
out_1163708809003022022[7] = 0;
out_1163708809003022022[8] = 0;
out_1163708809003022022[9] = 0;
out_1163708809003022022[10] = 1;
out_1163708809003022022[11] = 0;
out_1163708809003022022[12] = 0;
out_1163708809003022022[13] = 1;
out_1163708809003022022[14] = 0;
out_1163708809003022022[15] = 0;
out_1163708809003022022[16] = 0;
out_1163708809003022022[17] = 0;
out_1163708809003022022[18] = 0;
out_1163708809003022022[19] = 0;
out_1163708809003022022[20] = 0;
out_1163708809003022022[21] = 0;
out_1163708809003022022[22] = 0;
out_1163708809003022022[23] = 0;
out_1163708809003022022[24] = 0;
out_1163708809003022022[25] = 0;
out_1163708809003022022[26] = 0;
out_1163708809003022022[27] = 0;
out_1163708809003022022[28] = 0;
out_1163708809003022022[29] = 0;
out_1163708809003022022[30] = 0;
out_1163708809003022022[31] = 0;
out_1163708809003022022[32] = 0;
out_1163708809003022022[33] = 1;
out_1163708809003022022[34] = 0;
out_1163708809003022022[35] = 0;
out_1163708809003022022[36] = 1;
out_1163708809003022022[37] = 0;
out_1163708809003022022[38] = 0;
out_1163708809003022022[39] = 0;
out_1163708809003022022[40] = 0;
out_1163708809003022022[41] = 0;
out_1163708809003022022[42] = 0;
out_1163708809003022022[43] = 0;
out_1163708809003022022[44] = 0;
out_1163708809003022022[45] = 0;
out_1163708809003022022[46] = 0;
out_1163708809003022022[47] = 0;
out_1163708809003022022[48] = 0;
out_1163708809003022022[49] = 0;
out_1163708809003022022[50] = 0;
out_1163708809003022022[51] = 0;
out_1163708809003022022[52] = 0;
out_1163708809003022022[53] = 0;
out_1163708809003022022[54] = 0;
out_1163708809003022022[55] = 0;
out_1163708809003022022[56] = 1;
out_1163708809003022022[57] = 0;
out_1163708809003022022[58] = 0;
out_1163708809003022022[59] = 1;
out_1163708809003022022[60] = 0;
out_1163708809003022022[61] = 0;
out_1163708809003022022[62] = 0;
out_1163708809003022022[63] = 0;
out_1163708809003022022[64] = 0;
out_1163708809003022022[65] = 0;
}
void h_9(double *state, double *unused, double *out_2390193527998915912) {
out_2390193527998915912[0] = state[10];
out_2390193527998915912[1] = state[11];
out_2390193527998915912[2] = state[12];
}
void H_9(double *state, double *unused, double *out_8450927744267469492) {
out_8450927744267469492[0] = 0;
out_8450927744267469492[1] = 0;
out_8450927744267469492[2] = 0;
out_8450927744267469492[3] = 0;
out_8450927744267469492[4] = 0;
out_8450927744267469492[5] = 0;
out_8450927744267469492[6] = 0;
out_8450927744267469492[7] = 0;
out_8450927744267469492[8] = 0;
out_8450927744267469492[9] = 0;
out_8450927744267469492[10] = 1;
out_8450927744267469492[11] = 0;
out_8450927744267469492[12] = 0;
out_8450927744267469492[13] = 0;
out_8450927744267469492[14] = 0;
out_8450927744267469492[15] = 0;
out_8450927744267469492[16] = 0;
out_8450927744267469492[17] = 0;
out_8450927744267469492[18] = 0;
out_8450927744267469492[19] = 0;
out_8450927744267469492[20] = 0;
out_8450927744267469492[21] = 0;
out_8450927744267469492[22] = 0;
out_8450927744267469492[23] = 0;
out_8450927744267469492[24] = 0;
out_8450927744267469492[25] = 0;
out_8450927744267469492[26] = 0;
out_8450927744267469492[27] = 0;
out_8450927744267469492[28] = 0;
out_8450927744267469492[29] = 0;
out_8450927744267469492[30] = 0;
out_8450927744267469492[31] = 0;
out_8450927744267469492[32] = 0;
out_8450927744267469492[33] = 1;
out_8450927744267469492[34] = 0;
out_8450927744267469492[35] = 0;
out_8450927744267469492[36] = 0;
out_8450927744267469492[37] = 0;
out_8450927744267469492[38] = 0;
out_8450927744267469492[39] = 0;
out_8450927744267469492[40] = 0;
out_8450927744267469492[41] = 0;
out_8450927744267469492[42] = 0;
out_8450927744267469492[43] = 0;
out_8450927744267469492[44] = 0;
out_8450927744267469492[45] = 0;
out_8450927744267469492[46] = 0;
out_8450927744267469492[47] = 0;
out_8450927744267469492[48] = 0;
out_8450927744267469492[49] = 0;
out_8450927744267469492[50] = 0;
out_8450927744267469492[51] = 0;
out_8450927744267469492[52] = 0;
out_8450927744267469492[53] = 0;
out_8450927744267469492[54] = 0;
out_8450927744267469492[55] = 0;
out_8450927744267469492[56] = 1;
out_8450927744267469492[57] = 0;
out_8450927744267469492[58] = 0;
out_8450927744267469492[59] = 0;
out_8450927744267469492[60] = 0;
out_8450927744267469492[61] = 0;
out_8450927744267469492[62] = 0;
out_8450927744267469492[63] = 0;
out_8450927744267469492[64] = 0;
out_8450927744267469492[65] = 0;
}
void h_10(double *state, double *unused, double *out_4949516915644995188) {
out_4949516915644995188[0] = 398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0] + state[16] + state[19];
out_4949516915644995188[1] = 398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1] + state[17] + state[20];
out_4949516915644995188[2] = 398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[2] + state[18] + state[21];
}
void H_10(double *state, double *unused, double *out_2720952721708703855) {
out_2720952721708703855[0] = -1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*pow(state[0], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2));
out_2720952721708703855[1] = -1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[1], 2) + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0]*state[1];
out_2720952721708703855[2] = -1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[2], 2) + 398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0]*state[2];
out_2720952721708703855[3] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5];
out_2720952721708703855[4] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6];
out_2720952721708703855[5] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3];
out_2720952721708703855[6] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4];
out_2720952721708703855[7] = 0;
out_2720952721708703855[8] = 0;
out_2720952721708703855[9] = 0;
out_2720952721708703855[10] = 0;
out_2720952721708703855[11] = 0;
out_2720952721708703855[12] = 0;
out_2720952721708703855[13] = 0;
out_2720952721708703855[14] = 0;
out_2720952721708703855[15] = 0;
out_2720952721708703855[16] = 1;
out_2720952721708703855[17] = 0;
out_2720952721708703855[18] = 0;
out_2720952721708703855[19] = 1;
out_2720952721708703855[20] = 0;
out_2720952721708703855[21] = 0;
out_2720952721708703855[22] = -1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[0], 2) + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[0]*state[1];
out_2720952721708703855[23] = -1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*pow(state[1], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2));
out_2720952721708703855[24] = -1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[2], 2) + 398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1]*state[2];
out_2720952721708703855[25] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4];
out_2720952721708703855[26] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3];
out_2720952721708703855[27] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6];
out_2720952721708703855[28] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5];
out_2720952721708703855[29] = 0;
out_2720952721708703855[30] = 0;
out_2720952721708703855[31] = 0;
out_2720952721708703855[32] = 0;
out_2720952721708703855[33] = 0;
out_2720952721708703855[34] = 0;
out_2720952721708703855[35] = 0;
out_2720952721708703855[36] = 0;
out_2720952721708703855[37] = 0;
out_2720952721708703855[38] = 0;
out_2720952721708703855[39] = 1;
out_2720952721708703855[40] = 0;
out_2720952721708703855[41] = 0;
out_2720952721708703855[42] = 1;
out_2720952721708703855[43] = 0;
out_2720952721708703855[44] = -1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[0], 2) + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[0]*state[2];
out_2720952721708703855[45] = -1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[1], 2) + 398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[1]*state[2];
out_2720952721708703855[46] = -1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*pow(state[2], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2));
out_2720952721708703855[47] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3];
out_2720952721708703855[48] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4];
out_2720952721708703855[49] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5];
out_2720952721708703855[50] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6];
out_2720952721708703855[51] = 0;
out_2720952721708703855[52] = 0;
out_2720952721708703855[53] = 0;
out_2720952721708703855[54] = 0;
out_2720952721708703855[55] = 0;
out_2720952721708703855[56] = 0;
out_2720952721708703855[57] = 0;
out_2720952721708703855[58] = 0;
out_2720952721708703855[59] = 0;
out_2720952721708703855[60] = 0;
out_2720952721708703855[61] = 0;
out_2720952721708703855[62] = 1;
out_2720952721708703855[63] = 0;
out_2720952721708703855[64] = 0;
out_2720952721708703855[65] = 1;
}
void h_12(double *state, double *unused, double *out_6417586108362548470) {
out_6417586108362548470[0] = state[0];
out_6417586108362548470[1] = state[1];
out_6417586108362548470[2] = state[2];
}
void H_12(double *state, double *unused, double *out_8830837122685472514) {
out_8830837122685472514[0] = 1;
out_8830837122685472514[1] = 0;
out_8830837122685472514[2] = 0;
out_8830837122685472514[3] = 0;
out_8830837122685472514[4] = 0;
out_8830837122685472514[5] = 0;
out_8830837122685472514[6] = 0;
out_8830837122685472514[7] = 0;
out_8830837122685472514[8] = 0;
out_8830837122685472514[9] = 0;
out_8830837122685472514[10] = 0;
out_8830837122685472514[11] = 0;
out_8830837122685472514[12] = 0;
out_8830837122685472514[13] = 0;
out_8830837122685472514[14] = 0;
out_8830837122685472514[15] = 0;
out_8830837122685472514[16] = 0;
out_8830837122685472514[17] = 0;
out_8830837122685472514[18] = 0;
out_8830837122685472514[19] = 0;
out_8830837122685472514[20] = 0;
out_8830837122685472514[21] = 0;
out_8830837122685472514[22] = 0;
out_8830837122685472514[23] = 1;
out_8830837122685472514[24] = 0;
out_8830837122685472514[25] = 0;
out_8830837122685472514[26] = 0;
out_8830837122685472514[27] = 0;
out_8830837122685472514[28] = 0;
out_8830837122685472514[29] = 0;
out_8830837122685472514[30] = 0;
out_8830837122685472514[31] = 0;
out_8830837122685472514[32] = 0;
out_8830837122685472514[33] = 0;
out_8830837122685472514[34] = 0;
out_8830837122685472514[35] = 0;
out_8830837122685472514[36] = 0;
out_8830837122685472514[37] = 0;
out_8830837122685472514[38] = 0;
out_8830837122685472514[39] = 0;
out_8830837122685472514[40] = 0;
out_8830837122685472514[41] = 0;
out_8830837122685472514[42] = 0;
out_8830837122685472514[43] = 0;
out_8830837122685472514[44] = 0;
out_8830837122685472514[45] = 0;
out_8830837122685472514[46] = 1;
out_8830837122685472514[47] = 0;
out_8830837122685472514[48] = 0;
out_8830837122685472514[49] = 0;
out_8830837122685472514[50] = 0;
out_8830837122685472514[51] = 0;
out_8830837122685472514[52] = 0;
out_8830837122685472514[53] = 0;
out_8830837122685472514[54] = 0;
out_8830837122685472514[55] = 0;
out_8830837122685472514[56] = 0;
out_8830837122685472514[57] = 0;
out_8830837122685472514[58] = 0;
out_8830837122685472514[59] = 0;
out_8830837122685472514[60] = 0;
out_8830837122685472514[61] = 0;
out_8830837122685472514[62] = 0;
out_8830837122685472514[63] = 0;
out_8830837122685472514[64] = 0;
out_8830837122685472514[65] = 0;
}
void h_35(double *state, double *unused, double *out_4000387409650514689) {
out_4000387409650514689[0] = state[7];
out_4000387409650514689[1] = state[8];
out_4000387409650514689[2] = state[9];
}
void H_35(double *state, double *unused, double *out_4530370866375629398) {
out_4530370866375629398[0] = 0;
out_4530370866375629398[1] = 0;
out_4530370866375629398[2] = 0;
out_4530370866375629398[3] = 0;
out_4530370866375629398[4] = 0;
out_4530370866375629398[5] = 0;
out_4530370866375629398[6] = 0;
out_4530370866375629398[7] = 1;
out_4530370866375629398[8] = 0;
out_4530370866375629398[9] = 0;
out_4530370866375629398[10] = 0;
out_4530370866375629398[11] = 0;
out_4530370866375629398[12] = 0;
out_4530370866375629398[13] = 0;
out_4530370866375629398[14] = 0;
out_4530370866375629398[15] = 0;
out_4530370866375629398[16] = 0;
out_4530370866375629398[17] = 0;
out_4530370866375629398[18] = 0;
out_4530370866375629398[19] = 0;
out_4530370866375629398[20] = 0;
out_4530370866375629398[21] = 0;
out_4530370866375629398[22] = 0;
out_4530370866375629398[23] = 0;
out_4530370866375629398[24] = 0;
out_4530370866375629398[25] = 0;
out_4530370866375629398[26] = 0;
out_4530370866375629398[27] = 0;
out_4530370866375629398[28] = 0;
out_4530370866375629398[29] = 0;
out_4530370866375629398[30] = 1;
out_4530370866375629398[31] = 0;
out_4530370866375629398[32] = 0;
out_4530370866375629398[33] = 0;
out_4530370866375629398[34] = 0;
out_4530370866375629398[35] = 0;
out_4530370866375629398[36] = 0;
out_4530370866375629398[37] = 0;
out_4530370866375629398[38] = 0;
out_4530370866375629398[39] = 0;
out_4530370866375629398[40] = 0;
out_4530370866375629398[41] = 0;
out_4530370866375629398[42] = 0;
out_4530370866375629398[43] = 0;
out_4530370866375629398[44] = 0;
out_4530370866375629398[45] = 0;
out_4530370866375629398[46] = 0;
out_4530370866375629398[47] = 0;
out_4530370866375629398[48] = 0;
out_4530370866375629398[49] = 0;
out_4530370866375629398[50] = 0;
out_4530370866375629398[51] = 0;
out_4530370866375629398[52] = 0;
out_4530370866375629398[53] = 1;
out_4530370866375629398[54] = 0;
out_4530370866375629398[55] = 0;
out_4530370866375629398[56] = 0;
out_4530370866375629398[57] = 0;
out_4530370866375629398[58] = 0;
out_4530370866375629398[59] = 0;
out_4530370866375629398[60] = 0;
out_4530370866375629398[61] = 0;
out_4530370866375629398[62] = 0;
out_4530370866375629398[63] = 0;
out_4530370866375629398[64] = 0;
out_4530370866375629398[65] = 0;
}
void h_32(double *state, double *unused, double *out_5137988937425953647) {
out_5137988937425953647[0] = state[3];
out_5137988937425953647[1] = state[4];
out_5137988937425953647[2] = state[5];
out_5137988937425953647[3] = state[6];
}
void H_32(double *state, double *unused, double *out_4661535651316369867) {
out_4661535651316369867[0] = 0;
out_4661535651316369867[1] = 0;
out_4661535651316369867[2] = 0;
out_4661535651316369867[3] = 1;
out_4661535651316369867[4] = 0;
out_4661535651316369867[5] = 0;
out_4661535651316369867[6] = 0;
out_4661535651316369867[7] = 0;
out_4661535651316369867[8] = 0;
out_4661535651316369867[9] = 0;
out_4661535651316369867[10] = 0;
out_4661535651316369867[11] = 0;
out_4661535651316369867[12] = 0;
out_4661535651316369867[13] = 0;
out_4661535651316369867[14] = 0;
out_4661535651316369867[15] = 0;
out_4661535651316369867[16] = 0;
out_4661535651316369867[17] = 0;
out_4661535651316369867[18] = 0;
out_4661535651316369867[19] = 0;
out_4661535651316369867[20] = 0;
out_4661535651316369867[21] = 0;
out_4661535651316369867[22] = 0;
out_4661535651316369867[23] = 0;
out_4661535651316369867[24] = 0;
out_4661535651316369867[25] = 0;
out_4661535651316369867[26] = 1;
out_4661535651316369867[27] = 0;
out_4661535651316369867[28] = 0;
out_4661535651316369867[29] = 0;
out_4661535651316369867[30] = 0;
out_4661535651316369867[31] = 0;
out_4661535651316369867[32] = 0;
out_4661535651316369867[33] = 0;
out_4661535651316369867[34] = 0;
out_4661535651316369867[35] = 0;
out_4661535651316369867[36] = 0;
out_4661535651316369867[37] = 0;
out_4661535651316369867[38] = 0;
out_4661535651316369867[39] = 0;
out_4661535651316369867[40] = 0;
out_4661535651316369867[41] = 0;
out_4661535651316369867[42] = 0;
out_4661535651316369867[43] = 0;
out_4661535651316369867[44] = 0;
out_4661535651316369867[45] = 0;
out_4661535651316369867[46] = 0;
out_4661535651316369867[47] = 0;
out_4661535651316369867[48] = 0;
out_4661535651316369867[49] = 1;
out_4661535651316369867[50] = 0;
out_4661535651316369867[51] = 0;
out_4661535651316369867[52] = 0;
out_4661535651316369867[53] = 0;
out_4661535651316369867[54] = 0;
out_4661535651316369867[55] = 0;
out_4661535651316369867[56] = 0;
out_4661535651316369867[57] = 0;
out_4661535651316369867[58] = 0;
out_4661535651316369867[59] = 0;
out_4661535651316369867[60] = 0;
out_4661535651316369867[61] = 0;
out_4661535651316369867[62] = 0;
out_4661535651316369867[63] = 0;
out_4661535651316369867[64] = 0;
out_4661535651316369867[65] = 0;
out_4661535651316369867[66] = 0;
out_4661535651316369867[67] = 0;
out_4661535651316369867[68] = 0;
out_4661535651316369867[69] = 0;
out_4661535651316369867[70] = 0;
out_4661535651316369867[71] = 0;
out_4661535651316369867[72] = 1;
out_4661535651316369867[73] = 0;
out_4661535651316369867[74] = 0;
out_4661535651316369867[75] = 0;
out_4661535651316369867[76] = 0;
out_4661535651316369867[77] = 0;
out_4661535651316369867[78] = 0;
out_4661535651316369867[79] = 0;
out_4661535651316369867[80] = 0;
out_4661535651316369867[81] = 0;
out_4661535651316369867[82] = 0;
out_4661535651316369867[83] = 0;
out_4661535651316369867[84] = 0;
out_4661535651316369867[85] = 0;
out_4661535651316369867[86] = 0;
out_4661535651316369867[87] = 0;
}
void h_13(double *state, double *unused, double *out_433309107792795920) {
out_433309107792795920[0] = (-2*state[3]*state[5] + 2*state[4]*state[6])*state[9] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[8] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[7];
out_433309107792795920[1] = (2*state[3]*state[4] + 2*state[5]*state[6])*state[9] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[7] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[8];
out_433309107792795920[2] = (-2*state[3]*state[4] + 2*state[5]*state[6])*state[8] + (2*state[3]*state[5] + 2*state[4]*state[6])*state[7] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[9];
}
void H_13(double *state, double *unused, double *out_4947836704050735313) {
out_4947836704050735313[0] = 0;
out_4947836704050735313[1] = 0;
out_4947836704050735313[2] = 0;
out_4947836704050735313[3] = 2*state[3]*state[7] - 2*state[5]*state[9] + 2*state[6]*state[8];
out_4947836704050735313[4] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9];
out_4947836704050735313[5] = -2*state[3]*state[9] + 2*state[4]*state[8] - 2*state[5]*state[7];
out_4947836704050735313[6] = 2*state[3]*state[8] + 2*state[4]*state[9] - 2*state[6]*state[7];
out_4947836704050735313[7] = pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2);
out_4947836704050735313[8] = 2*state[3]*state[6] + 2*state[4]*state[5];
out_4947836704050735313[9] = -2*state[3]*state[5] + 2*state[4]*state[6];
out_4947836704050735313[10] = 0;
out_4947836704050735313[11] = 0;
out_4947836704050735313[12] = 0;
out_4947836704050735313[13] = 0;
out_4947836704050735313[14] = 0;
out_4947836704050735313[15] = 0;
out_4947836704050735313[16] = 0;
out_4947836704050735313[17] = 0;
out_4947836704050735313[18] = 0;
out_4947836704050735313[19] = 0;
out_4947836704050735313[20] = 0;
out_4947836704050735313[21] = 0;
out_4947836704050735313[22] = 0;
out_4947836704050735313[23] = 0;
out_4947836704050735313[24] = 0;
out_4947836704050735313[25] = 2*state[3]*state[8] + 2*state[4]*state[9] - 2*state[6]*state[7];
out_4947836704050735313[26] = 2*state[3]*state[9] - 2*state[4]*state[8] + 2*state[5]*state[7];
out_4947836704050735313[27] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9];
out_4947836704050735313[28] = -2*state[3]*state[7] + 2*state[5]*state[9] - 2*state[6]*state[8];
out_4947836704050735313[29] = -2*state[3]*state[6] + 2*state[4]*state[5];
out_4947836704050735313[30] = pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2);
out_4947836704050735313[31] = 2*state[3]*state[4] + 2*state[5]*state[6];
out_4947836704050735313[32] = 0;
out_4947836704050735313[33] = 0;
out_4947836704050735313[34] = 0;
out_4947836704050735313[35] = 0;
out_4947836704050735313[36] = 0;
out_4947836704050735313[37] = 0;
out_4947836704050735313[38] = 0;
out_4947836704050735313[39] = 0;
out_4947836704050735313[40] = 0;
out_4947836704050735313[41] = 0;
out_4947836704050735313[42] = 0;
out_4947836704050735313[43] = 0;
out_4947836704050735313[44] = 0;
out_4947836704050735313[45] = 0;
out_4947836704050735313[46] = 0;
out_4947836704050735313[47] = 2*state[3]*state[9] - 2*state[4]*state[8] + 2*state[5]*state[7];
out_4947836704050735313[48] = -2*state[3]*state[8] - 2*state[4]*state[9] + 2*state[6]*state[7];
out_4947836704050735313[49] = 2*state[3]*state[7] - 2*state[5]*state[9] + 2*state[6]*state[8];
out_4947836704050735313[50] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9];
out_4947836704050735313[51] = 2*state[3]*state[5] + 2*state[4]*state[6];
out_4947836704050735313[52] = -2*state[3]*state[4] + 2*state[5]*state[6];
out_4947836704050735313[53] = pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2);
out_4947836704050735313[54] = 0;
out_4947836704050735313[55] = 0;
out_4947836704050735313[56] = 0;
out_4947836704050735313[57] = 0;
out_4947836704050735313[58] = 0;
out_4947836704050735313[59] = 0;
out_4947836704050735313[60] = 0;
out_4947836704050735313[61] = 0;
out_4947836704050735313[62] = 0;
out_4947836704050735313[63] = 0;
out_4947836704050735313[64] = 0;
out_4947836704050735313[65] = 0;
}
void h_14(double *state, double *unused, double *out_2390193527998915912) {
out_2390193527998915912[0] = state[10];
out_2390193527998915912[1] = state[11];
out_2390193527998915912[2] = state[12];
}
void H_14(double *state, double *unused, double *out_8450927744267469492) {
out_8450927744267469492[0] = 0;
out_8450927744267469492[1] = 0;
out_8450927744267469492[2] = 0;
out_8450927744267469492[3] = 0;
out_8450927744267469492[4] = 0;
out_8450927744267469492[5] = 0;
out_8450927744267469492[6] = 0;
out_8450927744267469492[7] = 0;
out_8450927744267469492[8] = 0;
out_8450927744267469492[9] = 0;
out_8450927744267469492[10] = 1;
out_8450927744267469492[11] = 0;
out_8450927744267469492[12] = 0;
out_8450927744267469492[13] = 0;
out_8450927744267469492[14] = 0;
out_8450927744267469492[15] = 0;
out_8450927744267469492[16] = 0;
out_8450927744267469492[17] = 0;
out_8450927744267469492[18] = 0;
out_8450927744267469492[19] = 0;
out_8450927744267469492[20] = 0;
out_8450927744267469492[21] = 0;
out_8450927744267469492[22] = 0;
out_8450927744267469492[23] = 0;
out_8450927744267469492[24] = 0;
out_8450927744267469492[25] = 0;
out_8450927744267469492[26] = 0;
out_8450927744267469492[27] = 0;
out_8450927744267469492[28] = 0;
out_8450927744267469492[29] = 0;
out_8450927744267469492[30] = 0;
out_8450927744267469492[31] = 0;
out_8450927744267469492[32] = 0;
out_8450927744267469492[33] = 1;
out_8450927744267469492[34] = 0;
out_8450927744267469492[35] = 0;
out_8450927744267469492[36] = 0;
out_8450927744267469492[37] = 0;
out_8450927744267469492[38] = 0;
out_8450927744267469492[39] = 0;
out_8450927744267469492[40] = 0;
out_8450927744267469492[41] = 0;
out_8450927744267469492[42] = 0;
out_8450927744267469492[43] = 0;
out_8450927744267469492[44] = 0;
out_8450927744267469492[45] = 0;
out_8450927744267469492[46] = 0;
out_8450927744267469492[47] = 0;
out_8450927744267469492[48] = 0;
out_8450927744267469492[49] = 0;
out_8450927744267469492[50] = 0;
out_8450927744267469492[51] = 0;
out_8450927744267469492[52] = 0;
out_8450927744267469492[53] = 0;
out_8450927744267469492[54] = 0;
out_8450927744267469492[55] = 0;
out_8450927744267469492[56] = 1;
out_8450927744267469492[57] = 0;
out_8450927744267469492[58] = 0;
out_8450927744267469492[59] = 0;
out_8450927744267469492[60] = 0;
out_8450927744267469492[61] = 0;
out_8450927744267469492[62] = 0;
out_8450927744267469492[63] = 0;
out_8450927744267469492[64] = 0;
out_8450927744267469492[65] = 0;
}
void h_33(double *state, double *unused, double *out_183207223102128485) {
out_183207223102128485[0] = state[16];
out_183207223102128485[1] = state[17];
out_183207223102128485[2] = state[18];
}
void H_33(double *state, double *unused, double *out_7680927871014487002) {
out_7680927871014487002[0] = 0;
out_7680927871014487002[1] = 0;
out_7680927871014487002[2] = 0;
out_7680927871014487002[3] = 0;
out_7680927871014487002[4] = 0;
out_7680927871014487002[5] = 0;
out_7680927871014487002[6] = 0;
out_7680927871014487002[7] = 0;
out_7680927871014487002[8] = 0;
out_7680927871014487002[9] = 0;
out_7680927871014487002[10] = 0;
out_7680927871014487002[11] = 0;
out_7680927871014487002[12] = 0;
out_7680927871014487002[13] = 0;
out_7680927871014487002[14] = 0;
out_7680927871014487002[15] = 0;
out_7680927871014487002[16] = 1;
out_7680927871014487002[17] = 0;
out_7680927871014487002[18] = 0;
out_7680927871014487002[19] = 0;
out_7680927871014487002[20] = 0;
out_7680927871014487002[21] = 0;
out_7680927871014487002[22] = 0;
out_7680927871014487002[23] = 0;
out_7680927871014487002[24] = 0;
out_7680927871014487002[25] = 0;
out_7680927871014487002[26] = 0;
out_7680927871014487002[27] = 0;
out_7680927871014487002[28] = 0;
out_7680927871014487002[29] = 0;
out_7680927871014487002[30] = 0;
out_7680927871014487002[31] = 0;
out_7680927871014487002[32] = 0;
out_7680927871014487002[33] = 0;
out_7680927871014487002[34] = 0;
out_7680927871014487002[35] = 0;
out_7680927871014487002[36] = 0;
out_7680927871014487002[37] = 0;
out_7680927871014487002[38] = 0;
out_7680927871014487002[39] = 1;
out_7680927871014487002[40] = 0;
out_7680927871014487002[41] = 0;
out_7680927871014487002[42] = 0;
out_7680927871014487002[43] = 0;
out_7680927871014487002[44] = 0;
out_7680927871014487002[45] = 0;
out_7680927871014487002[46] = 0;
out_7680927871014487002[47] = 0;
out_7680927871014487002[48] = 0;
out_7680927871014487002[49] = 0;
out_7680927871014487002[50] = 0;
out_7680927871014487002[51] = 0;
out_7680927871014487002[52] = 0;
out_7680927871014487002[53] = 0;
out_7680927871014487002[54] = 0;
out_7680927871014487002[55] = 0;
out_7680927871014487002[56] = 0;
out_7680927871014487002[57] = 0;
out_7680927871014487002[58] = 0;
out_7680927871014487002[59] = 0;
out_7680927871014487002[60] = 0;
out_7680927871014487002[61] = 0;
out_7680927871014487002[62] = 1;
out_7680927871014487002[63] = 0;
out_7680927871014487002[64] = 0;
out_7680927871014487002[65] = 0;
}
#include <eigen3/Eigen/Dense>
#include <iostream>
typedef Eigen::Matrix<double, DIM, DIM, Eigen::RowMajor> DDM;
typedef Eigen::Matrix<double, EDIM, EDIM, Eigen::RowMajor> EEM;
typedef Eigen::Matrix<double, DIM, EDIM, Eigen::RowMajor> DEM;
void predict(double *in_x, double *in_P, double *in_Q, double dt) {
typedef Eigen::Matrix<double, MEDIM, MEDIM, Eigen::RowMajor> RRM;
double nx[DIM] = {0};
double in_F[EDIM*EDIM] = {0};
// functions from sympy
f_fun(in_x, dt, nx);
F_fun(in_x, dt, in_F);
EEM F(in_F);
EEM P(in_P);
EEM Q(in_Q);
RRM F_main = F.topLeftCorner(MEDIM, MEDIM);
P.topLeftCorner(MEDIM, MEDIM) = (F_main * P.topLeftCorner(MEDIM, MEDIM)) * F_main.transpose();
P.topRightCorner(MEDIM, EDIM - MEDIM) = F_main * P.topRightCorner(MEDIM, EDIM - MEDIM);
P.bottomLeftCorner(EDIM - MEDIM, MEDIM) = P.bottomLeftCorner(EDIM - MEDIM, MEDIM) * F_main.transpose();
P = P + dt*Q;
// copy out state
memcpy(in_x, nx, DIM * sizeof(double));
memcpy(in_P, P.data(), EDIM * EDIM * sizeof(double));
}
// note: extra_args dim only correct when null space projecting
// otherwise 1
template <int ZDIM, int EADIM, bool MAHA_TEST>
void update(double *in_x, double *in_P, Hfun h_fun, Hfun H_fun, Hfun Hea_fun, double *in_z, double *in_R, double *in_ea, double MAHA_THRESHOLD) {
typedef Eigen::Matrix<double, ZDIM, ZDIM, Eigen::RowMajor> ZZM;
typedef Eigen::Matrix<double, ZDIM, DIM, Eigen::RowMajor> ZDM;
typedef Eigen::Matrix<double, Eigen::Dynamic, EDIM, Eigen::RowMajor> XEM;
//typedef Eigen::Matrix<double, EDIM, ZDIM, Eigen::RowMajor> EZM;
typedef Eigen::Matrix<double, Eigen::Dynamic, 1> X1M;
typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> XXM;
double in_hx[ZDIM] = {0};
double in_H[ZDIM * DIM] = {0};
double in_H_mod[EDIM * DIM] = {0};
double delta_x[EDIM] = {0};
double x_new[DIM] = {0};
// state x, P
Eigen::Matrix<double, ZDIM, 1> z(in_z);
EEM P(in_P);
ZZM pre_R(in_R);
// functions from sympy
h_fun(in_x, in_ea, in_hx);
H_fun(in_x, in_ea, in_H);
ZDM pre_H(in_H);
// get y (y = z - hx)
Eigen::Matrix<double, ZDIM, 1> pre_y(in_hx); pre_y = z - pre_y;
X1M y; XXM H; XXM R;
if (Hea_fun){
typedef Eigen::Matrix<double, ZDIM, EADIM, Eigen::RowMajor> ZAM;
double in_Hea[ZDIM * EADIM] = {0};
Hea_fun(in_x, in_ea, in_Hea);
ZAM Hea(in_Hea);
XXM A = Hea.transpose().fullPivLu().kernel();
y = A.transpose() * pre_y;
H = A.transpose() * pre_H;
R = A.transpose() * pre_R * A;
} else {
y = pre_y;
H = pre_H;
R = pre_R;
}
// get modified H
H_mod_fun(in_x, in_H_mod);
DEM H_mod(in_H_mod);
XEM H_err = H * H_mod;
// Do mahalobis distance test
if (MAHA_TEST){
XXM a = (H_err * P * H_err.transpose() + R).inverse();
double maha_dist = y.transpose() * a * y;
if (maha_dist > MAHA_THRESHOLD){
R = 1.0e16 * R;
}
}
// Outlier resilient weighting
double weight = 1;//(1.5)/(1 + y.squaredNorm()/R.sum());
// kalman gains and I_KH
XXM S = ((H_err * P) * H_err.transpose()) + R/weight;
XEM KT = S.fullPivLu().solve(H_err * P.transpose());
//EZM K = KT.transpose(); TODO: WHY DOES THIS NOT COMPILE?
//EZM K = S.fullPivLu().solve(H_err * P.transpose()).transpose();
//std::cout << "Here is the matrix rot:\n" << K << std::endl;
EEM I_KH = Eigen::Matrix<double, EDIM, EDIM>::Identity() - (KT.transpose() * H_err);
// update state by injecting dx
Eigen::Matrix<double, EDIM, 1> dx(delta_x);
dx = (KT.transpose() * y);
memcpy(delta_x, dx.data(), EDIM * sizeof(double));
err_fun(in_x, delta_x, x_new);
Eigen::Matrix<double, DIM, 1> x(x_new);
// update cov
P = ((I_KH * P) * I_KH.transpose()) + ((KT.transpose() * R) * KT);
// copy out state
memcpy(in_x, x.data(), DIM * sizeof(double));
memcpy(in_P, P.data(), EDIM * EDIM * sizeof(double));
memcpy(in_z, y.data(), y.rows() * sizeof(double));
}
}
extern "C" {
void live_update_4(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
update<3, 3, 0>(in_x, in_P, h_4, H_4, NULL, in_z, in_R, in_ea, MAHA_THRESH_4);
}
void live_update_9(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
update<3, 3, 0>(in_x, in_P, h_9, H_9, NULL, in_z, in_R, in_ea, MAHA_THRESH_9);
}
void live_update_10(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
update<3, 3, 0>(in_x, in_P, h_10, H_10, NULL, in_z, in_R, in_ea, MAHA_THRESH_10);
}
void live_update_12(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
update<3, 3, 0>(in_x, in_P, h_12, H_12, NULL, in_z, in_R, in_ea, MAHA_THRESH_12);
}
void live_update_35(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
update<3, 3, 0>(in_x, in_P, h_35, H_35, NULL, in_z, in_R, in_ea, MAHA_THRESH_35);
}
void live_update_32(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
update<4, 3, 0>(in_x, in_P, h_32, H_32, NULL, in_z, in_R, in_ea, MAHA_THRESH_32);
}
void live_update_13(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
update<3, 3, 0>(in_x, in_P, h_13, H_13, NULL, in_z, in_R, in_ea, MAHA_THRESH_13);
}
void live_update_14(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
update<3, 3, 0>(in_x, in_P, h_14, H_14, NULL, in_z, in_R, in_ea, MAHA_THRESH_14);
}
void live_update_33(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
update<3, 3, 0>(in_x, in_P, h_33, H_33, NULL, in_z, in_R, in_ea, MAHA_THRESH_33);
}
void live_H(double *in_vec, double *out_4323635268615141267) {
H(in_vec, out_4323635268615141267);
}
void live_err_fun(double *nom_x, double *delta_x, double *out_6197074480032553231) {
err_fun(nom_x, delta_x, out_6197074480032553231);
}
void live_inv_err_fun(double *nom_x, double *true_x, double *out_2989387618240936660) {
inv_err_fun(nom_x, true_x, out_2989387618240936660);
}
void live_H_mod_fun(double *state, double *out_6613539539070352198) {
H_mod_fun(state, out_6613539539070352198);
}
void live_f_fun(double *state, double dt, double *out_8933377197583675948) {
f_fun(state, dt, out_8933377197583675948);
}
void live_F_fun(double *state, double dt, double *out_3718350443949690231) {
F_fun(state, dt, out_3718350443949690231);
}
void live_h_4(double *state, double *unused, double *out_6331268052836927497) {
h_4(state, unused, out_6331268052836927497);
}
void live_H_4(double *state, double *unused, double *out_1163708809003022022) {
H_4(state, unused, out_1163708809003022022);
}
void live_h_9(double *state, double *unused, double *out_2390193527998915912) {
h_9(state, unused, out_2390193527998915912);
}
void live_H_9(double *state, double *unused, double *out_8450927744267469492) {
H_9(state, unused, out_8450927744267469492);
}
void live_h_10(double *state, double *unused, double *out_4949516915644995188) {
h_10(state, unused, out_4949516915644995188);
}
void live_H_10(double *state, double *unused, double *out_2720952721708703855) {
H_10(state, unused, out_2720952721708703855);
}
void live_h_12(double *state, double *unused, double *out_6417586108362548470) {
h_12(state, unused, out_6417586108362548470);
}
void live_H_12(double *state, double *unused, double *out_8830837122685472514) {
H_12(state, unused, out_8830837122685472514);
}
void live_h_35(double *state, double *unused, double *out_4000387409650514689) {
h_35(state, unused, out_4000387409650514689);
}
void live_H_35(double *state, double *unused, double *out_4530370866375629398) {
H_35(state, unused, out_4530370866375629398);
}
void live_h_32(double *state, double *unused, double *out_5137988937425953647) {
h_32(state, unused, out_5137988937425953647);
}
void live_H_32(double *state, double *unused, double *out_4661535651316369867) {
H_32(state, unused, out_4661535651316369867);
}
void live_h_13(double *state, double *unused, double *out_433309107792795920) {
h_13(state, unused, out_433309107792795920);
}
void live_H_13(double *state, double *unused, double *out_4947836704050735313) {
H_13(state, unused, out_4947836704050735313);
}
void live_h_14(double *state, double *unused, double *out_2390193527998915912) {
h_14(state, unused, out_2390193527998915912);
}
void live_H_14(double *state, double *unused, double *out_8450927744267469492) {
H_14(state, unused, out_8450927744267469492);
}
void live_h_33(double *state, double *unused, double *out_183207223102128485) {
h_33(state, unused, out_183207223102128485);
}
void live_H_33(double *state, double *unused, double *out_7680927871014487002) {
H_33(state, unused, out_7680927871014487002);
}
void live_predict(double *in_x, double *in_P, double *in_Q, double dt) {
predict(in_x, in_P, in_Q, dt);
}
}
const EKF live = {
.name = "live",
.kinds = { 4, 9, 10, 12, 35, 32, 13, 14, 33 },
.feature_kinds = { },
.f_fun = live_f_fun,
.F_fun = live_F_fun,
.err_fun = live_err_fun,
.inv_err_fun = live_inv_err_fun,
.H_mod_fun = live_H_mod_fun,
.predict = live_predict,
.hs = {
{ 4, live_h_4 },
{ 9, live_h_9 },
{ 10, live_h_10 },
{ 12, live_h_12 },
{ 35, live_h_35 },
{ 32, live_h_32 },
{ 13, live_h_13 },
{ 14, live_h_14 },
{ 33, live_h_33 },
},
.Hs = {
{ 4, live_H_4 },
{ 9, live_H_9 },
{ 10, live_H_10 },
{ 12, live_H_12 },
{ 35, live_H_35 },
{ 32, live_H_32 },
{ 13, live_H_13 },
{ 14, live_H_14 },
{ 33, live_H_33 },
},
.updates = {
{ 4, live_update_4 },
{ 9, live_update_9 },
{ 10, live_update_10 },
{ 12, live_update_12 },
{ 35, live_update_35 },
{ 32, live_update_32 },
{ 13, live_update_13 },
{ 14, live_update_14 },
{ 33, live_update_33 },
},
.Hes = {
},
.sets = {
},
.extra_routines = {
{ "H", live_H },
},
};
ekf_lib_init(live)