text: /*
   * Academic License - for use in teaching, academic research, and meeting
   * course requirements at degree granting institutions only.  Not for
   * government, commercial, or other organizational use.
   *
   * massF2.c
   *
   * Code generation for function 'massF2'
   *
   */
  
  /* Include files */
  #include <string.h>
  #include "mwmathutil.h"
  #include "rt_nonfinite.h"
  #include "EOM.h"
  #include "massF2.h"
  #include "error.h"
  #include "EOM_data.h"
  
  /* Variable Definitions */
  static emlrtRSInfo jc_emlrtRSI = { 21, /* lineNo */
    "massF2",                            /* fcnName */
    "/home/hadi/MEGAsync/Hadi/AutoTMTDyn/Code/AutoTMTDyn/Beta/v1.0/code/massF2.m"/* pathName */
  };
  
  static emlrtRSInfo kc_emlrtRSI = { 22, /* lineNo */
    "massF2",                            /* fcnName */
    "/home/hadi/MEGAsync/Hadi/AutoTMTDyn/Code/AutoTMTDyn/Beta/v1.0/code/massF2.m"/* pathName */
  };
  
  static emlrtRSInfo lc_emlrtRSI = { 30, /* lineNo */
    "massF2",                            /* fcnName */
    "/home/hadi/MEGAsync/Hadi/AutoTMTDyn/Code/AutoTMTDyn/Beta/v1.0/code/massF2.m"/* pathName */
  };
  
  static emlrtRSInfo mc_emlrtRSI = { 31, /* lineNo */
    "massF2",                            /* fcnName */
    "/home/hadi/MEGAsync/Hadi/AutoTMTDyn/Code/AutoTMTDyn/Beta/v1.0/code/massF2.m"/* pathName */
  };
  
  static emlrtRSInfo nc_emlrtRSI = { 32, /* lineNo */
    "massF2",                            /* fcnName */
    "/home/hadi/MEGAsync/Hadi/AutoTMTDyn/Code/AutoTMTDyn/Beta/v1.0/code/massF2.m"/* pathName */
  };
  
  static emlrtRSInfo oc_emlrtRSI = { 33, /* lineNo */
    "massF2",                            /* fcnName */
    "/home/hadi/MEGAsync/Hadi/AutoTMTDyn/Code/AutoTMTDyn/Beta/v1.0/code/massF2.m"/* pathName */
  };
  
  static emlrtRSInfo pc_emlrtRSI = { 38, /* lineNo */
    "massF2",                            /* fcnName */
    "/home/hadi/MEGAsync/Hadi/AutoTMTDyn/Code/AutoTMTDyn/Beta/v1.0/code/massF2.m"/* pathName */
  };
  
  static emlrtRSInfo qc_emlrtRSI = { 39, /* lineNo */
    "massF2",                            /* fcnName */
    "/home/hadi/MEGAsync/Hadi/AutoTMTDyn/Code/AutoTMTDyn/Beta/v1.0/code/massF2.m"/* pathName */
  };
  
  static emlrtRSInfo rc_emlrtRSI = { 51, /* lineNo */
    "massF2",                            /* fcnName */
    "/home/hadi/MEGAsync/Hadi/AutoTMTDyn/Code/AutoTMTDyn/Beta/v1.0/code/massF2.m"/* pathName */
  };
  
  static emlrtRSInfo sc_emlrtRSI = { 52, /* lineNo */
    "massF2",                            /* fcnName */
    "/home/hadi/MEGAsync/Hadi/AutoTMTDyn/Code/AutoTMTDyn/Beta/v1.0/code/massF2.m"/* pathName */
  };
  
  /* Function Definitions */
  void massF2(const emlrtStack *sp, const real_T in1[34], const real_T in2[12],
              real_T out1[36], real_T out2[36], real_T out3[36], real_T out4[6])
  {
    real_T t2;
    real_T t3;
    real_T t9;
    real_T t10;
    real_T t11;
    real_T t12;
    real_T t13;
    real_T t17;
    real_T t49;
    real_T t19;
    real_T t20;
    real_T t21;
    real_T t22_tmp;
    real_T b_t22_tmp;
    real_T t22;
    real_T t25;
    real_T t26_tmp;
    real_T t26;
    real_T out2_tmp_tmp;
    real_T t48;
    real_T t60;
    real_T out2_tmp;
    real_T t61;
    real_T t62;
    real_T b_out2_tmp;
    real_T t27;
    real_T t28;
    real_T t29_tmp;
    real_T t31;
    real_T t32_tmp;
    real_T t33;
    real_T t36;
    real_T t37_tmp;
    real_T t39;
    real_T t41;
    real_T t43;
    real_T t44;
    real_T t45;
    real_T t46;
    real_T t47;
    real_T t48_tmp;
    emlrtStack st;
    emlrtStack b_st;
    st.prev = sp;
    st.tls = sp->tls;
    b_st.prev = &st;
    b_st.tls = st.tls;
  
    /* MASSF2 */
    /*     [OUT1,OUT2,OUT3,OUT4] = MASSF2(IN1,IN2,S) */
    /*     This function was generated by the Symbolic Math Toolbox version 8.2. */
    /*     04-Jan-2019 13:20:02 */
    st.site = &jc_emlrtRSI;
    t2 = in1[16] * in1[16];
    st.site = &kc_emlrtRSI;
    t3 = in1[17] * in1[17];
    t2 = in1[15] * (t2 + t3 * 3.0) / 12.0 + in1[15] * t2 / 4.0;
    out1[0] = in1[15];
    out1[1] = 0.0;
    out1[2] = 0.0;
    out1[3] = 0.0;
    out1[4] = 0.0;
    out1[5] = 0.0;
    out1[6] = 0.0;
    out1[7] = in1[15];
    out1[8] = 0.0;
    out1[9] = 0.0;
    out1[10] = 0.0;
    out1[11] = 0.0;
    out1[12] = 0.0;
    out1[13] = 0.0;
    out1[14] = in1[15];
    out1[15] = 0.0;
    out1[16] = 0.0;
    out1[17] = 0.0;
    out1[18] = 0.0;
    out1[19] = 0.0;
    out1[20] = 0.0;
    out1[21] = t2;
    out1[22] = 0.0;
    out1[23] = 0.0;
    out1[24] = 0.0;
    out1[25] = 0.0;
    out1[26] = 0.0;
    out1[27] = 0.0;
    out1[28] = t2;
    out1[29] = 0.0;
    out1[30] = 0.0;
    out1[31] = 0.0;
    out1[32] = 0.0;
    out1[33] = 0.0;
    out1[34] = 0.0;
    out1[35] = in1[15] * t3 / 2.0;
    st.site = &lc_emlrtRSI;
    t9 = in1[4] * in1[4];
    st.site = &mc_emlrtRSI;
    t10 = in2[3] * in2[3];
    st.site = &nc_emlrtRSI;
    t11 = in2[4] * in2[4];
    st.site = &oc_emlrtRSI;
    t12 = in2[5] * in2[5];
    t13 = ((-(t9 * t10) - t9 * t11) - t9 * t12) + 1.0;
    st.site = &pc_emlrtRSI;
    if (t13 < 0.0) {
      b_st.site = &qb_emlrtRSI;
      b_error(&b_st);
    }
  
    t2 = muDoubleScalarSqrt(t13);
    t17 = 1.0 / t2;
    st.site = &qc_emlrtRSI;
    t49 = in1[16] * in1[4];
    t19 = t49 * t2;
    t20 = in1[16] * in2[5] * t9;
    t21 = in2[5] * t9 * 2.0;
    t22_tmp = in1[4] * in2[3];
    b_t22_tmp = t22_tmp * in2[4];
    t22 = b_t22_tmp * t9 * t17 * 2.0;
    t2 = in1[4] * t2 * 2.0;
    t3 = t22_tmp * in2[5] * t9 * t17 * 2.0;
    t25 = in2[3] * t9 * 2.0;
    t26_tmp = in1[4] * in2[4];
    t26 = t26_tmp * in2[5] * t9 * t17 * 2.0;
    out2[0] = t9;
    out2[1] = 0.0;
    out2[2] = 0.0;
    out2[3] = 0.0;
    out2[4] = 0.0;
    out2[5] = 0.0;
    out2[6] = 0.0;
    out2[7] = t9;
    out2[8] = 0.0;
    out2[9] = 0.0;
    out2[10] = 0.0;
    out2[11] = 0.0;
    out2[12] = 0.0;
    out2[13] = 0.0;
    out2[14] = t9;
    out2[15] = 0.0;
    out2[16] = 0.0;
    out2[17] = 0.0;
    out2_tmp_tmp = t49 * in2[3];
    t48 = out2_tmp_tmp * in2[4];
    t60 = t48 * t9 * t17;
    out2[18] = t20 - t60;
    out2_tmp = t49 * t9;
    out2[19] = -t19 + out2_tmp * t10 * t17;
    t61 = in1[16] * in2[3] * t9;
    out2[20] = t61 * -2.0;
    t62 = in1[4] * t9;
    out2[21] = t2 + t62 * t10 * t17 * 2.0;
    out2[22] = -t21 + t22;
    b_out2_tmp = in2[4] * t9 * 2.0;
    out2[23] = t3 + b_out2_tmp;
    out2[24] = t19 - out2_tmp * t11 * t17;
    out2[25] = t20 + t60;
    t60 = in1[16] * in2[4] * t9;
    out2[26] = t60 * -2.0;
    out2[27] = t21 + t22;
    out2[28] = t2 + t62 * t11 * t17 * 2.0;
    out2[29] = -t25 + t26;
    out2_tmp = t49 * in2[4];
    out2[30] = t61 - out2_tmp * in2[5] * t9 * t17;
    out2[31] = t60 + out2_tmp_tmp * in2[5] * t9 * t17;
    out2[32] = 0.0;
    out2[33] = t3 - b_out2_tmp;
    out2[34] = t25 + t26;
    out2[35] = t2 + t62 * t12 * t17 * 2.0;
    st.site = &rc_emlrtRSI;
    t27 = t9 * t9;
    st.site = &sc_emlrtRSI;
    t28 = 1.0 / muDoubleScalarPower(t13, 1.5);
    t29_tmp = out2_tmp_tmp * t9 * t17;
    t31 = t29_tmp + out2_tmp_tmp * t11 * t27 * t28;
    t32_tmp = in1[16] * t9;
    t2 = t48 * in2[5] * t27 * t28;
    t33 = t32_tmp - t2;
    t3 = t49 * in2[5];
    t25 = t3 * t9 * t17;
    t36 = t25 + t3 * t11 * t27 * t28;
    t37_tmp = out2_tmp * t9 * t17;
    t39 = t37_tmp + out2_tmp * t10 * t27 * t28;
    t41 = t32_tmp + t2;
    t43 = t25 + t3 * t10 * t27 * t28;
    t44 = t26_tmp * t9 * t17 * 2.0;
    t45 = t26_tmp * t10 * t27 * t28 * 2.0;
    t46 = t22_tmp * t9 * t17 * 2.0;
    t47 = t9 * 2.0;
    t48_tmp = in1[4] * in2[5];
    t48 = t48_tmp * t9 * t17 * 2.0;
    t49 = t48_tmp * t10 * t27 * t28 * 2.0;
    t2 = b_t22_tmp * in2[5] * t27 * t28 * 2.0;
    t19 = t47 + t2;
    t20 = t44 + t45;
    t21 = t22_tmp * t11 * t27 * t28 * 2.0;
    t22 = t46 + t21;
    t13 = t48_tmp * t11 * t27 * t28 * 2.0;
    t2 = t47 - t2;
    t3 = t48 + t49;
    t25 = t22_tmp * t12 * t27 * t28 * 2.0;
    t26 = t48 + t13;
    t60 = t26_tmp * t12 * t27 * t28 * 2.0;
    t61 = t46 + t25;
    t62 = t44 + t60;
    memset(&out3[0], 0, 18U * sizeof(real_T));
    b_out2_tmp = t39 * in2[9];
    out3[18] = (-t31 * in2[10] + t33 * in2[11]) - b_out2_tmp;
    out3[19] = (t39 * in2[10] + t43 * in2[11]) + in2[9] * (t29_tmp * 3.0 +
      out2_tmp_tmp * t10 * t27 * t28);
    out3[20] = t32_tmp * in2[9] * -2.0;
    out3[21] = (in2[9] * (t46 + t22_tmp * t10 * t27 * t28 * 2.0) + t20 * in2[10])
      + t3 * in2[11];
    out3[22] = (t20 * in2[9] + t19 * in2[11]) - in2[10] * (t46 - t21);
    out3[23] = (-t2 * in2[10] + t3 * in2[9]) - in2[11] * (t46 - t25);
    out3[24] = (-t31 * in2[9] - t36 * in2[11]) - in2[10] * (t37_tmp * 3.0 +
      out2_tmp * t11 * t27 * t28);
    out3[25] = (t31 * in2[10] + b_out2_tmp) + t41 * in2[11];
    out3[26] = t32_tmp * in2[10] * -2.0;
    out3[27] = (t22 * in2[10] - in2[9] * (t44 - t45)) - in2[11] * (t47 - in1[4] *
      in2[3] * in2[4] * in2[5] * t27 * t28 * 2.0);
    out3[28] = (in2[10] * (t44 + t26_tmp * t11 * t27 * t28 * 2.0) + t22 * in2[9])
      + t26 * in2[11];
    out3[29] = (t19 * in2[9] + t26 * in2[10]) - in2[11] * (t44 - t60);
    out3[30] = (t33 * in2[9] - t36 * in2[10]) - in2[11] * (t37_tmp + out2_tmp *
      t12 * t27 * t28);
    out3[31] = (t41 * in2[10] + t43 * in2[9]) + in2[11] * (t29_tmp + out2_tmp_tmp *
      t12 * t27 * t28);
    out3[32] = 0.0;
    out3[33] = (t19 * in2[10] + t61 * in2[11]) - in2[9] * (t48 - t49);
    out3[34] = (-t2 * in2[9] + t62 * in2[11]) - in2[10] * (t48 - t13);
    out3[35] = (in2[11] * (t48 + t48_tmp * t12 * t27 * t28 * 2.0) + t61 * in2[9])
      + t62 * in2[10];
    out4[0] = in1[12];
    out4[1] = in1[13];
    out4[2] = in1[14];
    out4[3] = 0.0;
    out4[4] = 0.0;
    out4[5] = 0.0;
  }
  
  /* End of code generation (massF2.c) */
  