function [Fk,FktoE,FktoR,FktoP] = galen_fk(q_state)

L1 = q_state(1);
L2 = q_state(2);
L3 = q_state(3);
theta_r = q_state(4);
theta_e = q_state(5);

FktoP =[3^(1/2)/2,       1/2, 0, (3^(1/2)*((4503599627370496*L2^2)/3034380251534491 - (4503599627370496*L1^2)/3034380251534491 + (((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)*((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 125/10511401530282737664) + 2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 125/10511401530282737664) + 2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + L1^2/3 + L2^2/3 + L3^2/3 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 125/10511401530282737664)^2 - 21045737641667861393/135107988821114880000))^(1/2)))/(2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 2)))/2 - (500*L1^2)/1167 - (500*L2^2)/1167 + (1000*L3^2)/1167 + (((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)*((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 125/10511401530282737664) + 2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 125/10511401530282737664) + 2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + L1^2/3 + L2^2/3 + L3^2/3 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 125/10511401530282737664)^2 - 21045737641667861393/135107988821114880000))^(1/2)))/(2*(2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 2)) - 10783562738704818707/21022803060565475328;
     -1/2, 3^(1/2)/2, 0,                (2251799813685248*L1^2)/3034380251534491 - (3^(1/2)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 - (((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)*((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 125/10511401530282737664) + 2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 125/10511401530282737664) + 2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + L1^2/3 + L2^2/3 + L3^2/3 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 125/10511401530282737664)^2 - 21045737641667861393/135107988821114880000))^(1/2)))/(2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 2) + 125/10511401530282737664))/2 - (2251799813685248*L2^2)/3034380251534491 - (((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)*((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 125/10511401530282737664) + 2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 125/10511401530282737664) + 2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + L1^2/3 + L2^2/3 + L3^2/3 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 125/10511401530282737664)^2 - 21045737641667861393/135107988821114880000))^(1/2)))/(2*(2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 2));
        0,         0, 1,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 125/10511401530282737664) + 2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 125/10511401530282737664) + 2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + L1^2/3 + L2^2/3 + L3^2/3 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 125/10511401530282737664)^2 - 21045737641667861393/135107988821114880000))^(1/2))/(2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 2) - 8523/10000;
        0,         0, 0,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         1];
 
 
FktoR =[-(2483878800010755*sin(theta_r))/40564819207303340847894502572032, -(2483878800010755*cos(theta_r))/40564819207303340847894502572032,                                                 1,                    (1000*L3^2)/1167 - (500*L2^2)/1167 - (500*L1^2)/1167 + (3^(1/2)*((4503599627370496*L2^2)/3034380251534491 - (4503599627370496*L1^2)/3034380251534491 + (((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)*((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)^2 + L1^2/3 + L2^2/3 + L3^2/3 - 5612196704444763/36028797018963968))^(1/2) + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)))/(2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 2)))/2 + (((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)*((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)^2 + L1^2/3 + L2^2/3 + L3^2/3 - 5612196704444763/36028797018963968))^(1/2) + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)))/(4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4) - 4620206828922373/9007199254740992;
    cos(theta_r) + sin(theta_r)/162259276829213363391578010288128,     cos(theta_r)/162259276829213363391578010288128 - sin(theta_r),                                                 0, (2251799813685248*L1^2)/3034380251534491 - (3^(1/2)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 - (((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)*((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)^2 + L1^2/3 + L2^2/3 + L3^2/3 - 5612196704444763/36028797018963968))^(1/2) + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)))/(2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 2) + 3859125644704795/324518553658426726783156020576256))/2 - (2251799813685248*L2^2)/3034380251534491 - (((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)*((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)^2 + L1^2/3 + L2^2/3 + L3^2/3 - 5612196704444763/36028797018963968))^(1/2) + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)))/(4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4);
                                                     sin(theta_r),                                                      cos(theta_r), 4967757600021511/81129638414606681695789005144064,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)^2 + L1^2/3 + L2^2/3 + L3^2/3 - 5612196704444763/36028797018963968))^(1/2) + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256))/(2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 2) - 7941/10000;
                                                                0,                                                                 0,                                                 0,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    1];
 
 
FktoE = [sin(theta_e) - (2483878800010755*cos(theta_r)*(cos(theta_e) + (684969180613545*sin(theta_e))/182687704666362864775460604089535377456991567872))/40564819207303340847894502572032 - (2483878800010755*sin(theta_r)*((4967757600021511*cos(theta_e))/81129638414606681695789005144064 - (4967757600021511*sin(theta_e))/81129638414606681695789005144064))/40564819207303340847894502572032, cos(theta_e) + (2483878800010755*sin(theta_r)*((4967757600021511*cos(theta_e))/81129638414606681695789005144064 + (4967757600021511*sin(theta_e))/81129638414606681695789005144064))/40564819207303340847894502572032 - (2483878800010755*cos(theta_r)*((684969180613545*cos(theta_e))/182687704666362864775460604089535377456991567872 - sin(theta_e)))/40564819207303340847894502572032, (5479753444908359*cos(theta_r))/1461501637330902918203684832716283019655932542976 - (2483878800010755*sin(theta_r))/40564819207303340847894502572032 + 4967757600021511/81129638414606681695789005144064, (1490327280006453*cos(theta_r - 4967757600021511/81129638414606681695789005144064))/1622592768292133633915780102881280 - (500*L1^2)/1167 - (500*L2^2)/1167 + (1000*L3^2)/1167 + (3^(1/2)*((4503599627370496*L2^2)/3034380251534491 - (4503599627370496*L1^2)/3034380251534491 + (((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)*((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)^2 + L1^2/3 + L2^2/3 + L3^2/3 - 5612196704444763/36028797018963968))^(1/2) + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)))/(2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 2)))/2 + (((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)*((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)^2 + L1^2/3 + L2^2/3 + L3^2/3 - 5612196704444763/36028797018963968))^(1/2) + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)))/(4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4) + 4350621355227975/36028797018963968;
                 ((4967757600021511*cos(theta_e))/81129638414606681695789005144064 - (4967757600021511*sin(theta_e))/81129638414606681695789005144064)*(cos(theta_r) + sin(theta_r)/162259276829213363391578010288128) + (cos(theta_e) + (684969180613545*sin(theta_e))/182687704666362864775460604089535377456991567872)*(cos(theta_r)/162259276829213363391578010288128 - sin(theta_r)),                  ((684969180613545*cos(theta_e))/182687704666362864775460604089535377456991567872 - sin(theta_e))*(cos(theta_r)/162259276829213363391578010288128 - sin(theta_r)) - ((4967757600021511*cos(theta_e))/81129638414606681695789005144064 + (4967757600021511*sin(theta_e))/81129638414606681695789005144064)*(cos(theta_r) + sin(theta_r)/162259276829213363391578010288128),                                                                                                                           cos(theta_r) + (620969700002689*sin(theta_r))/10141204801825835211973625643008,                                                                          (2251799813685248*L1^2)/3034380251534491 - (3^(1/2)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 - (((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)*((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)^2 + L1^2/3 + L2^2/3 + L3^2/3 - 5612196704444763/36028797018963968))^(1/2) + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)))/(2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 2) + 3859125644704795/324518553658426726783156020576256))/2 - (3*cos(theta_r + pi/2))/200 - (2251799813685248*L2^2)/3034380251534491 - (((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)*((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)^2 + L1^2/3 + L2^2/3 + L3^2/3 - 5612196704444763/36028797018963968))^(1/2) + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)))/(4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4);
                                                    (4967757600021511*sin(theta_e))/81129638414606681695789005144064 + cos(theta_r)*(cos(theta_e) + (684969180613545*sin(theta_e))/182687704666362864775460604089535377456991567872) + sin(theta_r)*((4967757600021511*cos(theta_e))/81129638414606681695789005144064 - (4967757600021511*sin(theta_e))/81129638414606681695789005144064),                                                     (4967757600021511*cos(theta_e))/81129638414606681695789005144064 - sin(theta_r)*((4967757600021511*cos(theta_e))/81129638414606681695789005144064 + (4967757600021511*sin(theta_e))/81129638414606681695789005144064) + cos(theta_r)*((684969180613545*cos(theta_e))/182687704666362864775460604089535377456991567872 - sin(theta_e)),                                                       sin(theta_r) - (4967757600021511*cos(theta_r))/81129638414606681695789005144064 + 684969180613545/182687704666362864775460604089535377456991567872,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)^2 + L1^2/3 + L2^2/3 + L3^2/3 - 5612196704444763/36028797018963968))^(1/2) + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256))/(2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 2) - (3*cos(theta_r - 4967757600021511/81129638414606681695789005144064))/200 - 7941/10000;
                                                                                                                                                                                                                                                                                                                                                                                        0,                                                                                                                                                                                                                                                                                                                                                                                         0,                                                                                                                                                                                                        0,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           1];
  
Fk = [sin(theta_e) - (2483878800010755*cos(theta_r)*(cos(theta_e) + (684969180613545*sin(theta_e))/182687704666362864775460604089535377456991567872))/40564819207303340847894502572032 - (2483878800010755*sin(theta_r)*((4967757600021511*cos(theta_e))/81129638414606681695789005144064 - (4967757600021511*sin(theta_e))/81129638414606681695789005144064))/40564819207303340847894502572032, cos(theta_e) + (2483878800010755*sin(theta_r)*((4967757600021511*cos(theta_e))/81129638414606681695789005144064 + (4967757600021511*sin(theta_e))/81129638414606681695789005144064))/40564819207303340847894502572032 - (2483878800010755*cos(theta_r)*((684969180613545*cos(theta_e))/182687704666362864775460604089535377456991567872 - sin(theta_e)))/40564819207303340847894502572032, (5479753444908359*cos(theta_r))/1461501637330902918203684832716283019655932542976 - (2483878800010755*sin(theta_r))/40564819207303340847894502572032 + 4967757600021511/81129638414606681695789005144064, (1490327280006453*cos(theta_r - 4967757600021511/81129638414606681695789005144064))/1622592768292133633915780102881280 + (2536787598105253*cos(theta_e))/72057594037927936 + (51*sin(theta_e))/2000 - (25335563760109701*cos(theta_r)*(cos(theta_e) + (684969180613545*sin(theta_e))/182687704666362864775460604089535377456991567872))/16225927682921336339157801028812800 - (25335563760109701*sin(theta_r)*((4967757600021511*cos(theta_e))/81129638414606681695789005144064 - (4967757600021511*sin(theta_e))/81129638414606681695789005144064))/16225927682921336339157801028812800 + (6301072935063841245954021996015*sin(theta_r)*((4967757600021511*cos(theta_e))/81129638414606681695789005144064 + (4967757600021511*sin(theta_e))/81129638414606681695789005144064))/2923003274661805836407369665432566039311865085952 - (500*L1^2)/1167 - (500*L2^2)/1167 + (1000*L3^2)/1167 + (3^(1/2)*((4503599627370496*L2^2)/3034380251534491 - (4503599627370496*L1^2)/3034380251534491 + (((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)*((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)^2 + L1^2/3 + L2^2/3 + L3^2/3 - 5612196704444763/36028797018963968))^(1/2) + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)))/(2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 2)))/2 - (6301072935063841245954021996015*cos(theta_r)*((684969180613545*cos(theta_e))/182687704666362864775460604089535377456991567872 - sin(theta_e)))/2923003274661805836407369665432566039311865085952 + (((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)*((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)^2 + L1^2/3 + L2^2/3 + L3^2/3 - 5612196704444763/36028797018963968))^(1/2) + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)))/(4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4) + 4350621355227975/36028797018963968;
                 ((4967757600021511*cos(theta_e))/81129638414606681695789005144064 - (4967757600021511*sin(theta_e))/81129638414606681695789005144064)*(cos(theta_r) + sin(theta_r)/162259276829213363391578010288128) + (cos(theta_e) + (684969180613545*sin(theta_e))/182687704666362864775460604089535377456991567872)*(cos(theta_r)/162259276829213363391578010288128 - sin(theta_r)),                  ((684969180613545*cos(theta_e))/182687704666362864775460604089535377456991567872 - sin(theta_e))*(cos(theta_r)/162259276829213363391578010288128 - sin(theta_r)) - ((4967757600021511*cos(theta_e))/81129638414606681695789005144064 + (4967757600021511*sin(theta_e))/81129638414606681695789005144064)*(cos(theta_r) + sin(theta_r)/162259276829213363391578010288128),                                                                                                                           cos(theta_r) + (620969700002689*sin(theta_r))/10141204801825835211973625643008,                                                                                                                                     (51*((4967757600021511*cos(theta_e))/81129638414606681695789005144064 - (4967757600021511*sin(theta_e))/81129638414606681695789005144064)*(cos(theta_r) + sin(theta_r)/162259276829213363391578010288128))/2000 - (3*cos(theta_r + pi/2))/200 - (2536787598105253*((4967757600021511*cos(theta_e))/81129638414606681695789005144064 + (4967757600021511*sin(theta_e))/81129638414606681695789005144064)*(cos(theta_r) + sin(theta_r)/162259276829213363391578010288128))/72057594037927936 - (3^(1/2)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 - (((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)*((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)^2 + L1^2/3 + L2^2/3 + L3^2/3 - 5612196704444763/36028797018963968))^(1/2) + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)))/(2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 2) + 3859125644704795/324518553658426726783156020576256))/2 + (51*(cos(theta_e) + (684969180613545*sin(theta_e))/182687704666362864775460604089535377456991567872)*(cos(theta_r)/162259276829213363391578010288128 - sin(theta_r)))/2000 + (2251799813685248*L1^2)/3034380251534491 - (2251799813685248*L2^2)/3034380251534491 + (2536787598105253*((684969180613545*cos(theta_e))/182687704666362864775460604089535377456991567872 - sin(theta_e))*(cos(theta_r)/162259276829213363391578010288128 - sin(theta_r)))/72057594037927936 - (((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)*((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)^2 + L1^2/3 + L2^2/3 + L3^2/3 - 5612196704444763/36028797018963968))^(1/2) + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)))/(4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4);
                                                    (4967757600021511*sin(theta_e))/81129638414606681695789005144064 + cos(theta_r)*(cos(theta_e) + (684969180613545*sin(theta_e))/182687704666362864775460604089535377456991567872) + sin(theta_r)*((4967757600021511*cos(theta_e))/81129638414606681695789005144064 - (4967757600021511*sin(theta_e))/81129638414606681695789005144064),                                                     (4967757600021511*cos(theta_e))/81129638414606681695789005144064 - sin(theta_r)*((4967757600021511*cos(theta_e))/81129638414606681695789005144064 + (4967757600021511*sin(theta_e))/81129638414606681695789005144064) + cos(theta_r)*((684969180613545*cos(theta_e))/182687704666362864775460604089535377456991567872 - sin(theta_e)),                                                       sin(theta_r) - (4967757600021511*cos(theta_r))/81129638414606681695789005144064 + 684969180613545/182687704666362864775460604089535377456991567872,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           (12602145870127685028695642097283*cos(theta_e))/5846006549323611672814739330865132078623730171904 - (3*cos(theta_r - 4967757600021511/81129638414606681695789005144064))/200 + (253355637601097061*sin(theta_e))/162259276829213363391578010288128000 + ((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + (((2*L1)/3 + (2*L2)/3 + (2*L3)/3 + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256))^2 - (4*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 4*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 4)*(((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491)^2 + ((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256)^2 + L1^2/3 + L2^2/3 + L3^2/3 - 5612196704444763/36028797018963968))^(1/2) + ((18014398509481984*L1)/3034380251534491 - (18014398509481984*L2)/3034380251534491)*((4503599627370496*L1^2)/3034380251534491 - (4503599627370496*L2^2)/3034380251534491) + ((4000*L1)/1167 + (4000*L2)/1167 - (8000*L3)/1167)*((1000*L1^2)/1167 + (1000*L2^2)/1167 - (2000*L3^2)/1167 + 3859125644704795/324518553658426726783156020576256))/(2*((9007199254740992*L1)/3034380251534491 - (9007199254740992*L2)/3034380251534491)^2 + 2*((2000*L1)/1167 + (2000*L2)/1167 - (4000*L3)/1167)^2 + 2) + (51*cos(theta_r)*(cos(theta_e) + (684969180613545*sin(theta_e))/182687704666362864775460604089535377456991567872))/2000 + (51*sin(theta_r)*((4967757600021511*cos(theta_e))/81129638414606681695789005144064 - (4967757600021511*sin(theta_e))/81129638414606681695789005144064))/2000 - (2536787598105253*sin(theta_r)*((4967757600021511*cos(theta_e))/81129638414606681695789005144064 + (4967757600021511*sin(theta_e))/81129638414606681695789005144064))/72057594037927936 + (2536787598105253*cos(theta_r)*((684969180613545*cos(theta_e))/182687704666362864775460604089535377456991567872 - sin(theta_e)))/72057594037927936 - 7941/10000;
                                                                                                                                                                                                                                                                                                                                                                                        0,                                                                                                                                                                                                                                                                                                                                                                                         0,                                                                                                                                                                                                        0,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1];
 

end