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(1+z)=\Gamma(z)\, G(z) }

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

Semantic latex: \BarnesG@{1 + z} = \EulerGamma@{z} \BarnesG@{z}

Confidence: 0.65800408394759

Mathematica

Translation: BarnesG[1 + z] == Gamma[z]*BarnesG[z]

Information

Sub Equations

  • BarnesG[1 + z] = Gamma[z]*BarnesG[z]

Free variables

  • z

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

  • 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[1 + z])-(Gamma[z]*BarnesG[z])

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

Is part of

Complete translation information:

{
  "id" : "FORMULA_eb173fcf636ea67c9312be4f7ec2a469",
  "formula" : "G(1+z)=\\Gamma(z) G(z)",
  "semanticFormula" : "\\BarnesG@{1 + z} = \\EulerGamma@{z} \\BarnesG@{z}",
  "confidence" : 0.6580040839475927,
  "translations" : {
    "Mathematica" : {
      "translation" : "BarnesG[1 + z] == Gamma[z]*BarnesG[z]",
      "translationInformation" : {
        "subEquations" : [ "BarnesG[1 + z] = Gamma[z]*BarnesG[z]" ],
        "freeVariables" : [ "z" ],
        "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",
          "\\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[1 + z]",
          "rhs" : "Gamma[z]*BarnesG[z]",
          "testExpression" : "(BarnesG[1 + z])-(Gamma[z]*BarnesG[z])",
          "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" : [ ],
  "includes" : [ "\\,\\Gamma(x)", "z", "G", "\\, G(1+z)=\\Gamma(z)\\, G(z)" ],
  "isPartOf" : [ "\\, G(1+z)=\\Gamma(z)\\, G(z)" ],
  "definiens" : [ ]
}

Specify your own input