text: /*
   * Automatically Generated from Mathematica.
   * Thu 4 Nov 2021 17:01:39 GMT-04:00
   */
  #include <stdio.h>
  #include <stdlib.h>
  #include <math.h>
  
  #include "R_right_toe_pitch.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,3,3> &p_output1, const Eigen::Matrix<double,36,1> &var1)
  {
    double t2988;
    double t4354;
    double t3118;
    double t3350;
    double t5343;
    double t5413;
    double t7214;
    double t7266;
    double t7285;
    double t7314;
    double t7506;
    double t9228;
    double t3611;
    double t7540;
    double t9194;
    double t2928;
    double t9830;
    double t9844;
    double t10255;
    double t11653;
    double t9214;
    double t10257;
    double t10261;
    double t1865;
    double t12019;
    double t12020;
    double t16706;
    double t16753;
    double t11647;
    double t16711;
    double t16712;
    double t1761;
    double t16754;
    double t16788;
    double t16792;
    double t16796;
    double t16749;
    double t16793;
    double t16794;
    double t1525;
    double t16797;
    double t16798;
    double t16799;
    double t16803;
    double t16795;
    double t16800;
    double t16801;
    double t915;
    double t16804;
    double t16805;
    double t16806;
    double t88;
    double t16817;
    double t16818;
    double t16819;
    double t16816;
    double t16820;
    double t16821;
    double t16823;
    double t16824;
    double t16825;
    double t16822;
    double t16826;
    double t16827;
    double t16829;
    double t16830;
    double t16831;
    double t16828;
    double t16832;
    double t16833;
    double t16835;
    double t16836;
    double t16837;
    double t16834;
    double t16838;
    double t16839;
    double t16841;
    double t16842;
    double t16843;
    double t16810;
    double t16840;
    double t16844;
    double t16845;
    double t16847;
    double t16848;
    double t16849;
    double t16858;
    double t16859;
    double t16860;
    double t16862;
    double t16863;
    double t16864;
    double t16861;
    double t16865;
    double t16866;
    double t16868;
    double t16869;
    double t16870;
    double t16867;
    double t16871;
    double t16872;
    double t16874;
    double t16875;
    double t16876;
    double t16873;
    double t16877;
    double t16878;
    double t16880;
    double t16881;
    double t16882;
    double t16879;
    double t16883;
    double t16884;
    double t16886;
    double t16887;
    double t16888;
    double t16802;
    double t16807;
    double t16808;
    double t16811;
    double t16812;
    double t16813;
    double t16846;
    double t16850;
    double t16851;
    double t16853;
    double t16854;
    double t16855;
    double t16885;
    double t16889;
    double t16890;
    double t16892;
    double t16893;
    double t16894;
    t2988 = Cos(var1[3]);
    t4354 = Cos(var1[21]);
    t3118 = Cos(var1[4]);
    t3350 = Sin(var1[21]);
    t5343 = Cos(var1[5]);
    t5413 = Sin(var1[3]);
    t7214 = -1.*t5343*t5413;
    t7266 = Sin(var1[4]);
    t7285 = Sin(var1[5]);
    t7314 = t2988*t7266*t7285;
    t7506 = t7214 + t7314;
    t9228 = Cos(var1[22]);
    t3611 = -1.*t2988*t3118*t3350;
    t7540 = t4354*t7506;
    t9194 = t3611 + t7540;
    t2928 = Sin(var1[22]);
    t9830 = t4354*t2988*t3118;
    t9844 = t3350*t7506;
    t10255 = t9830 + t9844;
    t11653 = Cos(var1[23]);
    t9214 = t2928*t9194;
    t10257 = t9228*t10255;
    t10261 = t9214 + t10257;
    t1865 = Sin(var1[23]);
    t12019 = t9228*t9194;
    t12020 = -1.*t2928*t10255;
    t16706 = t12019 + t12020;
    t16753 = Cos(var1[24]);
    t11647 = t1865*t10261;
    t16711 = t11653*t16706;
    t16712 = t11647 + t16711;
    t1761 = Sin(var1[24]);
    t16754 = t11653*t10261;
    t16788 = -1.*t1865*t16706;
    t16792 = t16754 + t16788;
    t16796 = Cos(var1[25]);
    t16749 = t1761*t16712;
    t16793 = t16753*t16792;
    t16794 = t16749 + t16793;
    t1525 = Sin(var1[25]);
    t16797 = t16753*t16712;
    t16798 = -1.*t1761*t16792;
    t16799 = t16797 + t16798;
    t16803 = Cos(var1[26]);
    t16795 = -1.*t1525*t16794;
    t16800 = t16796*t16799;
    t16801 = t16795 + t16800;
    t915 = Sin(var1[26]);
    t16804 = t16796*t16794;
    t16805 = t1525*t16799;
    t16806 = t16804 + t16805;
    t88 = Cos(var1[30]);
    t16817 = t2988*t5343;
    t16818 = t5413*t7266*t7285;
    t16819 = t16817 + t16818;
    t16816 = -1.*t3118*t3350*t5413;
    t16820 = t4354*t16819;
    t16821 = t16816 + t16820;
    t16823 = t4354*t3118*t5413;
    t16824 = t3350*t16819;
    t16825 = t16823 + t16824;
    t16822 = t2928*t16821;
    t16826 = t9228*t16825;
    t16827 = t16822 + t16826;
    t16829 = t9228*t16821;
    t16830 = -1.*t2928*t16825;
    t16831 = t16829 + t16830;
    t16828 = t1865*t16827;
    t16832 = t11653*t16831;
    t16833 = t16828 + t16832;
    t16835 = t11653*t16827;
    t16836 = -1.*t1865*t16831;
    t16837 = t16835 + t16836;
    t16834 = t1761*t16833;
    t16838 = t16753*t16837;
    t16839 = t16834 + t16838;
    t16841 = t16753*t16833;
    t16842 = -1.*t1761*t16837;
    t16843 = t16841 + t16842;
    t16810 = Sin(var1[30]);
    t16840 = -1.*t1525*t16839;
    t16844 = t16796*t16843;
    t16845 = t16840 + t16844;
    t16847 = t16796*t16839;
    t16848 = t1525*t16843;
    t16849 = t16847 + t16848;
    t16858 = t3350*t7266;
    t16859 = t4354*t3118*t7285;
    t16860 = t16858 + t16859;
    t16862 = -1.*t4354*t7266;
    t16863 = t3118*t3350*t7285;
    t16864 = t16862 + t16863;
    t16861 = t2928*t16860;
    t16865 = t9228*t16864;
    t16866 = t16861 + t16865;
    t16868 = t9228*t16860;
    t16869 = -1.*t2928*t16864;
    t16870 = t16868 + t16869;
    t16867 = t1865*t16866;
    t16871 = t11653*t16870;
    t16872 = t16867 + t16871;
    t16874 = t11653*t16866;
    t16875 = -1.*t1865*t16870;
    t16876 = t16874 + t16875;
    t16873 = t1761*t16872;
    t16877 = t16753*t16876;
    t16878 = t16873 + t16877;
    t16880 = t16753*t16872;
    t16881 = -1.*t1761*t16876;
    t16882 = t16880 + t16881;
    t16879 = -1.*t1525*t16878;
    t16883 = t16796*t16882;
    t16884 = t16879 + t16883;
    t16886 = t16796*t16878;
    t16887 = t1525*t16882;
    t16888 = t16886 + t16887;
    t16802 = t915*t16801;
    t16807 = t16803*t16806;
    t16808 = t16802 + t16807;
    t16811 = t16803*t16801;
    t16812 = -1.*t915*t16806;
    t16813 = t16811 + t16812;
    t16846 = t915*t16845;
    t16850 = t16803*t16849;
    t16851 = t16846 + t16850;
    t16853 = t16803*t16845;
    t16854 = -1.*t915*t16849;
    t16855 = t16853 + t16854;
    t16885 = t915*t16884;
    t16889 = t16803*t16888;
    t16890 = t16885 + t16889;
    t16892 = t16803*t16884;
    t16893 = -1.*t915*t16888;
    t16894 = t16892 + t16893;
  
    p_output1(0)=t16810*t16813 + t16808*t88;
    p_output1(1)=t16810*t16855 + t16851*t88;
    p_output1(2)=t16810*t16894 + t16890*t88;
    p_output1(3)=-1.*t16808*t16810 + t16813*t88;
    p_output1(4)=-1.*t16810*t16851 + t16855*t88;
    p_output1(5)=-1.*t16810*t16890 + t16894*t88;
    p_output1(6)=t2988*t5343*t7266 + t5413*t7285;
    p_output1(7)=t5343*t5413*t7266 - 1.*t2988*t7285;
    p_output1(8)=t3118*t5343;
  }
  
  
         
  Eigen::Matrix<double,3,3> R_right_toe_pitch(const Eigen::Matrix<double,36,1> &var1)
  //void R_right_toe_pitch(Eigen::Matrix<double,3,3> &p_output1, const Eigen::Matrix<double,36,1> &var1)
  {
    /* Call Subroutines */
    Eigen::Matrix<double,3,3>  p_output1;
    
    output1(p_output1, var1);
  
    return p_output1;
  }
  
  
  
  