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