text: /*
   * Automatically Generated from Mathematica.
   * Thu 4 Nov 2021 17:00:08 GMT-04:00
   */
  #include <stdio.h>
  #include <stdlib.h>
  #include <math.h>
  
  #include "H_left_knee.h"
  
  #ifdef _MSC_VER
    #define INLINE __forceinline /* use __forceinline (VC++ specific) */
  #else
    #define INLINE static inline        /* use standard inline */
  #endif
  
  /**
   * 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 Csc(double x) { return 1.0/sin(x); }
  INLINE double Sec(double x) { return 1.0/cos(x); }
  
  INLINE double ArcSin(double x) { return asin(x); }
  INLINE double ArcCos(double x) { return acos(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); }
  
  #define E 2.71828182845904523536029
  #define Pi 3.14159265358979323846264
  #define Degree 0.01745329251994329576924
  
  /*
   * Sub functions
   */
  static void output1(Eigen::Matrix<double,4,4> &p_output1, const Eigen::Matrix<double,36,1> &var1)
  {
    double t8014;
    double t8393;
    double t1925;
    double t3703;
    double t7691;
    double t7997;
    double t8016;
    double t8169;
    double t8197;
    double t8236;
    double t8399;
    double t1920;
    double t8416;
    double t8418;
    double t8434;
    double t8385;
    double t8408;
    double t8409;
    double t8435;
    double t1669;
    double t8463;
    double t8468;
    double t8471;
    double t8411;
    double t8441;
    double t8442;
    double t8475;
    double t1108;
    double t8557;
    double t8560;
    double t8562;
    double t8604;
    double t8609;
    double t8610;
    double t8572;
    double t8598;
    double t8600;
    double t8486;
    double t8631;
    double t8638;
    double t8644;
    double t8603;
    double t8618;
    double t8619;
    double t8806;
    double t8809;
    double t8815;
    double t8731;
    double t8768;
    double t8787;
    double t8862;
    double t8864;
    double t8866;
    double t8796;
    double t8820;
    double t8856;
    double t8452;
    double t8476;
    double t8479;
    double t8497;
    double t8518;
    double t8532;
    double t8626;
    double t8659;
    double t8667;
    double t8671;
    double t8673;
    double t8681;
    double t8858;
    double t8881;
    double t8893;
    double t8900;
    double t8901;
    double t8904;
    t8014 = Cos(var1[3]);
    t8393 = Cos(var1[4]);
    t1925 = Cos(var1[6]);
    t3703 = Cos(var1[5]);
    t7691 = Sin(var1[3]);
    t7997 = -1.*t3703*t7691;
    t8016 = Sin(var1[4]);
    t8169 = Sin(var1[5]);
    t8197 = t8014*t8016*t8169;
    t8236 = t7997 + t8197;
    t8399 = Sin(var1[6]);
    t1920 = Cos(var1[7]);
    t8416 = t8014*t8393*t1925;
    t8418 = t8236*t8399;
    t8434 = t8416 + t8418;
    t8385 = t1925*t8236;
    t8408 = -1.*t8014*t8393*t8399;
    t8409 = t8385 + t8408;
    t8435 = Sin(var1[7]);
    t1669 = Cos(var1[8]);
    t8463 = t1920*t8434;
    t8468 = t8409*t8435;
    t8471 = t8463 + t8468;
    t8411 = t1920*t8409;
    t8441 = -1.*t8434*t8435;
    t8442 = t8411 + t8441;
    t8475 = Sin(var1[8]);
    t1108 = Sin(var1[9]);
    t8557 = t8014*t3703;
    t8560 = t7691*t8016*t8169;
    t8562 = t8557 + t8560;
    t8604 = t8393*t1925*t7691;
    t8609 = t8562*t8399;
    t8610 = t8604 + t8609;
    t8572 = t1925*t8562;
    t8598 = -1.*t8393*t7691*t8399;
    t8600 = t8572 + t8598;
    t8486 = Cos(var1[9]);
    t8631 = t1920*t8610;
    t8638 = t8600*t8435;
    t8644 = t8631 + t8638;
    t8603 = t1920*t8600;
    t8618 = -1.*t8610*t8435;
    t8619 = t8603 + t8618;
    t8806 = -1.*t1925*t8016;
    t8809 = t8393*t8169*t8399;
    t8815 = t8806 + t8809;
    t8731 = t8393*t1925*t8169;
    t8768 = t8016*t8399;
    t8787 = t8731 + t8768;
    t8862 = t1920*t8815;
    t8864 = t8787*t8435;
    t8866 = t8862 + t8864;
    t8796 = t1920*t8787;
    t8820 = -1.*t8815*t8435;
    t8856 = t8796 + t8820;
    t8452 = t1669*t8442;
    t8476 = t8471*t8475;
    t8479 = t8452 + t8476;
    t8497 = t1669*t8471;
    t8518 = -1.*t8442*t8475;
    t8532 = t8497 + t8518;
    t8626 = t1669*t8619;
    t8659 = t8644*t8475;
    t8667 = t8626 + t8659;
    t8671 = t1669*t8644;
    t8673 = -1.*t8619*t8475;
    t8681 = t8671 + t8673;
    t8858 = t1669*t8856;
    t8881 = t8866*t8475;
    t8893 = t8858 + t8881;
    t8900 = t1669*t8866;
    t8901 = -1.*t8856*t8475;
    t8904 = t8900 + t8901;
  
    p_output1(0)=t1108*t8479 + t8486*t8532;
    p_output1(1)=t1108*t8667 + t8486*t8681;
    p_output1(2)=t1108*t8893 + t8486*t8904;
    p_output1(3)=0;
    p_output1(4)=t8479*t8486 - 1.*t1108*t8532;
    p_output1(5)=t8486*t8667 - 1.*t1108*t8681;
    p_output1(6)=t8486*t8893 - 1.*t1108*t8904;
    p_output1(7)=0;
    p_output1(8)=t3703*t8014*t8016 + t7691*t8169;
    p_output1(9)=t3703*t7691*t8016 - 1.*t8014*t8169;
    p_output1(10)=t3703*t8393;
    p_output1(11)=0;
    p_output1(12)=var1(0);
    p_output1(13)=var1(1);
    p_output1(14)=var1(2);
    p_output1(15)=1.;
  }
  
  
         
  Eigen::Matrix<double,4,4> H_left_knee(const Eigen::Matrix<double,36,1> &var1)
  //void H_left_knee(Eigen::Matrix<double,4,4> &p_output1, const Eigen::Matrix<double,36,1> &var1)
  {
    /* Call Subroutines */
    Eigen::Matrix<double,4,4>  p_output1;
    
    output1(p_output1, var1);
  
    return p_output1;
  }
  
  
  
  