dragonpilot - 基於 openpilot 的開源駕駛輔助系統
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1988 lines
90 KiB

#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.9 *
* *
* See http://www.sympy.org/ for more information. *
* *
* This file is part of 'ekf' *
******************************************************************************/
void H(double *in_vec, double *out_6690968010248080223) {
out_6690968010248080223[0] = 0;
out_6690968010248080223[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_6690968010248080223[2] = -sin(in_vec[2])*cos(in_vec[1])*in_vec[3] + cos(in_vec[1])*cos(in_vec[2])*in_vec[4];
out_6690968010248080223[3] = cos(in_vec[1])*cos(in_vec[2]);
out_6690968010248080223[4] = sin(in_vec[2])*cos(in_vec[1]);
out_6690968010248080223[5] = -sin(in_vec[1]);
out_6690968010248080223[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_6690968010248080223[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_6690968010248080223[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_6690968010248080223[9] = sin(in_vec[0])*sin(in_vec[1])*cos(in_vec[2]) - sin(in_vec[2])*cos(in_vec[0]);
out_6690968010248080223[10] = sin(in_vec[0])*sin(in_vec[1])*sin(in_vec[2]) + cos(in_vec[0])*cos(in_vec[2]);
out_6690968010248080223[11] = sin(in_vec[0])*cos(in_vec[1]);
out_6690968010248080223[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_6690968010248080223[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_6690968010248080223[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_6690968010248080223[15] = sin(in_vec[0])*sin(in_vec[2]) + sin(in_vec[1])*cos(in_vec[0])*cos(in_vec[2]);
out_6690968010248080223[16] = -sin(in_vec[0])*cos(in_vec[2]) + sin(in_vec[1])*sin(in_vec[2])*cos(in_vec[0]);
out_6690968010248080223[17] = cos(in_vec[0])*cos(in_vec[1]);
}
void err_fun(double *nom_x, double *delta_x, double *out_5128644486154966433) {
out_5128644486154966433[0] = delta_x[0] + nom_x[0];
out_5128644486154966433[1] = delta_x[1] + nom_x[1];
out_5128644486154966433[2] = delta_x[2] + nom_x[2];
out_5128644486154966433[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_5128644486154966433[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_5128644486154966433[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_5128644486154966433[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_5128644486154966433[7] = delta_x[6] + nom_x[7];
out_5128644486154966433[8] = delta_x[7] + nom_x[8];
out_5128644486154966433[9] = delta_x[8] + nom_x[9];
out_5128644486154966433[10] = delta_x[9] + nom_x[10];
out_5128644486154966433[11] = delta_x[10] + nom_x[11];
out_5128644486154966433[12] = delta_x[11] + nom_x[12];
out_5128644486154966433[13] = delta_x[12] + nom_x[13];
out_5128644486154966433[14] = delta_x[13] + nom_x[14];
out_5128644486154966433[15] = delta_x[14] + nom_x[15];
out_5128644486154966433[16] = delta_x[15] + nom_x[16];
out_5128644486154966433[17] = delta_x[16] + nom_x[17];
out_5128644486154966433[18] = delta_x[17] + nom_x[18];
out_5128644486154966433[19] = delta_x[18] + nom_x[19];
out_5128644486154966433[20] = delta_x[19] + nom_x[20];
out_5128644486154966433[21] = delta_x[20] + nom_x[21];
}
void inv_err_fun(double *nom_x, double *true_x, double *out_7600355658971333284) {
out_7600355658971333284[0] = -nom_x[0] + true_x[0];
out_7600355658971333284[1] = -nom_x[1] + true_x[1];
out_7600355658971333284[2] = -nom_x[2] + true_x[2];
out_7600355658971333284[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_7600355658971333284[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_7600355658971333284[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_7600355658971333284[6] = -nom_x[7] + true_x[7];
out_7600355658971333284[7] = -nom_x[8] + true_x[8];
out_7600355658971333284[8] = -nom_x[9] + true_x[9];
out_7600355658971333284[9] = -nom_x[10] + true_x[10];
out_7600355658971333284[10] = -nom_x[11] + true_x[11];
out_7600355658971333284[11] = -nom_x[12] + true_x[12];
out_7600355658971333284[12] = -nom_x[13] + true_x[13];
out_7600355658971333284[13] = -nom_x[14] + true_x[14];
out_7600355658971333284[14] = -nom_x[15] + true_x[15];
out_7600355658971333284[15] = -nom_x[16] + true_x[16];
out_7600355658971333284[16] = -nom_x[17] + true_x[17];
out_7600355658971333284[17] = -nom_x[18] + true_x[18];
out_7600355658971333284[18] = -nom_x[19] + true_x[19];
out_7600355658971333284[19] = -nom_x[20] + true_x[20];
out_7600355658971333284[20] = -nom_x[21] + true_x[21];
}
void H_mod_fun(double *state, double *out_1685726956674156760) {
out_1685726956674156760[0] = 1.0;
out_1685726956674156760[1] = 0;
out_1685726956674156760[2] = 0;
out_1685726956674156760[3] = 0;
out_1685726956674156760[4] = 0;
out_1685726956674156760[5] = 0;
out_1685726956674156760[6] = 0;
out_1685726956674156760[7] = 0;
out_1685726956674156760[8] = 0;
out_1685726956674156760[9] = 0;
out_1685726956674156760[10] = 0;
out_1685726956674156760[11] = 0;
out_1685726956674156760[12] = 0;
out_1685726956674156760[13] = 0;
out_1685726956674156760[14] = 0;
out_1685726956674156760[15] = 0;
out_1685726956674156760[16] = 0;
out_1685726956674156760[17] = 0;
out_1685726956674156760[18] = 0;
out_1685726956674156760[19] = 0;
out_1685726956674156760[20] = 0;
out_1685726956674156760[21] = 0;
out_1685726956674156760[22] = 1.0;
out_1685726956674156760[23] = 0;
out_1685726956674156760[24] = 0;
out_1685726956674156760[25] = 0;
out_1685726956674156760[26] = 0;
out_1685726956674156760[27] = 0;
out_1685726956674156760[28] = 0;
out_1685726956674156760[29] = 0;
out_1685726956674156760[30] = 0;
out_1685726956674156760[31] = 0;
out_1685726956674156760[32] = 0;
out_1685726956674156760[33] = 0;
out_1685726956674156760[34] = 0;
out_1685726956674156760[35] = 0;
out_1685726956674156760[36] = 0;
out_1685726956674156760[37] = 0;
out_1685726956674156760[38] = 0;
out_1685726956674156760[39] = 0;
out_1685726956674156760[40] = 0;
out_1685726956674156760[41] = 0;
out_1685726956674156760[42] = 0;
out_1685726956674156760[43] = 0;
out_1685726956674156760[44] = 1.0;
out_1685726956674156760[45] = 0;
out_1685726956674156760[46] = 0;
out_1685726956674156760[47] = 0;
out_1685726956674156760[48] = 0;
out_1685726956674156760[49] = 0;
out_1685726956674156760[50] = 0;
out_1685726956674156760[51] = 0;
out_1685726956674156760[52] = 0;
out_1685726956674156760[53] = 0;
out_1685726956674156760[54] = 0;
out_1685726956674156760[55] = 0;
out_1685726956674156760[56] = 0;
out_1685726956674156760[57] = 0;
out_1685726956674156760[58] = 0;
out_1685726956674156760[59] = 0;
out_1685726956674156760[60] = 0;
out_1685726956674156760[61] = 0;
out_1685726956674156760[62] = 0;
out_1685726956674156760[63] = 0;
out_1685726956674156760[64] = 0;
out_1685726956674156760[65] = 0;
out_1685726956674156760[66] = -0.5*state[4];
out_1685726956674156760[67] = -0.5*state[5];
out_1685726956674156760[68] = -0.5*state[6];
out_1685726956674156760[69] = 0;
out_1685726956674156760[70] = 0;
out_1685726956674156760[71] = 0;
out_1685726956674156760[72] = 0;
out_1685726956674156760[73] = 0;
out_1685726956674156760[74] = 0;
out_1685726956674156760[75] = 0;
out_1685726956674156760[76] = 0;
out_1685726956674156760[77] = 0;
out_1685726956674156760[78] = 0;
out_1685726956674156760[79] = 0;
out_1685726956674156760[80] = 0;
out_1685726956674156760[81] = 0;
out_1685726956674156760[82] = 0;
out_1685726956674156760[83] = 0;
out_1685726956674156760[84] = 0;
out_1685726956674156760[85] = 0;
out_1685726956674156760[86] = 0;
out_1685726956674156760[87] = 0.5*state[3];
out_1685726956674156760[88] = 0.5*state[6];
out_1685726956674156760[89] = -0.5*state[5];
out_1685726956674156760[90] = 0;
out_1685726956674156760[91] = 0;
out_1685726956674156760[92] = 0;
out_1685726956674156760[93] = 0;
out_1685726956674156760[94] = 0;
out_1685726956674156760[95] = 0;
out_1685726956674156760[96] = 0;
out_1685726956674156760[97] = 0;
out_1685726956674156760[98] = 0;
out_1685726956674156760[99] = 0;
out_1685726956674156760[100] = 0;
out_1685726956674156760[101] = 0;
out_1685726956674156760[102] = 0;
out_1685726956674156760[103] = 0;
out_1685726956674156760[104] = 0;
out_1685726956674156760[105] = 0;
out_1685726956674156760[106] = 0;
out_1685726956674156760[107] = 0;
out_1685726956674156760[108] = -0.5*state[6];
out_1685726956674156760[109] = 0.5*state[3];
out_1685726956674156760[110] = 0.5*state[4];
out_1685726956674156760[111] = 0;
out_1685726956674156760[112] = 0;
out_1685726956674156760[113] = 0;
out_1685726956674156760[114] = 0;
out_1685726956674156760[115] = 0;
out_1685726956674156760[116] = 0;
out_1685726956674156760[117] = 0;
out_1685726956674156760[118] = 0;
out_1685726956674156760[119] = 0;
out_1685726956674156760[120] = 0;
out_1685726956674156760[121] = 0;
out_1685726956674156760[122] = 0;
out_1685726956674156760[123] = 0;
out_1685726956674156760[124] = 0;
out_1685726956674156760[125] = 0;
out_1685726956674156760[126] = 0;
out_1685726956674156760[127] = 0;
out_1685726956674156760[128] = 0;
out_1685726956674156760[129] = 0.5*state[5];
out_1685726956674156760[130] = -0.5*state[4];
out_1685726956674156760[131] = 0.5*state[3];
out_1685726956674156760[132] = 0;
out_1685726956674156760[133] = 0;
out_1685726956674156760[134] = 0;
out_1685726956674156760[135] = 0;
out_1685726956674156760[136] = 0;
out_1685726956674156760[137] = 0;
out_1685726956674156760[138] = 0;
out_1685726956674156760[139] = 0;
out_1685726956674156760[140] = 0;
out_1685726956674156760[141] = 0;
out_1685726956674156760[142] = 0;
out_1685726956674156760[143] = 0;
out_1685726956674156760[144] = 0;
out_1685726956674156760[145] = 0;
out_1685726956674156760[146] = 0;
out_1685726956674156760[147] = 0;
out_1685726956674156760[148] = 0;
out_1685726956674156760[149] = 0;
out_1685726956674156760[150] = 0;
out_1685726956674156760[151] = 0;
out_1685726956674156760[152] = 0;
out_1685726956674156760[153] = 1.0;
out_1685726956674156760[154] = 0;
out_1685726956674156760[155] = 0;
out_1685726956674156760[156] = 0;
out_1685726956674156760[157] = 0;
out_1685726956674156760[158] = 0;
out_1685726956674156760[159] = 0;
out_1685726956674156760[160] = 0;
out_1685726956674156760[161] = 0;
out_1685726956674156760[162] = 0;
out_1685726956674156760[163] = 0;
out_1685726956674156760[164] = 0;
out_1685726956674156760[165] = 0;
out_1685726956674156760[166] = 0;
out_1685726956674156760[167] = 0;
out_1685726956674156760[168] = 0;
out_1685726956674156760[169] = 0;
out_1685726956674156760[170] = 0;
out_1685726956674156760[171] = 0;
out_1685726956674156760[172] = 0;
out_1685726956674156760[173] = 0;
out_1685726956674156760[174] = 0;
out_1685726956674156760[175] = 1.0;
out_1685726956674156760[176] = 0;
out_1685726956674156760[177] = 0;
out_1685726956674156760[178] = 0;
out_1685726956674156760[179] = 0;
out_1685726956674156760[180] = 0;
out_1685726956674156760[181] = 0;
out_1685726956674156760[182] = 0;
out_1685726956674156760[183] = 0;
out_1685726956674156760[184] = 0;
out_1685726956674156760[185] = 0;
out_1685726956674156760[186] = 0;
out_1685726956674156760[187] = 0;
out_1685726956674156760[188] = 0;
out_1685726956674156760[189] = 0;
out_1685726956674156760[190] = 0;
out_1685726956674156760[191] = 0;
out_1685726956674156760[192] = 0;
out_1685726956674156760[193] = 0;
out_1685726956674156760[194] = 0;
out_1685726956674156760[195] = 0;
out_1685726956674156760[196] = 0;
out_1685726956674156760[197] = 1.0;
out_1685726956674156760[198] = 0;
out_1685726956674156760[199] = 0;
out_1685726956674156760[200] = 0;
out_1685726956674156760[201] = 0;
out_1685726956674156760[202] = 0;
out_1685726956674156760[203] = 0;
out_1685726956674156760[204] = 0;
out_1685726956674156760[205] = 0;
out_1685726956674156760[206] = 0;
out_1685726956674156760[207] = 0;
out_1685726956674156760[208] = 0;
out_1685726956674156760[209] = 0;
out_1685726956674156760[210] = 0;
out_1685726956674156760[211] = 0;
out_1685726956674156760[212] = 0;
out_1685726956674156760[213] = 0;
out_1685726956674156760[214] = 0;
out_1685726956674156760[215] = 0;
out_1685726956674156760[216] = 0;
out_1685726956674156760[217] = 0;
out_1685726956674156760[218] = 0;
out_1685726956674156760[219] = 1.0;
out_1685726956674156760[220] = 0;
out_1685726956674156760[221] = 0;
out_1685726956674156760[222] = 0;
out_1685726956674156760[223] = 0;
out_1685726956674156760[224] = 0;
out_1685726956674156760[225] = 0;
out_1685726956674156760[226] = 0;
out_1685726956674156760[227] = 0;
out_1685726956674156760[228] = 0;
out_1685726956674156760[229] = 0;
out_1685726956674156760[230] = 0;
out_1685726956674156760[231] = 0;
out_1685726956674156760[232] = 0;
out_1685726956674156760[233] = 0;
out_1685726956674156760[234] = 0;
out_1685726956674156760[235] = 0;
out_1685726956674156760[236] = 0;
out_1685726956674156760[237] = 0;
out_1685726956674156760[238] = 0;
out_1685726956674156760[239] = 0;
out_1685726956674156760[240] = 0;
out_1685726956674156760[241] = 1.0;
out_1685726956674156760[242] = 0;
out_1685726956674156760[243] = 0;
out_1685726956674156760[244] = 0;
out_1685726956674156760[245] = 0;
out_1685726956674156760[246] = 0;
out_1685726956674156760[247] = 0;
out_1685726956674156760[248] = 0;
out_1685726956674156760[249] = 0;
out_1685726956674156760[250] = 0;
out_1685726956674156760[251] = 0;
out_1685726956674156760[252] = 0;
out_1685726956674156760[253] = 0;
out_1685726956674156760[254] = 0;
out_1685726956674156760[255] = 0;
out_1685726956674156760[256] = 0;
out_1685726956674156760[257] = 0;
out_1685726956674156760[258] = 0;
out_1685726956674156760[259] = 0;
out_1685726956674156760[260] = 0;
out_1685726956674156760[261] = 0;
out_1685726956674156760[262] = 0;
out_1685726956674156760[263] = 1.0;
out_1685726956674156760[264] = 0;
out_1685726956674156760[265] = 0;
out_1685726956674156760[266] = 0;
out_1685726956674156760[267] = 0;
out_1685726956674156760[268] = 0;
out_1685726956674156760[269] = 0;
out_1685726956674156760[270] = 0;
out_1685726956674156760[271] = 0;
out_1685726956674156760[272] = 0;
out_1685726956674156760[273] = 0;
out_1685726956674156760[274] = 0;
out_1685726956674156760[275] = 0;
out_1685726956674156760[276] = 0;
out_1685726956674156760[277] = 0;
out_1685726956674156760[278] = 0;
out_1685726956674156760[279] = 0;
out_1685726956674156760[280] = 0;
out_1685726956674156760[281] = 0;
out_1685726956674156760[282] = 0;
out_1685726956674156760[283] = 0;
out_1685726956674156760[284] = 0;
out_1685726956674156760[285] = 1.0;
out_1685726956674156760[286] = 0;
out_1685726956674156760[287] = 0;
out_1685726956674156760[288] = 0;
out_1685726956674156760[289] = 0;
out_1685726956674156760[290] = 0;
out_1685726956674156760[291] = 0;
out_1685726956674156760[292] = 0;
out_1685726956674156760[293] = 0;
out_1685726956674156760[294] = 0;
out_1685726956674156760[295] = 0;
out_1685726956674156760[296] = 0;
out_1685726956674156760[297] = 0;
out_1685726956674156760[298] = 0;
out_1685726956674156760[299] = 0;
out_1685726956674156760[300] = 0;
out_1685726956674156760[301] = 0;
out_1685726956674156760[302] = 0;
out_1685726956674156760[303] = 0;
out_1685726956674156760[304] = 0;
out_1685726956674156760[305] = 0;
out_1685726956674156760[306] = 0;
out_1685726956674156760[307] = 1.0;
out_1685726956674156760[308] = 0;
out_1685726956674156760[309] = 0;
out_1685726956674156760[310] = 0;
out_1685726956674156760[311] = 0;
out_1685726956674156760[312] = 0;
out_1685726956674156760[313] = 0;
out_1685726956674156760[314] = 0;
out_1685726956674156760[315] = 0;
out_1685726956674156760[316] = 0;
out_1685726956674156760[317] = 0;
out_1685726956674156760[318] = 0;
out_1685726956674156760[319] = 0;
out_1685726956674156760[320] = 0;
out_1685726956674156760[321] = 0;
out_1685726956674156760[322] = 0;
out_1685726956674156760[323] = 0;
out_1685726956674156760[324] = 0;
out_1685726956674156760[325] = 0;
out_1685726956674156760[326] = 0;
out_1685726956674156760[327] = 0;
out_1685726956674156760[328] = 0;
out_1685726956674156760[329] = 1.0;
out_1685726956674156760[330] = 0;
out_1685726956674156760[331] = 0;
out_1685726956674156760[332] = 0;
out_1685726956674156760[333] = 0;
out_1685726956674156760[334] = 0;
out_1685726956674156760[335] = 0;
out_1685726956674156760[336] = 0;
out_1685726956674156760[337] = 0;
out_1685726956674156760[338] = 0;
out_1685726956674156760[339] = 0;
out_1685726956674156760[340] = 0;
out_1685726956674156760[341] = 0;
out_1685726956674156760[342] = 0;
out_1685726956674156760[343] = 0;
out_1685726956674156760[344] = 0;
out_1685726956674156760[345] = 0;
out_1685726956674156760[346] = 0;
out_1685726956674156760[347] = 0;
out_1685726956674156760[348] = 0;
out_1685726956674156760[349] = 0;
out_1685726956674156760[350] = 0;
out_1685726956674156760[351] = 1.0;
out_1685726956674156760[352] = 0;
out_1685726956674156760[353] = 0;
out_1685726956674156760[354] = 0;
out_1685726956674156760[355] = 0;
out_1685726956674156760[356] = 0;
out_1685726956674156760[357] = 0;
out_1685726956674156760[358] = 0;
out_1685726956674156760[359] = 0;
out_1685726956674156760[360] = 0;
out_1685726956674156760[361] = 0;
out_1685726956674156760[362] = 0;
out_1685726956674156760[363] = 0;
out_1685726956674156760[364] = 0;
out_1685726956674156760[365] = 0;
out_1685726956674156760[366] = 0;
out_1685726956674156760[367] = 0;
out_1685726956674156760[368] = 0;
out_1685726956674156760[369] = 0;
out_1685726956674156760[370] = 0;
out_1685726956674156760[371] = 0;
out_1685726956674156760[372] = 0;
out_1685726956674156760[373] = 1.0;
out_1685726956674156760[374] = 0;
out_1685726956674156760[375] = 0;
out_1685726956674156760[376] = 0;
out_1685726956674156760[377] = 0;
out_1685726956674156760[378] = 0;
out_1685726956674156760[379] = 0;
out_1685726956674156760[380] = 0;
out_1685726956674156760[381] = 0;
out_1685726956674156760[382] = 0;
out_1685726956674156760[383] = 0;
out_1685726956674156760[384] = 0;
out_1685726956674156760[385] = 0;
out_1685726956674156760[386] = 0;
out_1685726956674156760[387] = 0;
out_1685726956674156760[388] = 0;
out_1685726956674156760[389] = 0;
out_1685726956674156760[390] = 0;
out_1685726956674156760[391] = 0;
out_1685726956674156760[392] = 0;
out_1685726956674156760[393] = 0;
out_1685726956674156760[394] = 0;
out_1685726956674156760[395] = 1.0;
out_1685726956674156760[396] = 0;
out_1685726956674156760[397] = 0;
out_1685726956674156760[398] = 0;
out_1685726956674156760[399] = 0;
out_1685726956674156760[400] = 0;
out_1685726956674156760[401] = 0;
out_1685726956674156760[402] = 0;
out_1685726956674156760[403] = 0;
out_1685726956674156760[404] = 0;
out_1685726956674156760[405] = 0;
out_1685726956674156760[406] = 0;
out_1685726956674156760[407] = 0;
out_1685726956674156760[408] = 0;
out_1685726956674156760[409] = 0;
out_1685726956674156760[410] = 0;
out_1685726956674156760[411] = 0;
out_1685726956674156760[412] = 0;
out_1685726956674156760[413] = 0;
out_1685726956674156760[414] = 0;
out_1685726956674156760[415] = 0;
out_1685726956674156760[416] = 0;
out_1685726956674156760[417] = 1.0;
out_1685726956674156760[418] = 0;
out_1685726956674156760[419] = 0;
out_1685726956674156760[420] = 0;
out_1685726956674156760[421] = 0;
out_1685726956674156760[422] = 0;
out_1685726956674156760[423] = 0;
out_1685726956674156760[424] = 0;
out_1685726956674156760[425] = 0;
out_1685726956674156760[426] = 0;
out_1685726956674156760[427] = 0;
out_1685726956674156760[428] = 0;
out_1685726956674156760[429] = 0;
out_1685726956674156760[430] = 0;
out_1685726956674156760[431] = 0;
out_1685726956674156760[432] = 0;
out_1685726956674156760[433] = 0;
out_1685726956674156760[434] = 0;
out_1685726956674156760[435] = 0;
out_1685726956674156760[436] = 0;
out_1685726956674156760[437] = 0;
out_1685726956674156760[438] = 0;
out_1685726956674156760[439] = 1.0;
out_1685726956674156760[440] = 0;
out_1685726956674156760[441] = 0;
out_1685726956674156760[442] = 0;
out_1685726956674156760[443] = 0;
out_1685726956674156760[444] = 0;
out_1685726956674156760[445] = 0;
out_1685726956674156760[446] = 0;
out_1685726956674156760[447] = 0;
out_1685726956674156760[448] = 0;
out_1685726956674156760[449] = 0;
out_1685726956674156760[450] = 0;
out_1685726956674156760[451] = 0;
out_1685726956674156760[452] = 0;
out_1685726956674156760[453] = 0;
out_1685726956674156760[454] = 0;
out_1685726956674156760[455] = 0;
out_1685726956674156760[456] = 0;
out_1685726956674156760[457] = 0;
out_1685726956674156760[458] = 0;
out_1685726956674156760[459] = 0;
out_1685726956674156760[460] = 0;
out_1685726956674156760[461] = 1.0;
}
void f_fun(double *state, double dt, double *out_774966178326963321) {
out_774966178326963321[0] = dt*state[7] + state[0];
out_774966178326963321[1] = dt*state[8] + state[1];
out_774966178326963321[2] = dt*state[9] + state[2];
out_774966178326963321[3] = dt*(-0.5*state[4]*state[10] - 0.5*state[5]*state[11] - 0.5*state[6]*state[12]) + state[3];
out_774966178326963321[4] = dt*(0.5*state[3]*state[10] + 0.5*state[5]*state[12] - 0.5*state[6]*state[11]) + state[4];
out_774966178326963321[5] = dt*(0.5*state[3]*state[11] - 0.5*state[4]*state[12] + 0.5*state[6]*state[10]) + state[5];
out_774966178326963321[6] = dt*(0.5*state[3]*state[12] + 0.5*state[4]*state[11] - 0.5*state[5]*state[10]) + state[6];
out_774966178326963321[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_774966178326963321[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_774966178326963321[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_774966178326963321[10] = state[10];
out_774966178326963321[11] = state[11];
out_774966178326963321[12] = state[12];
out_774966178326963321[13] = state[13];
out_774966178326963321[14] = state[14];
out_774966178326963321[15] = state[15];
out_774966178326963321[16] = state[16];
out_774966178326963321[17] = state[17];
out_774966178326963321[18] = state[18];
out_774966178326963321[19] = state[19];
out_774966178326963321[20] = state[20];
out_774966178326963321[21] = state[21];
}
void F_fun(double *state, double dt, double *out_7282145086155387076) {
out_7282145086155387076[0] = 1;
out_7282145086155387076[1] = 0;
out_7282145086155387076[2] = 0;
out_7282145086155387076[3] = 0;
out_7282145086155387076[4] = 0;
out_7282145086155387076[5] = 0;
out_7282145086155387076[6] = dt;
out_7282145086155387076[7] = 0;
out_7282145086155387076[8] = 0;
out_7282145086155387076[9] = 0;
out_7282145086155387076[10] = 0;
out_7282145086155387076[11] = 0;
out_7282145086155387076[12] = 0;
out_7282145086155387076[13] = 0;
out_7282145086155387076[14] = 0;
out_7282145086155387076[15] = 0;
out_7282145086155387076[16] = 0;
out_7282145086155387076[17] = 0;
out_7282145086155387076[18] = 0;
out_7282145086155387076[19] = 0;
out_7282145086155387076[20] = 0;
out_7282145086155387076[21] = 0;
out_7282145086155387076[22] = 1;
out_7282145086155387076[23] = 0;
out_7282145086155387076[24] = 0;
out_7282145086155387076[25] = 0;
out_7282145086155387076[26] = 0;
out_7282145086155387076[27] = 0;
out_7282145086155387076[28] = dt;
out_7282145086155387076[29] = 0;
out_7282145086155387076[30] = 0;
out_7282145086155387076[31] = 0;
out_7282145086155387076[32] = 0;
out_7282145086155387076[33] = 0;
out_7282145086155387076[34] = 0;
out_7282145086155387076[35] = 0;
out_7282145086155387076[36] = 0;
out_7282145086155387076[37] = 0;
out_7282145086155387076[38] = 0;
out_7282145086155387076[39] = 0;
out_7282145086155387076[40] = 0;
out_7282145086155387076[41] = 0;
out_7282145086155387076[42] = 0;
out_7282145086155387076[43] = 0;
out_7282145086155387076[44] = 1;
out_7282145086155387076[45] = 0;
out_7282145086155387076[46] = 0;
out_7282145086155387076[47] = 0;
out_7282145086155387076[48] = 0;
out_7282145086155387076[49] = 0;
out_7282145086155387076[50] = dt;
out_7282145086155387076[51] = 0;
out_7282145086155387076[52] = 0;
out_7282145086155387076[53] = 0;
out_7282145086155387076[54] = 0;
out_7282145086155387076[55] = 0;
out_7282145086155387076[56] = 0;
out_7282145086155387076[57] = 0;
out_7282145086155387076[58] = 0;
out_7282145086155387076[59] = 0;
out_7282145086155387076[60] = 0;
out_7282145086155387076[61] = 0;
out_7282145086155387076[62] = 0;
out_7282145086155387076[63] = 0;
out_7282145086155387076[64] = 0;
out_7282145086155387076[65] = 0;
out_7282145086155387076[66] = 1;
out_7282145086155387076[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_7282145086155387076[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_7282145086155387076[69] = 0;
out_7282145086155387076[70] = 0;
out_7282145086155387076[71] = 0;
out_7282145086155387076[72] = dt*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2));
out_7282145086155387076[73] = dt*(-2*state[3]*state[6] + 2*state[4]*state[5]);
out_7282145086155387076[74] = dt*(2*state[3]*state[5] + 2*state[4]*state[6]);
out_7282145086155387076[75] = 0;
out_7282145086155387076[76] = 0;
out_7282145086155387076[77] = 0;
out_7282145086155387076[78] = 0;
out_7282145086155387076[79] = 0;
out_7282145086155387076[80] = 0;
out_7282145086155387076[81] = 0;
out_7282145086155387076[82] = 0;
out_7282145086155387076[83] = 0;
out_7282145086155387076[84] = 0;
out_7282145086155387076[85] = 0;
out_7282145086155387076[86] = 0;
out_7282145086155387076[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_7282145086155387076[88] = 1;
out_7282145086155387076[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_7282145086155387076[90] = 0;
out_7282145086155387076[91] = 0;
out_7282145086155387076[92] = 0;
out_7282145086155387076[93] = dt*(2*state[3]*state[6] + 2*state[4]*state[5]);
out_7282145086155387076[94] = dt*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2));
out_7282145086155387076[95] = dt*(-2*state[3]*state[4] + 2*state[5]*state[6]);
out_7282145086155387076[96] = 0;
out_7282145086155387076[97] = 0;
out_7282145086155387076[98] = 0;
out_7282145086155387076[99] = 0;
out_7282145086155387076[100] = 0;
out_7282145086155387076[101] = 0;
out_7282145086155387076[102] = 0;
out_7282145086155387076[103] = 0;
out_7282145086155387076[104] = 0;
out_7282145086155387076[105] = 0;
out_7282145086155387076[106] = 0;
out_7282145086155387076[107] = 0;
out_7282145086155387076[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_7282145086155387076[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_7282145086155387076[110] = 1;
out_7282145086155387076[111] = 0;
out_7282145086155387076[112] = 0;
out_7282145086155387076[113] = 0;
out_7282145086155387076[114] = dt*(-2*state[3]*state[5] + 2*state[4]*state[6]);
out_7282145086155387076[115] = dt*(2*state[3]*state[4] + 2*state[5]*state[6]);
out_7282145086155387076[116] = dt*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2));
out_7282145086155387076[117] = 0;
out_7282145086155387076[118] = 0;
out_7282145086155387076[119] = 0;
out_7282145086155387076[120] = 0;
out_7282145086155387076[121] = 0;
out_7282145086155387076[122] = 0;
out_7282145086155387076[123] = 0;
out_7282145086155387076[124] = 0;
out_7282145086155387076[125] = 0;
out_7282145086155387076[126] = 0;
out_7282145086155387076[127] = 0;
out_7282145086155387076[128] = 0;
out_7282145086155387076[129] = 0;
out_7282145086155387076[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_7282145086155387076[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_7282145086155387076[132] = 1;
out_7282145086155387076[133] = 0;
out_7282145086155387076[134] = 0;
out_7282145086155387076[135] = 0;
out_7282145086155387076[136] = 0;
out_7282145086155387076[137] = 0;
out_7282145086155387076[138] = 0;
out_7282145086155387076[139] = 0;
out_7282145086155387076[140] = 0;
out_7282145086155387076[141] = dt*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2));
out_7282145086155387076[142] = dt*(-2*state[3]*state[6] + 2*state[4]*state[5]);
out_7282145086155387076[143] = dt*(2*state[3]*state[5] + 2*state[4]*state[6]);
out_7282145086155387076[144] = 0;
out_7282145086155387076[145] = 0;
out_7282145086155387076[146] = 0;
out_7282145086155387076[147] = 0;
out_7282145086155387076[148] = 0;
out_7282145086155387076[149] = 0;
out_7282145086155387076[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_7282145086155387076[151] = 0;
out_7282145086155387076[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_7282145086155387076[153] = 0;
out_7282145086155387076[154] = 1;
out_7282145086155387076[155] = 0;
out_7282145086155387076[156] = 0;
out_7282145086155387076[157] = 0;
out_7282145086155387076[158] = 0;
out_7282145086155387076[159] = 0;
out_7282145086155387076[160] = 0;
out_7282145086155387076[161] = 0;
out_7282145086155387076[162] = dt*(2*state[3]*state[6] + 2*state[4]*state[5]);
out_7282145086155387076[163] = dt*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2));
out_7282145086155387076[164] = dt*(-2*state[3]*state[4] + 2*state[5]*state[6]);
out_7282145086155387076[165] = 0;
out_7282145086155387076[166] = 0;
out_7282145086155387076[167] = 0;
out_7282145086155387076[168] = 0;
out_7282145086155387076[169] = 0;
out_7282145086155387076[170] = 0;
out_7282145086155387076[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_7282145086155387076[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_7282145086155387076[173] = 0;
out_7282145086155387076[174] = 0;
out_7282145086155387076[175] = 0;
out_7282145086155387076[176] = 1;
out_7282145086155387076[177] = 0;
out_7282145086155387076[178] = 0;
out_7282145086155387076[179] = 0;
out_7282145086155387076[180] = 0;
out_7282145086155387076[181] = 0;
out_7282145086155387076[182] = 0;
out_7282145086155387076[183] = dt*(-2*state[3]*state[5] + 2*state[4]*state[6]);
out_7282145086155387076[184] = dt*(2*state[3]*state[4] + 2*state[5]*state[6]);
out_7282145086155387076[185] = dt*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2));
out_7282145086155387076[186] = 0;
out_7282145086155387076[187] = 0;
out_7282145086155387076[188] = 0;
out_7282145086155387076[189] = 0;
out_7282145086155387076[190] = 0;
out_7282145086155387076[191] = 0;
out_7282145086155387076[192] = 0;
out_7282145086155387076[193] = 0;
out_7282145086155387076[194] = 0;
out_7282145086155387076[195] = 0;
out_7282145086155387076[196] = 0;
out_7282145086155387076[197] = 0;
out_7282145086155387076[198] = 1;
out_7282145086155387076[199] = 0;
out_7282145086155387076[200] = 0;
out_7282145086155387076[201] = 0;
out_7282145086155387076[202] = 0;
out_7282145086155387076[203] = 0;
out_7282145086155387076[204] = 0;
out_7282145086155387076[205] = 0;
out_7282145086155387076[206] = 0;
out_7282145086155387076[207] = 0;
out_7282145086155387076[208] = 0;
out_7282145086155387076[209] = 0;
out_7282145086155387076[210] = 0;
out_7282145086155387076[211] = 0;
out_7282145086155387076[212] = 0;
out_7282145086155387076[213] = 0;
out_7282145086155387076[214] = 0;
out_7282145086155387076[215] = 0;
out_7282145086155387076[216] = 0;
out_7282145086155387076[217] = 0;
out_7282145086155387076[218] = 0;
out_7282145086155387076[219] = 0;
out_7282145086155387076[220] = 1;
out_7282145086155387076[221] = 0;
out_7282145086155387076[222] = 0;
out_7282145086155387076[223] = 0;
out_7282145086155387076[224] = 0;
out_7282145086155387076[225] = 0;
out_7282145086155387076[226] = 0;
out_7282145086155387076[227] = 0;
out_7282145086155387076[228] = 0;
out_7282145086155387076[229] = 0;
out_7282145086155387076[230] = 0;
out_7282145086155387076[231] = 0;
out_7282145086155387076[232] = 0;
out_7282145086155387076[233] = 0;
out_7282145086155387076[234] = 0;
out_7282145086155387076[235] = 0;
out_7282145086155387076[236] = 0;
out_7282145086155387076[237] = 0;
out_7282145086155387076[238] = 0;
out_7282145086155387076[239] = 0;
out_7282145086155387076[240] = 0;
out_7282145086155387076[241] = 0;
out_7282145086155387076[242] = 1;
out_7282145086155387076[243] = 0;
out_7282145086155387076[244] = 0;
out_7282145086155387076[245] = 0;
out_7282145086155387076[246] = 0;
out_7282145086155387076[247] = 0;
out_7282145086155387076[248] = 0;
out_7282145086155387076[249] = 0;
out_7282145086155387076[250] = 0;
out_7282145086155387076[251] = 0;
out_7282145086155387076[252] = 0;
out_7282145086155387076[253] = 0;
out_7282145086155387076[254] = 0;
out_7282145086155387076[255] = 0;
out_7282145086155387076[256] = 0;
out_7282145086155387076[257] = 0;
out_7282145086155387076[258] = 0;
out_7282145086155387076[259] = 0;
out_7282145086155387076[260] = 0;
out_7282145086155387076[261] = 0;
out_7282145086155387076[262] = 0;
out_7282145086155387076[263] = 0;
out_7282145086155387076[264] = 1;
out_7282145086155387076[265] = 0;
out_7282145086155387076[266] = 0;
out_7282145086155387076[267] = 0;
out_7282145086155387076[268] = 0;
out_7282145086155387076[269] = 0;
out_7282145086155387076[270] = 0;
out_7282145086155387076[271] = 0;
out_7282145086155387076[272] = 0;
out_7282145086155387076[273] = 0;
out_7282145086155387076[274] = 0;
out_7282145086155387076[275] = 0;
out_7282145086155387076[276] = 0;
out_7282145086155387076[277] = 0;
out_7282145086155387076[278] = 0;
out_7282145086155387076[279] = 0;
out_7282145086155387076[280] = 0;
out_7282145086155387076[281] = 0;
out_7282145086155387076[282] = 0;
out_7282145086155387076[283] = 0;
out_7282145086155387076[284] = 0;
out_7282145086155387076[285] = 0;
out_7282145086155387076[286] = 1;
out_7282145086155387076[287] = 0;
out_7282145086155387076[288] = 0;
out_7282145086155387076[289] = 0;
out_7282145086155387076[290] = 0;
out_7282145086155387076[291] = 0;
out_7282145086155387076[292] = 0;
out_7282145086155387076[293] = 0;
out_7282145086155387076[294] = 0;
out_7282145086155387076[295] = 0;
out_7282145086155387076[296] = 0;
out_7282145086155387076[297] = 0;
out_7282145086155387076[298] = 0;
out_7282145086155387076[299] = 0;
out_7282145086155387076[300] = 0;
out_7282145086155387076[301] = 0;
out_7282145086155387076[302] = 0;
out_7282145086155387076[303] = 0;
out_7282145086155387076[304] = 0;
out_7282145086155387076[305] = 0;
out_7282145086155387076[306] = 0;
out_7282145086155387076[307] = 0;
out_7282145086155387076[308] = 1;
out_7282145086155387076[309] = 0;
out_7282145086155387076[310] = 0;
out_7282145086155387076[311] = 0;
out_7282145086155387076[312] = 0;
out_7282145086155387076[313] = 0;
out_7282145086155387076[314] = 0;
out_7282145086155387076[315] = 0;
out_7282145086155387076[316] = 0;
out_7282145086155387076[317] = 0;
out_7282145086155387076[318] = 0;
out_7282145086155387076[319] = 0;
out_7282145086155387076[320] = 0;
out_7282145086155387076[321] = 0;
out_7282145086155387076[322] = 0;
out_7282145086155387076[323] = 0;
out_7282145086155387076[324] = 0;
out_7282145086155387076[325] = 0;
out_7282145086155387076[326] = 0;
out_7282145086155387076[327] = 0;
out_7282145086155387076[328] = 0;
out_7282145086155387076[329] = 0;
out_7282145086155387076[330] = 1;
out_7282145086155387076[331] = 0;
out_7282145086155387076[332] = 0;
out_7282145086155387076[333] = 0;
out_7282145086155387076[334] = 0;
out_7282145086155387076[335] = 0;
out_7282145086155387076[336] = 0;
out_7282145086155387076[337] = 0;
out_7282145086155387076[338] = 0;
out_7282145086155387076[339] = 0;
out_7282145086155387076[340] = 0;
out_7282145086155387076[341] = 0;
out_7282145086155387076[342] = 0;
out_7282145086155387076[343] = 0;
out_7282145086155387076[344] = 0;
out_7282145086155387076[345] = 0;
out_7282145086155387076[346] = 0;
out_7282145086155387076[347] = 0;
out_7282145086155387076[348] = 0;
out_7282145086155387076[349] = 0;
out_7282145086155387076[350] = 0;
out_7282145086155387076[351] = 0;
out_7282145086155387076[352] = 1;
out_7282145086155387076[353] = 0;
out_7282145086155387076[354] = 0;
out_7282145086155387076[355] = 0;
out_7282145086155387076[356] = 0;
out_7282145086155387076[357] = 0;
out_7282145086155387076[358] = 0;
out_7282145086155387076[359] = 0;
out_7282145086155387076[360] = 0;
out_7282145086155387076[361] = 0;
out_7282145086155387076[362] = 0;
out_7282145086155387076[363] = 0;
out_7282145086155387076[364] = 0;
out_7282145086155387076[365] = 0;
out_7282145086155387076[366] = 0;
out_7282145086155387076[367] = 0;
out_7282145086155387076[368] = 0;
out_7282145086155387076[369] = 0;
out_7282145086155387076[370] = 0;
out_7282145086155387076[371] = 0;
out_7282145086155387076[372] = 0;
out_7282145086155387076[373] = 0;
out_7282145086155387076[374] = 1;
out_7282145086155387076[375] = 0;
out_7282145086155387076[376] = 0;
out_7282145086155387076[377] = 0;
out_7282145086155387076[378] = 0;
out_7282145086155387076[379] = 0;
out_7282145086155387076[380] = 0;
out_7282145086155387076[381] = 0;
out_7282145086155387076[382] = 0;
out_7282145086155387076[383] = 0;
out_7282145086155387076[384] = 0;
out_7282145086155387076[385] = 0;
out_7282145086155387076[386] = 0;
out_7282145086155387076[387] = 0;
out_7282145086155387076[388] = 0;
out_7282145086155387076[389] = 0;
out_7282145086155387076[390] = 0;
out_7282145086155387076[391] = 0;
out_7282145086155387076[392] = 0;
out_7282145086155387076[393] = 0;
out_7282145086155387076[394] = 0;
out_7282145086155387076[395] = 0;
out_7282145086155387076[396] = 1;
out_7282145086155387076[397] = 0;
out_7282145086155387076[398] = 0;
out_7282145086155387076[399] = 0;
out_7282145086155387076[400] = 0;
out_7282145086155387076[401] = 0;
out_7282145086155387076[402] = 0;
out_7282145086155387076[403] = 0;
out_7282145086155387076[404] = 0;
out_7282145086155387076[405] = 0;
out_7282145086155387076[406] = 0;
out_7282145086155387076[407] = 0;
out_7282145086155387076[408] = 0;
out_7282145086155387076[409] = 0;
out_7282145086155387076[410] = 0;
out_7282145086155387076[411] = 0;
out_7282145086155387076[412] = 0;
out_7282145086155387076[413] = 0;
out_7282145086155387076[414] = 0;
out_7282145086155387076[415] = 0;
out_7282145086155387076[416] = 0;
out_7282145086155387076[417] = 0;
out_7282145086155387076[418] = 1;
out_7282145086155387076[419] = 0;
out_7282145086155387076[420] = 0;
out_7282145086155387076[421] = 0;
out_7282145086155387076[422] = 0;
out_7282145086155387076[423] = 0;
out_7282145086155387076[424] = 0;
out_7282145086155387076[425] = 0;
out_7282145086155387076[426] = 0;
out_7282145086155387076[427] = 0;
out_7282145086155387076[428] = 0;
out_7282145086155387076[429] = 0;
out_7282145086155387076[430] = 0;
out_7282145086155387076[431] = 0;
out_7282145086155387076[432] = 0;
out_7282145086155387076[433] = 0;
out_7282145086155387076[434] = 0;
out_7282145086155387076[435] = 0;
out_7282145086155387076[436] = 0;
out_7282145086155387076[437] = 0;
out_7282145086155387076[438] = 0;
out_7282145086155387076[439] = 0;
out_7282145086155387076[440] = 1;
}
void h_4(double *state, double *unused, double *out_3936704980047894152) {
out_3936704980047894152[0] = state[10] + state[13];
out_3936704980047894152[1] = state[11] + state[14];
out_3936704980047894152[2] = state[12] + state[15];
}
void H_4(double *state, double *unused, double *out_9052514604414786102) {
out_9052514604414786102[0] = 0;
out_9052514604414786102[1] = 0;
out_9052514604414786102[2] = 0;
out_9052514604414786102[3] = 0;
out_9052514604414786102[4] = 0;
out_9052514604414786102[5] = 0;
out_9052514604414786102[6] = 0;
out_9052514604414786102[7] = 0;
out_9052514604414786102[8] = 0;
out_9052514604414786102[9] = 0;
out_9052514604414786102[10] = 1;
out_9052514604414786102[11] = 0;
out_9052514604414786102[12] = 0;
out_9052514604414786102[13] = 1;
out_9052514604414786102[14] = 0;
out_9052514604414786102[15] = 0;
out_9052514604414786102[16] = 0;
out_9052514604414786102[17] = 0;
out_9052514604414786102[18] = 0;
out_9052514604414786102[19] = 0;
out_9052514604414786102[20] = 0;
out_9052514604414786102[21] = 0;
out_9052514604414786102[22] = 0;
out_9052514604414786102[23] = 0;
out_9052514604414786102[24] = 0;
out_9052514604414786102[25] = 0;
out_9052514604414786102[26] = 0;
out_9052514604414786102[27] = 0;
out_9052514604414786102[28] = 0;
out_9052514604414786102[29] = 0;
out_9052514604414786102[30] = 0;
out_9052514604414786102[31] = 0;
out_9052514604414786102[32] = 0;
out_9052514604414786102[33] = 1;
out_9052514604414786102[34] = 0;
out_9052514604414786102[35] = 0;
out_9052514604414786102[36] = 1;
out_9052514604414786102[37] = 0;
out_9052514604414786102[38] = 0;
out_9052514604414786102[39] = 0;
out_9052514604414786102[40] = 0;
out_9052514604414786102[41] = 0;
out_9052514604414786102[42] = 0;
out_9052514604414786102[43] = 0;
out_9052514604414786102[44] = 0;
out_9052514604414786102[45] = 0;
out_9052514604414786102[46] = 0;
out_9052514604414786102[47] = 0;
out_9052514604414786102[48] = 0;
out_9052514604414786102[49] = 0;
out_9052514604414786102[50] = 0;
out_9052514604414786102[51] = 0;
out_9052514604414786102[52] = 0;
out_9052514604414786102[53] = 0;
out_9052514604414786102[54] = 0;
out_9052514604414786102[55] = 0;
out_9052514604414786102[56] = 1;
out_9052514604414786102[57] = 0;
out_9052514604414786102[58] = 0;
out_9052514604414786102[59] = 1;
out_9052514604414786102[60] = 0;
out_9052514604414786102[61] = 0;
out_9052514604414786102[62] = 0;
out_9052514604414786102[63] = 0;
out_9052514604414786102[64] = 0;
out_9052514604414786102[65] = 0;
}
void h_9(double *state, double *unused, double *out_4670376777294811307) {
out_4670376777294811307[0] = state[10];
out_4670376777294811307[1] = state[11];
out_4670376777294811307[2] = state[12];
}
void H_9(double *state, double *unused, double *out_9153039822665174869) {
out_9153039822665174869[0] = 0;
out_9153039822665174869[1] = 0;
out_9153039822665174869[2] = 0;
out_9153039822665174869[3] = 0;
out_9153039822665174869[4] = 0;
out_9153039822665174869[5] = 0;
out_9153039822665174869[6] = 0;
out_9153039822665174869[7] = 0;
out_9153039822665174869[8] = 0;
out_9153039822665174869[9] = 0;
out_9153039822665174869[10] = 1;
out_9153039822665174869[11] = 0;
out_9153039822665174869[12] = 0;
out_9153039822665174869[13] = 0;
out_9153039822665174869[14] = 0;
out_9153039822665174869[15] = 0;
out_9153039822665174869[16] = 0;
out_9153039822665174869[17] = 0;
out_9153039822665174869[18] = 0;
out_9153039822665174869[19] = 0;
out_9153039822665174869[20] = 0;
out_9153039822665174869[21] = 0;
out_9153039822665174869[22] = 0;
out_9153039822665174869[23] = 0;
out_9153039822665174869[24] = 0;
out_9153039822665174869[25] = 0;
out_9153039822665174869[26] = 0;
out_9153039822665174869[27] = 0;
out_9153039822665174869[28] = 0;
out_9153039822665174869[29] = 0;
out_9153039822665174869[30] = 0;
out_9153039822665174869[31] = 0;
out_9153039822665174869[32] = 0;
out_9153039822665174869[33] = 1;
out_9153039822665174869[34] = 0;
out_9153039822665174869[35] = 0;
out_9153039822665174869[36] = 0;
out_9153039822665174869[37] = 0;
out_9153039822665174869[38] = 0;
out_9153039822665174869[39] = 0;
out_9153039822665174869[40] = 0;
out_9153039822665174869[41] = 0;
out_9153039822665174869[42] = 0;
out_9153039822665174869[43] = 0;
out_9153039822665174869[44] = 0;
out_9153039822665174869[45] = 0;
out_9153039822665174869[46] = 0;
out_9153039822665174869[47] = 0;
out_9153039822665174869[48] = 0;
out_9153039822665174869[49] = 0;
out_9153039822665174869[50] = 0;
out_9153039822665174869[51] = 0;
out_9153039822665174869[52] = 0;
out_9153039822665174869[53] = 0;
out_9153039822665174869[54] = 0;
out_9153039822665174869[55] = 0;
out_9153039822665174869[56] = 1;
out_9153039822665174869[57] = 0;
out_9153039822665174869[58] = 0;
out_9153039822665174869[59] = 0;
out_9153039822665174869[60] = 0;
out_9153039822665174869[61] = 0;
out_9153039822665174869[62] = 0;
out_9153039822665174869[63] = 0;
out_9153039822665174869[64] = 0;
out_9153039822665174869[65] = 0;
}
void h_10(double *state, double *unused, double *out_5114531167885874097) {
out_5114531167885874097[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_5114531167885874097[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_5114531167885874097[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_8901083693322163334) {
out_8901083693322163334[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_8901083693322163334[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_8901083693322163334[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_8901083693322163334[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_8901083693322163334[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_8901083693322163334[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_8901083693322163334[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_8901083693322163334[7] = 0;
out_8901083693322163334[8] = 0;
out_8901083693322163334[9] = 0;
out_8901083693322163334[10] = 0;
out_8901083693322163334[11] = 0;
out_8901083693322163334[12] = 0;
out_8901083693322163334[13] = 0;
out_8901083693322163334[14] = 0;
out_8901083693322163334[15] = 0;
out_8901083693322163334[16] = 1;
out_8901083693322163334[17] = 0;
out_8901083693322163334[18] = 0;
out_8901083693322163334[19] = 1;
out_8901083693322163334[20] = 0;
out_8901083693322163334[21] = 0;
out_8901083693322163334[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_8901083693322163334[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_8901083693322163334[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_8901083693322163334[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_8901083693322163334[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_8901083693322163334[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_8901083693322163334[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_8901083693322163334[29] = 0;
out_8901083693322163334[30] = 0;
out_8901083693322163334[31] = 0;
out_8901083693322163334[32] = 0;
out_8901083693322163334[33] = 0;
out_8901083693322163334[34] = 0;
out_8901083693322163334[35] = 0;
out_8901083693322163334[36] = 0;
out_8901083693322163334[37] = 0;
out_8901083693322163334[38] = 0;
out_8901083693322163334[39] = 1;
out_8901083693322163334[40] = 0;
out_8901083693322163334[41] = 0;
out_8901083693322163334[42] = 1;
out_8901083693322163334[43] = 0;
out_8901083693322163334[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_8901083693322163334[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_8901083693322163334[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_8901083693322163334[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_8901083693322163334[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_8901083693322163334[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_8901083693322163334[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_8901083693322163334[51] = 0;
out_8901083693322163334[52] = 0;
out_8901083693322163334[53] = 0;
out_8901083693322163334[54] = 0;
out_8901083693322163334[55] = 0;
out_8901083693322163334[56] = 0;
out_8901083693322163334[57] = 0;
out_8901083693322163334[58] = 0;
out_8901083693322163334[59] = 0;
out_8901083693322163334[60] = 0;
out_8901083693322163334[61] = 0;
out_8901083693322163334[62] = 1;
out_8901083693322163334[63] = 0;
out_8901083693322163334[64] = 0;
out_8901083693322163334[65] = 1;
}
void h_12(double *state, double *unused, double *out_6249225679190641860) {
out_6249225679190641860[0] = state[0];
out_6249225679190641860[1] = state[1];
out_6249225679190641860[2] = state[2];
}
void H_12(double *state, double *unused, double *out_4374773061262803719) {
out_4374773061262803719[0] = 1;
out_4374773061262803719[1] = 0;
out_4374773061262803719[2] = 0;
out_4374773061262803719[3] = 0;
out_4374773061262803719[4] = 0;
out_4374773061262803719[5] = 0;
out_4374773061262803719[6] = 0;
out_4374773061262803719[7] = 0;
out_4374773061262803719[8] = 0;
out_4374773061262803719[9] = 0;
out_4374773061262803719[10] = 0;
out_4374773061262803719[11] = 0;
out_4374773061262803719[12] = 0;
out_4374773061262803719[13] = 0;
out_4374773061262803719[14] = 0;
out_4374773061262803719[15] = 0;
out_4374773061262803719[16] = 0;
out_4374773061262803719[17] = 0;
out_4374773061262803719[18] = 0;
out_4374773061262803719[19] = 0;
out_4374773061262803719[20] = 0;
out_4374773061262803719[21] = 0;
out_4374773061262803719[22] = 0;
out_4374773061262803719[23] = 1;
out_4374773061262803719[24] = 0;
out_4374773061262803719[25] = 0;
out_4374773061262803719[26] = 0;
out_4374773061262803719[27] = 0;
out_4374773061262803719[28] = 0;
out_4374773061262803719[29] = 0;
out_4374773061262803719[30] = 0;
out_4374773061262803719[31] = 0;
out_4374773061262803719[32] = 0;
out_4374773061262803719[33] = 0;
out_4374773061262803719[34] = 0;
out_4374773061262803719[35] = 0;
out_4374773061262803719[36] = 0;
out_4374773061262803719[37] = 0;
out_4374773061262803719[38] = 0;
out_4374773061262803719[39] = 0;
out_4374773061262803719[40] = 0;
out_4374773061262803719[41] = 0;
out_4374773061262803719[42] = 0;
out_4374773061262803719[43] = 0;
out_4374773061262803719[44] = 0;
out_4374773061262803719[45] = 0;
out_4374773061262803719[46] = 1;
out_4374773061262803719[47] = 0;
out_4374773061262803719[48] = 0;
out_4374773061262803719[49] = 0;
out_4374773061262803719[50] = 0;
out_4374773061262803719[51] = 0;
out_4374773061262803719[52] = 0;
out_4374773061262803719[53] = 0;
out_4374773061262803719[54] = 0;
out_4374773061262803719[55] = 0;
out_4374773061262803719[56] = 0;
out_4374773061262803719[57] = 0;
out_4374773061262803719[58] = 0;
out_4374773061262803719[59] = 0;
out_4374773061262803719[60] = 0;
out_4374773061262803719[61] = 0;
out_4374773061262803719[62] = 0;
out_4374773061262803719[63] = 0;
out_4374773061262803719[64] = 0;
out_4374773061262803719[65] = 0;
}
void h_35(double *state, double *unused, double *out_5751710703471722702) {
out_5751710703471722702[0] = state[7];
out_5751710703471722702[1] = state[8];
out_5751710703471722702[2] = state[9];
}
void H_35(double *state, double *unused, double *out_1629210028937790010) {
out_1629210028937790010[0] = 0;
out_1629210028937790010[1] = 0;
out_1629210028937790010[2] = 0;
out_1629210028937790010[3] = 0;
out_1629210028937790010[4] = 0;
out_1629210028937790010[5] = 0;
out_1629210028937790010[6] = 0;
out_1629210028937790010[7] = 1;
out_1629210028937790010[8] = 0;
out_1629210028937790010[9] = 0;
out_1629210028937790010[10] = 0;
out_1629210028937790010[11] = 0;
out_1629210028937790010[12] = 0;
out_1629210028937790010[13] = 0;
out_1629210028937790010[14] = 0;
out_1629210028937790010[15] = 0;
out_1629210028937790010[16] = 0;
out_1629210028937790010[17] = 0;
out_1629210028937790010[18] = 0;
out_1629210028937790010[19] = 0;
out_1629210028937790010[20] = 0;
out_1629210028937790010[21] = 0;
out_1629210028937790010[22] = 0;
out_1629210028937790010[23] = 0;
out_1629210028937790010[24] = 0;
out_1629210028937790010[25] = 0;
out_1629210028937790010[26] = 0;
out_1629210028937790010[27] = 0;
out_1629210028937790010[28] = 0;
out_1629210028937790010[29] = 0;
out_1629210028937790010[30] = 1;
out_1629210028937790010[31] = 0;
out_1629210028937790010[32] = 0;
out_1629210028937790010[33] = 0;
out_1629210028937790010[34] = 0;
out_1629210028937790010[35] = 0;
out_1629210028937790010[36] = 0;
out_1629210028937790010[37] = 0;
out_1629210028937790010[38] = 0;
out_1629210028937790010[39] = 0;
out_1629210028937790010[40] = 0;
out_1629210028937790010[41] = 0;
out_1629210028937790010[42] = 0;
out_1629210028937790010[43] = 0;
out_1629210028937790010[44] = 0;
out_1629210028937790010[45] = 0;
out_1629210028937790010[46] = 0;
out_1629210028937790010[47] = 0;
out_1629210028937790010[48] = 0;
out_1629210028937790010[49] = 0;
out_1629210028937790010[50] = 0;
out_1629210028937790010[51] = 0;
out_1629210028937790010[52] = 0;
out_1629210028937790010[53] = 1;
out_1629210028937790010[54] = 0;
out_1629210028937790010[55] = 0;
out_1629210028937790010[56] = 0;
out_1629210028937790010[57] = 0;
out_1629210028937790010[58] = 0;
out_1629210028937790010[59] = 0;
out_1629210028937790010[60] = 0;
out_1629210028937790010[61] = 0;
out_1629210028937790010[62] = 0;
out_1629210028937790010[63] = 0;
out_1629210028937790010[64] = 0;
out_1629210028937790010[65] = 0;
}
void h_32(double *state, double *unused, double *out_7960850640984836266) {
out_7960850640984836266[0] = state[3];
out_7960850640984836266[1] = state[4];
out_7960850640984836266[2] = state[5];
out_7960850640984836266[3] = state[6];
}
void H_32(double *state, double *unused, double *out_8200477424115484408) {
out_8200477424115484408[0] = 0;
out_8200477424115484408[1] = 0;
out_8200477424115484408[2] = 0;
out_8200477424115484408[3] = 1;
out_8200477424115484408[4] = 0;
out_8200477424115484408[5] = 0;
out_8200477424115484408[6] = 0;
out_8200477424115484408[7] = 0;
out_8200477424115484408[8] = 0;
out_8200477424115484408[9] = 0;
out_8200477424115484408[10] = 0;
out_8200477424115484408[11] = 0;
out_8200477424115484408[12] = 0;
out_8200477424115484408[13] = 0;
out_8200477424115484408[14] = 0;
out_8200477424115484408[15] = 0;
out_8200477424115484408[16] = 0;
out_8200477424115484408[17] = 0;
out_8200477424115484408[18] = 0;
out_8200477424115484408[19] = 0;
out_8200477424115484408[20] = 0;
out_8200477424115484408[21] = 0;
out_8200477424115484408[22] = 0;
out_8200477424115484408[23] = 0;
out_8200477424115484408[24] = 0;
out_8200477424115484408[25] = 0;
out_8200477424115484408[26] = 1;
out_8200477424115484408[27] = 0;
out_8200477424115484408[28] = 0;
out_8200477424115484408[29] = 0;
out_8200477424115484408[30] = 0;
out_8200477424115484408[31] = 0;
out_8200477424115484408[32] = 0;
out_8200477424115484408[33] = 0;
out_8200477424115484408[34] = 0;
out_8200477424115484408[35] = 0;
out_8200477424115484408[36] = 0;
out_8200477424115484408[37] = 0;
out_8200477424115484408[38] = 0;
out_8200477424115484408[39] = 0;
out_8200477424115484408[40] = 0;
out_8200477424115484408[41] = 0;
out_8200477424115484408[42] = 0;
out_8200477424115484408[43] = 0;
out_8200477424115484408[44] = 0;
out_8200477424115484408[45] = 0;
out_8200477424115484408[46] = 0;
out_8200477424115484408[47] = 0;
out_8200477424115484408[48] = 0;
out_8200477424115484408[49] = 1;
out_8200477424115484408[50] = 0;
out_8200477424115484408[51] = 0;
out_8200477424115484408[52] = 0;
out_8200477424115484408[53] = 0;
out_8200477424115484408[54] = 0;
out_8200477424115484408[55] = 0;
out_8200477424115484408[56] = 0;
out_8200477424115484408[57] = 0;
out_8200477424115484408[58] = 0;
out_8200477424115484408[59] = 0;
out_8200477424115484408[60] = 0;
out_8200477424115484408[61] = 0;
out_8200477424115484408[62] = 0;
out_8200477424115484408[63] = 0;
out_8200477424115484408[64] = 0;
out_8200477424115484408[65] = 0;
out_8200477424115484408[66] = 0;
out_8200477424115484408[67] = 0;
out_8200477424115484408[68] = 0;
out_8200477424115484408[69] = 0;
out_8200477424115484408[70] = 0;
out_8200477424115484408[71] = 0;
out_8200477424115484408[72] = 1;
out_8200477424115484408[73] = 0;
out_8200477424115484408[74] = 0;
out_8200477424115484408[75] = 0;
out_8200477424115484408[76] = 0;
out_8200477424115484408[77] = 0;
out_8200477424115484408[78] = 0;
out_8200477424115484408[79] = 0;
out_8200477424115484408[80] = 0;
out_8200477424115484408[81] = 0;
out_8200477424115484408[82] = 0;
out_8200477424115484408[83] = 0;
out_8200477424115484408[84] = 0;
out_8200477424115484408[85] = 0;
out_8200477424115484408[86] = 0;
out_8200477424115484408[87] = 0;
}
void h_13(double *state, double *unused, double *out_2913105661532148231) {
out_2913105661532148231[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_2913105661532148231[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_2913105661532148231[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_6442117529364745675) {
out_6442117529364745675[0] = 0;
out_6442117529364745675[1] = 0;
out_6442117529364745675[2] = 0;
out_6442117529364745675[3] = 2*state[3]*state[7] - 2*state[5]*state[9] + 2*state[6]*state[8];
out_6442117529364745675[4] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9];
out_6442117529364745675[5] = -2*state[3]*state[9] + 2*state[4]*state[8] - 2*state[5]*state[7];
out_6442117529364745675[6] = 2*state[3]*state[8] + 2*state[4]*state[9] - 2*state[6]*state[7];
out_6442117529364745675[7] = pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2);
out_6442117529364745675[8] = 2*state[3]*state[6] + 2*state[4]*state[5];
out_6442117529364745675[9] = -2*state[3]*state[5] + 2*state[4]*state[6];
out_6442117529364745675[10] = 0;
out_6442117529364745675[11] = 0;
out_6442117529364745675[12] = 0;
out_6442117529364745675[13] = 0;
out_6442117529364745675[14] = 0;
out_6442117529364745675[15] = 0;
out_6442117529364745675[16] = 0;
out_6442117529364745675[17] = 0;
out_6442117529364745675[18] = 0;
out_6442117529364745675[19] = 0;
out_6442117529364745675[20] = 0;
out_6442117529364745675[21] = 0;
out_6442117529364745675[22] = 0;
out_6442117529364745675[23] = 0;
out_6442117529364745675[24] = 0;
out_6442117529364745675[25] = 2*state[3]*state[8] + 2*state[4]*state[9] - 2*state[6]*state[7];
out_6442117529364745675[26] = 2*state[3]*state[9] - 2*state[4]*state[8] + 2*state[5]*state[7];
out_6442117529364745675[27] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9];
out_6442117529364745675[28] = -2*state[3]*state[7] + 2*state[5]*state[9] - 2*state[6]*state[8];
out_6442117529364745675[29] = -2*state[3]*state[6] + 2*state[4]*state[5];
out_6442117529364745675[30] = pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2);
out_6442117529364745675[31] = 2*state[3]*state[4] + 2*state[5]*state[6];
out_6442117529364745675[32] = 0;
out_6442117529364745675[33] = 0;
out_6442117529364745675[34] = 0;
out_6442117529364745675[35] = 0;
out_6442117529364745675[36] = 0;
out_6442117529364745675[37] = 0;
out_6442117529364745675[38] = 0;
out_6442117529364745675[39] = 0;
out_6442117529364745675[40] = 0;
out_6442117529364745675[41] = 0;
out_6442117529364745675[42] = 0;
out_6442117529364745675[43] = 0;
out_6442117529364745675[44] = 0;
out_6442117529364745675[45] = 0;
out_6442117529364745675[46] = 0;
out_6442117529364745675[47] = 2*state[3]*state[9] - 2*state[4]*state[8] + 2*state[5]*state[7];
out_6442117529364745675[48] = -2*state[3]*state[8] - 2*state[4]*state[9] + 2*state[6]*state[7];
out_6442117529364745675[49] = 2*state[3]*state[7] - 2*state[5]*state[9] + 2*state[6]*state[8];
out_6442117529364745675[50] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9];
out_6442117529364745675[51] = 2*state[3]*state[5] + 2*state[4]*state[6];
out_6442117529364745675[52] = -2*state[3]*state[4] + 2*state[5]*state[6];
out_6442117529364745675[53] = pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2);
out_6442117529364745675[54] = 0;
out_6442117529364745675[55] = 0;
out_6442117529364745675[56] = 0;
out_6442117529364745675[57] = 0;
out_6442117529364745675[58] = 0;
out_6442117529364745675[59] = 0;
out_6442117529364745675[60] = 0;
out_6442117529364745675[61] = 0;
out_6442117529364745675[62] = 0;
out_6442117529364745675[63] = 0;
out_6442117529364745675[64] = 0;
out_6442117529364745675[65] = 0;
}
void h_14(double *state, double *unused, double *out_4670376777294811307) {
out_4670376777294811307[0] = state[10];
out_4670376777294811307[1] = state[11];
out_4670376777294811307[2] = state[12];
}
void H_14(double *state, double *unused, double *out_9153039822665174869) {
out_9153039822665174869[0] = 0;
out_9153039822665174869[1] = 0;
out_9153039822665174869[2] = 0;
out_9153039822665174869[3] = 0;
out_9153039822665174869[4] = 0;
out_9153039822665174869[5] = 0;
out_9153039822665174869[6] = 0;
out_9153039822665174869[7] = 0;
out_9153039822665174869[8] = 0;
out_9153039822665174869[9] = 0;
out_9153039822665174869[10] = 1;
out_9153039822665174869[11] = 0;
out_9153039822665174869[12] = 0;
out_9153039822665174869[13] = 0;
out_9153039822665174869[14] = 0;
out_9153039822665174869[15] = 0;
out_9153039822665174869[16] = 0;
out_9153039822665174869[17] = 0;
out_9153039822665174869[18] = 0;
out_9153039822665174869[19] = 0;
out_9153039822665174869[20] = 0;
out_9153039822665174869[21] = 0;
out_9153039822665174869[22] = 0;
out_9153039822665174869[23] = 0;
out_9153039822665174869[24] = 0;
out_9153039822665174869[25] = 0;
out_9153039822665174869[26] = 0;
out_9153039822665174869[27] = 0;
out_9153039822665174869[28] = 0;
out_9153039822665174869[29] = 0;
out_9153039822665174869[30] = 0;
out_9153039822665174869[31] = 0;
out_9153039822665174869[32] = 0;
out_9153039822665174869[33] = 1;
out_9153039822665174869[34] = 0;
out_9153039822665174869[35] = 0;
out_9153039822665174869[36] = 0;
out_9153039822665174869[37] = 0;
out_9153039822665174869[38] = 0;
out_9153039822665174869[39] = 0;
out_9153039822665174869[40] = 0;
out_9153039822665174869[41] = 0;
out_9153039822665174869[42] = 0;
out_9153039822665174869[43] = 0;
out_9153039822665174869[44] = 0;
out_9153039822665174869[45] = 0;
out_9153039822665174869[46] = 0;
out_9153039822665174869[47] = 0;
out_9153039822665174869[48] = 0;
out_9153039822665174869[49] = 0;
out_9153039822665174869[50] = 0;
out_9153039822665174869[51] = 0;
out_9153039822665174869[52] = 0;
out_9153039822665174869[53] = 0;
out_9153039822665174869[54] = 0;
out_9153039822665174869[55] = 0;
out_9153039822665174869[56] = 1;
out_9153039822665174869[57] = 0;
out_9153039822665174869[58] = 0;
out_9153039822665174869[59] = 0;
out_9153039822665174869[60] = 0;
out_9153039822665174869[61] = 0;
out_9153039822665174869[62] = 0;
out_9153039822665174869[63] = 0;
out_9153039822665174869[64] = 0;
out_9153039822665174869[65] = 0;
}
void h_33(double *state, double *unused, double *out_3733937587285700568) {
out_3733937587285700568[0] = state[16];
out_3733937587285700568[1] = state[17];
out_3733937587285700568[2] = state[18];
}
void H_33(double *state, double *unused, double *out_1521346975701067594) {
out_1521346975701067594[0] = 0;
out_1521346975701067594[1] = 0;
out_1521346975701067594[2] = 0;
out_1521346975701067594[3] = 0;
out_1521346975701067594[4] = 0;
out_1521346975701067594[5] = 0;
out_1521346975701067594[6] = 0;
out_1521346975701067594[7] = 0;
out_1521346975701067594[8] = 0;
out_1521346975701067594[9] = 0;
out_1521346975701067594[10] = 0;
out_1521346975701067594[11] = 0;
out_1521346975701067594[12] = 0;
out_1521346975701067594[13] = 0;
out_1521346975701067594[14] = 0;
out_1521346975701067594[15] = 0;
out_1521346975701067594[16] = 1;
out_1521346975701067594[17] = 0;
out_1521346975701067594[18] = 0;
out_1521346975701067594[19] = 0;
out_1521346975701067594[20] = 0;
out_1521346975701067594[21] = 0;
out_1521346975701067594[22] = 0;
out_1521346975701067594[23] = 0;
out_1521346975701067594[24] = 0;
out_1521346975701067594[25] = 0;
out_1521346975701067594[26] = 0;
out_1521346975701067594[27] = 0;
out_1521346975701067594[28] = 0;
out_1521346975701067594[29] = 0;
out_1521346975701067594[30] = 0;
out_1521346975701067594[31] = 0;
out_1521346975701067594[32] = 0;
out_1521346975701067594[33] = 0;
out_1521346975701067594[34] = 0;
out_1521346975701067594[35] = 0;
out_1521346975701067594[36] = 0;
out_1521346975701067594[37] = 0;
out_1521346975701067594[38] = 0;
out_1521346975701067594[39] = 1;
out_1521346975701067594[40] = 0;
out_1521346975701067594[41] = 0;
out_1521346975701067594[42] = 0;
out_1521346975701067594[43] = 0;
out_1521346975701067594[44] = 0;
out_1521346975701067594[45] = 0;
out_1521346975701067594[46] = 0;
out_1521346975701067594[47] = 0;
out_1521346975701067594[48] = 0;
out_1521346975701067594[49] = 0;
out_1521346975701067594[50] = 0;
out_1521346975701067594[51] = 0;
out_1521346975701067594[52] = 0;
out_1521346975701067594[53] = 0;
out_1521346975701067594[54] = 0;
out_1521346975701067594[55] = 0;
out_1521346975701067594[56] = 0;
out_1521346975701067594[57] = 0;
out_1521346975701067594[58] = 0;
out_1521346975701067594[59] = 0;
out_1521346975701067594[60] = 0;
out_1521346975701067594[61] = 0;
out_1521346975701067594[62] = 1;
out_1521346975701067594[63] = 0;
out_1521346975701067594[64] = 0;
out_1521346975701067594[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_6690968010248080223) {
H(in_vec, out_6690968010248080223);
}
void live_err_fun(double *nom_x, double *delta_x, double *out_5128644486154966433) {
err_fun(nom_x, delta_x, out_5128644486154966433);
}
void live_inv_err_fun(double *nom_x, double *true_x, double *out_7600355658971333284) {
inv_err_fun(nom_x, true_x, out_7600355658971333284);
}
void live_H_mod_fun(double *state, double *out_1685726956674156760) {
H_mod_fun(state, out_1685726956674156760);
}
void live_f_fun(double *state, double dt, double *out_774966178326963321) {
f_fun(state, dt, out_774966178326963321);
}
void live_F_fun(double *state, double dt, double *out_7282145086155387076) {
F_fun(state, dt, out_7282145086155387076);
}
void live_h_4(double *state, double *unused, double *out_3936704980047894152) {
h_4(state, unused, out_3936704980047894152);
}
void live_H_4(double *state, double *unused, double *out_9052514604414786102) {
H_4(state, unused, out_9052514604414786102);
}
void live_h_9(double *state, double *unused, double *out_4670376777294811307) {
h_9(state, unused, out_4670376777294811307);
}
void live_H_9(double *state, double *unused, double *out_9153039822665174869) {
H_9(state, unused, out_9153039822665174869);
}
void live_h_10(double *state, double *unused, double *out_5114531167885874097) {
h_10(state, unused, out_5114531167885874097);
}
void live_H_10(double *state, double *unused, double *out_8901083693322163334) {
H_10(state, unused, out_8901083693322163334);
}
void live_h_12(double *state, double *unused, double *out_6249225679190641860) {
h_12(state, unused, out_6249225679190641860);
}
void live_H_12(double *state, double *unused, double *out_4374773061262803719) {
H_12(state, unused, out_4374773061262803719);
}
void live_h_35(double *state, double *unused, double *out_5751710703471722702) {
h_35(state, unused, out_5751710703471722702);
}
void live_H_35(double *state, double *unused, double *out_1629210028937790010) {
H_35(state, unused, out_1629210028937790010);
}
void live_h_32(double *state, double *unused, double *out_7960850640984836266) {
h_32(state, unused, out_7960850640984836266);
}
void live_H_32(double *state, double *unused, double *out_8200477424115484408) {
H_32(state, unused, out_8200477424115484408);
}
void live_h_13(double *state, double *unused, double *out_2913105661532148231) {
h_13(state, unused, out_2913105661532148231);
}
void live_H_13(double *state, double *unused, double *out_6442117529364745675) {
H_13(state, unused, out_6442117529364745675);
}
void live_h_14(double *state, double *unused, double *out_4670376777294811307) {
h_14(state, unused, out_4670376777294811307);
}
void live_H_14(double *state, double *unused, double *out_9153039822665174869) {
H_14(state, unused, out_9153039822665174869);
}
void live_h_33(double *state, double *unused, double *out_3733937587285700568) {
h_33(state, unused, out_3733937587285700568);
}
void live_H_33(double *state, double *unused, double *out_1521346975701067594) {
H_33(state, unused, out_1521346975701067594);
}
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_init(live);