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