LaTeX to CAS translator

Jump to navigation Jump to search

This mockup demonstrates the concept of TeX to Computer Algebra System (CAS) conversion.

The demo-application converts LaTeX functions which directly translate to CAS counterparts.

Functions without explicit CAS support are available for translation via a DRMF package (under development).

The following LaTeX input ...

{\displaystyle \begin{align} & z\log \Gamma(z)-\log G(1+z)=-z \log\left(\frac{1}{\Gamma (z)}\right)-\log G(1+z) \\[5pt] = {} & {-z} \left[ \log z+\gamma z +\sum_{k=1}^\infty \Bigg\{ \log\left(1+\frac{z}{k} \right) -\frac{z}{k} \Bigg\} \right] \\[5pt] & {} -\left[ \frac{z}{2}\log 2\pi -\frac{z}{2}-\frac{z^2}{2} -\frac{z^2 \gamma}{2} + \sum_{k=1}^\infty \Bigg\{k\log\left(1+\frac{z}{k}\right) +\frac{z^2}{2k} -z \Bigg\} \right] \end{align} }

... is translated to the CAS output ...

Semantic latex: \begin{align}&z \log \EulerGamma@{z} - \log \BarnesG@{1 + z} = - z \log(\frac{1}{\EulerGamma@{z}}) - \log \BarnesG@{1 + z} \\ = {} & {-z} &{-\frac{z}{k} \} \right]} [ \EulerConstant ( ) ] \\ &{} - [\frac{z}{2} \log 2 \cpi - \frac{z}{2} - \frac{z^2}{2} - \frac{z^2 \EulerConstant}{2} + \sum_{k=1}^\infty \{k \log(1 + \frac{z}{k}) + \frac{z^2}{2k} - z \}]\end{align}

Confidence: 0.65800408394759

Mathematica

Translation:

Information

Symbol info

  • (LaTeX -> Mathematica) Error while translating DLMF/DRMF Macro: Unable to retrieve correct number of arguments for the macro \EulerGamma [\EulerGamma]

Tests

Symbolic
Numeric

SymPy

Translation:

Information

Symbol info

  • (LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \EulerGamma [\EulerGamma]

Tests

Symbolic
Numeric

Maple

Translation:

Information

Symbol info

  • (LaTeX -> Maple) Error while translating DLMF/DRMF Macro: Unable to retrieve correct number of arguments for the macro \EulerGamma [\EulerGamma]

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Complete translation information:

{
  "id" : "FORMULA_b26b6e1c8c6e9287d410d1f2425c24b2",
  "formula" : "\\begin{align}\n& z\\log \\Gamma(z)-\\log G(1+z)=-z \\log\\left(\\frac{1}{\\Gamma (z)}\\right)-\\log G(1+z) \\\\\n= {} & {-z} \\left[ \\log z+\\gamma z +\\sum_{k=1}^\\infty \\{ \\log\\left(1+\\frac{z}{k} \\right) -\\frac{z}{k} \\} \\right] \\\\\n& {} -\\left[ \\frac{z}{2}\\log 2\\pi -\\frac{z}{2}-\\frac{z^2}{2} -\\frac{z^2 \\gamma}{2} + \\sum_{k=1}^\\infty \\{k\\log\\left(1+\\frac{z}{k}\\right) +\\frac{z^2}{2k} -z \\} \\right]\n\\end{align}",
  "semanticFormula" : "\\begin{align}&z \\log \\EulerGamma@{z} - \\log \\BarnesG@{1 + z} = - z \\log(\\frac{1}{\\EulerGamma@{z}}) - \\log \\BarnesG@{1 + z} \\\\ = {} & {-z} &{-\\frac{z}{k} \\} \\right]} [   \\EulerConstant      (  )   ] \\\\ &{} - [\\frac{z}{2} \\log 2 \\cpi - \\frac{z}{2} - \\frac{z^2}{2} - \\frac{z^2 \\EulerConstant}{2} + \\sum_{k=1}^\\infty \\{k \\log(1 + \\frac{z}{k}) + \\frac{z^2}{2k} - z \\}]\\end{align}",
  "confidence" : 0.6580040839475927,
  "translations" : {
    "Mathematica" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> Mathematica) Error while translating DLMF/DRMF Macro: Unable to retrieve correct number of arguments for the macro \\EulerGamma [\\EulerGamma]"
        }
      }
    },
    "SymPy" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \\EulerGamma [\\EulerGamma]"
        }
      }
    },
    "Maple" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> Maple) Error while translating DLMF/DRMF Macro: Unable to retrieve correct number of arguments for the macro \\EulerGamma [\\EulerGamma]"
        }
      }
    }
  },
  "positions" : [ ],
  "includes" : [ "\\,\\Gamma(x)", "\\, \\gamma", "z\\log \\Gamma(z)-\\log G(1+z)", "z", "\\, 2\\pi", "G", "\\,\\gamma" ],
  "isPartOf" : [ ],
  "definiens" : [ ]
}

Specify your own input