text: /*
   * Automatically Generated from Mathematica.
   * Thu 14 Oct 2021 10:00:12 GMT-04:00
   */
  
  #ifdef MATLAB_MEX_FILE
  #include <stdexcept>
  #include <cmath>
  #include<math.h>
  /**
   * Copied from Wolfram Mathematica C Definitions file mdefs.hpp
   * Changed marcos to inline functions (Eric Cousineau)
   */
  inline double Power(double x, double y) { return pow(x, y); }
  inline double Sqrt(double x) { return sqrt(x); }
  
  inline double Abs(double x) { return fabs(x); }
  
  inline double Exp(double x) { return exp(x); }
  inline double Log(double x) { return log(x); }
  
  inline double Sin(double x) { return sin(x); }
  inline double Cos(double x) { return cos(x); }
  inline double Tan(double x) { return tan(x); }
  
  inline double ArcSin(double x) { return asin(x); }
  inline double ArcCos(double x) { return acos(x); }
  inline double ArcTan(double x) { return atan(x); }
  
  /* update ArcTan function to use atan2 instead. */
  inline double ArcTan(double x, double y) { return atan2(y,x); }
  
  inline double Sinh(double x) { return sinh(x); }
  inline double Cosh(double x) { return cosh(x); }
  inline double Tanh(double x) { return tanh(x); }
  
  const double E	= 2.71828182845904523536029;
  const double Pi = 3.14159265358979323846264;
  const double Degree = 0.01745329251994329576924;
  
  inline double Sec(double x) { return 1/cos(x); }
  inline double Csc(double x) { return 1/sin(x); }
  
  #endif
  
  /*
   * Sub functions
   */
  static void output1(double *p_output1,const double *var1,const double *var2)
  {
    double t224;
    double t267;
    double t324;
    double t257;
    double t279;
    double t311;
    double t197;
    double t337;
    double t360;
    double t369;
    double t388;
    double t316;
    double t374;
    double t385;
    double t108;
    double t422;
    double t434;
    double t436;
    double t513;
    double t386;
    double t437;
    double t439;
    double t80;
    double t559;
    double t567;
    double t570;
    double t37;
    double t55;
    double t500;
    double t575;
    double t580;
    double t583;
    double t587;
    double t615;
    double t650;
    double t651;
    double t660;
    double t665;
    double t691;
    double t735;
    double t796;
    double t848;
    double t862;
    double t1019;
    double t946;
    double t952;
    double t986;
    double t934;
    double t925;
    double t1095;
    double t1118;
    double t1177;
    double t1008;
    double t1058;
    double t1059;
    double t1195;
    t224 = Cos(var1[19]);
    t267 = Sin(var1[19]);
    t324 = Cos(var1[18]);
    t257 = 0.642788*t224;
    t279 = -0.766044*t267;
    t311 = t257 + t279;
    t197 = Sin(var1[18]);
    t337 = -0.766044*t224;
    t360 = -0.642788*t267;
    t369 = t337 + t360;
    t388 = Cos(var1[17]);
    t316 = -1.*t197*t311;
    t374 = t324*t369;
    t385 = 0. + t316 + t374;
    t108 = Sin(var1[17]);
    t422 = t324*t311;
    t434 = t197*t369;
    t436 = 0. + t422 + t434;
    t513 = Cos(var1[16]);
    t386 = t108*t385;
    t437 = t388*t436;
    t439 = 0. + t386 + t437;
    t80 = Sin(var1[16]);
    t559 = t388*t385;
    t567 = -1.*t108*t436;
    t570 = 0. + t559 + t567;
    t37 = Cos(var1[14]);
    t55 = Cos(var1[15]);
    t500 = -1.*t80*t439;
    t575 = t513*t570;
    t580 = 0. + t500 + t575;
    t583 = t55*t580;
    t587 = Sin(var1[15]);
    t615 = t513*t439;
    t650 = t80*t570;
    t651 = 0. + t615 + t650;
    t660 = -1.*t587*t651;
    t665 = 0. + t583 + t660;
    t691 = t37*t665;
    t735 = 0. + t691;
    t796 = t587*t580;
    t848 = t55*t651;
    t862 = 0. + t796 + t848;
    t1019 = Sin(var1[13]);
    t946 = Sin(var1[14]);
    t952 = t946*t665;
    t986 = 0. + t952;
    t934 = Cos(var1[13]);
    t925 = Cos(var1[5]);
    t1095 = t1019*t986;
    t1118 = t934*t862;
    t1177 = 0. + t1095 + t1118;
    t1008 = t934*t986;
    t1058 = -1.*t1019*t862;
    t1059 = 0. + t1008 + t1058;
    t1195 = Sin(var1[5]);
    p_output1[0]=0. + (0. - 1.*t1177*t1195 + t1059*t925)*var2[4] + t735*var2[5] + t735*var2[13] + t862*var2[14] + var2[3]*(0. + (0. + t1059*t1195 + t1177*t925)*Cos(var1[4]) - 1.*t735*Sin(var1[4]));
  }
  
  
  
  #ifdef MATLAB_MEX_FILE
  
  #include "mex.h"
  /*
   * Main function
   */
  void mexFunction( int nlhs, mxArray *plhs[],
                    int nrhs, const mxArray *prhs[] )
  {
    size_t mrows, ncols;
  
    double *var1,*var2;
    double *p_output1;
  
    /*  Check for proper number of arguments.  */ 
    if( nrhs != 2)
      {
        mexErrMsgIdAndTxt("MATLAB:MShaped:invalidNumInputs", "Two input(s) required (var1,var2).");
      }
    else if( nlhs > 1)
      {
        mexErrMsgIdAndTxt("MATLAB:MShaped:maxlhs", "Too many output arguments.");
      }
  
    /*  The input must be a noncomplex double vector or scaler.  */
    mrows = mxGetM(prhs[0]);
    ncols = mxGetN(prhs[0]);
    if( !mxIsDouble(prhs[0]) || mxIsComplex(prhs[0]) ||
      ( !(mrows == 20 && ncols == 1) && 
        !(mrows == 1 && ncols == 20))) 
      {
        mexErrMsgIdAndTxt( "MATLAB:MShaped:inputNotRealVector", "var1 is wrong.");
      }
    mrows = mxGetM(prhs[1]);
    ncols = mxGetN(prhs[1]);
    if( !mxIsDouble(prhs[1]) || mxIsComplex(prhs[1]) ||
      ( !(mrows == 20 && ncols == 1) && 
        !(mrows == 1 && ncols == 20))) 
      {
        mexErrMsgIdAndTxt( "MATLAB:MShaped:inputNotRealVector", "var2 is wrong.");
      }
  
    /*  Assign pointers to each input.  */
    var1 = mxGetPr(prhs[0]);
    var2 = mxGetPr(prhs[1]);
     
  
  
     
    /*  Create matrices for return arguments.  */
    plhs[0] = mxCreateDoubleMatrix((mwSize) 1, (mwSize) 1, mxREAL);
    p_output1 = mxGetPr(plhs[0]);
  
  
    /* Call the calculation subroutine. */
    output1(p_output1,var1,var2);
  
  
  }
  
  #else // MATLAB_MEX_FILE
  
  #include "swing_toe_angular_velocity_z_LeftStance.hh"
  
  namespace LeftStance
  {
  
  void swing_toe_angular_velocity_z_LeftStance_raw(double *p_output1, const double *var1,const double *var2)
  {
    // Call Subroutines
    output1(p_output1, var1, var2);
  
  }
  
  }
  
  #endif // MATLAB_MEX_FILE
  