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 G(n)=\frac{(\Gamma(n))^{n-1}}{K(n)}}

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

Semantic latex: \BarnesG@{n} = \frac{(\EulerGamma@{n})^{n-1}}{K(n)}

Confidence: 0.77624868961808

Mathematica

Translation: BarnesG[n] == Divide[(Gamma[n])^(n - 1),K[n]]

Information

Sub Equations

  • BarnesG[n] = Divide[(Gamma[n])^(n - 1),K[n]]

Free variables

  • n

Symbol info

  • Double Gamma / Barnes Gamma; Example: \BarnesG@{z}

Will be translated to: BarnesG[$0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/5.17#E1 Mathematica: https://reference.wolfram.com/language/ref/BarnesG.html

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Euler Gamma function; Example: \EulerGamma@{z}

Will be translated to: Gamma[$0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/5.2#E1 Mathematica: https://reference.wolfram.com/language/ref/Gamma.html

Tests

Symbolic

Test expression: (BarnesG[n])-(Divide[(Gamma[n])^(n - 1),K*(n)])

ERROR:

{
    "result": "ERROR",
    "testTitle": "Simple",
    "testExpression": null,
    "resultExpression": null,
    "wasAborted": false,
    "conditionallySuccessful": false
}
Numeric

SymPy

Translation:

Information

Symbol info

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

Tests

Symbolic
Numeric

Maple

Translation:

Information

Symbol info

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

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • gamma function
  • k-function
  • value at integer argument
  • functional equation

Complete translation information:

{
  "id" : "FORMULA_ec337d14f9a329bbcd0a9786fa3eeae6",
  "formula" : "G(n)=\\frac{(\\Gamma(n))^{n-1}}{K(n)}",
  "semanticFormula" : "\\BarnesG@{n} = \\frac{(\\EulerGamma@{n})^{n-1}}{K(n)}",
  "confidence" : 0.7762486896180756,
  "translations" : {
    "Mathematica" : {
      "translation" : "BarnesG[n] == Divide[(Gamma[n])^(n - 1),K[n]]",
      "translationInformation" : {
        "subEquations" : [ "BarnesG[n] = Divide[(Gamma[n])^(n - 1),K[n]]" ],
        "freeVariables" : [ "n" ],
        "tokenTranslations" : {
          "\\BarnesG" : "Double Gamma / Barnes Gamma; Example: \\BarnesG@{z}\nWill be translated to: BarnesG[$0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/5.17#E1\nMathematica:  https://reference.wolfram.com/language/ref/BarnesG.html",
          "K" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\EulerGamma" : "Euler Gamma function; Example: \\EulerGamma@{z}\nWill be translated to: Gamma[$0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/5.2#E1\nMathematica:  https://reference.wolfram.com/language/ref/Gamma.html"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "ERROR",
        "numberOfTests" : 1,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 1,
        "crashed" : false,
        "testCalculationsGroup" : [ {
          "lhs" : "BarnesG[n]",
          "rhs" : "Divide[(Gamma[n])^(n - 1),K*(n)]",
          "testExpression" : "(BarnesG[n])-(Divide[(Gamma[n])^(n - 1),K*(n)])",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        } ]
      }
    },
    "SymPy" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \\BarnesG [\\BarnesG]"
        }
      }
    },
    "Maple" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> Maple) No translation possible for given token: Cannot extract information from feature set: \\BarnesG [\\BarnesG]"
        }
      }
    }
  },
  "positions" : [ {
    "section" : 1,
    "sentence" : 2,
    "word" : 23
  } ],
  "includes" : [ "G", "\\,\\Gamma(x)", "K", "K(n)" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "gamma function",
    "score" : 0.6859086196238077
  }, {
    "definition" : "k-function",
    "score" : 0.6859086196238077
  }, {
    "definition" : "value at integer argument",
    "score" : 0.5988174995334326
  }, {
    "definition" : "functional equation",
    "score" : 0.46655930748162855
  } ]
}

Specify your own input