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 \psi(x)}

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

Semantic latex: \digamma@{x}

Confidence: 0.90733333333333

Mathematica

Translation: PolyGamma[x]

Information

Sub Equations

  • PolyGamma[x]

Free variables

  • x

Symbol info

  • Digamma / Psi function; Example: \digamma@{z}

Will be translated to: PolyGamma[$0] Constraints: z not element of {0, -1, -2, ...} Relevant links to definitions: DLMF: http://dlmf.nist.gov/5.2#E2 Mathematica: https://reference.wolfram.com/language/ref/PolyGamma.html

Tests

Symbolic
Numeric

SymPy

Translation:

Information

Symbol info

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

Tests

Symbolic
Numeric

Maple

Translation: Psi(x)

Information

Sub Equations

  • Psi(x)

Free variables

  • x

Symbol info

  • Digamma / Psi function; Example: \digamma@{z}

Will be translated to: Psi($0) Constraints: z not element of {0, -1, -2, ...} Relevant links to definitions: DLMF: http://dlmf.nist.gov/5.2#E2 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Psi

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Is part of

Description

  • digamma function

Complete translation information:

{
  "id" : "FORMULA_e5a23578cdb4d60badd4ca7cea6cdc55",
  "formula" : "\\psi(x)",
  "semanticFormula" : "\\digamma@{x}",
  "confidence" : 0.9073333333333333,
  "translations" : {
    "Mathematica" : {
      "translation" : "PolyGamma[x]",
      "translationInformation" : {
        "subEquations" : [ "PolyGamma[x]" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "\\digamma" : "Digamma / Psi function; Example: \\digamma@{z}\nWill be translated to: PolyGamma[$0]\nConstraints: z not element of {0, -1, -2, ...}\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/5.2#E2\nMathematica:  https://reference.wolfram.com/language/ref/PolyGamma.html"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    },
    "SymPy" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \\digamma [\\digamma]"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    },
    "Maple" : {
      "translation" : "Psi(x)",
      "translationInformation" : {
        "subEquations" : [ "Psi(x)" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "\\digamma" : "Digamma / Psi function; Example: \\digamma@{z}\nWill be translated to: Psi($0)\nConstraints: z not element of {0, -1, -2, ...}\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/5.2#E2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Psi"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    }
  },
  "positions" : [ {
    "section" : 3,
    "sentence" : 0,
    "word" : 5
  } ],
  "includes" : [ "x" ],
  "isPartOf" : [ "\\frac{\\partial}{\\partial x} \\mathrm{B}(x, y) = \\mathrm{B}(x, y) \\left( \\frac{\\Gamma'(x)}{\\Gamma(x)} - \\frac{\\Gamma'(x + y)}{\\Gamma(x + y)} \\right) = \\mathrm{B}(x, y) \\big(\\psi(x) - \\psi(x + y)\\big)" ],
  "definiens" : [ {
    "definition" : "digamma function",
    "score" : 0.722
  } ]
}

Specify your own input