Files
onepilot/selfdrive/locationd/models/generated/live.cpp
2024-07-02 01:20:51 +00:00

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