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 -(\Gamma\left(0,-\ln 2\right) + i\,\pi)}

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

Semantic latex: -(\incGamma@{0}{- \ln 2} + \iunit \cpi)

Confidence: 0.65182996701405

Mathematica

Translation: -(Gamma[0, - Log[2]]+ I*Pi)

Information

Sub Equations

  • -(Gamma[0, - Log[2]]+ I*Pi)

Symbol info

  • Pi was translated to: Pi
  • Incomplete Gamma function (upper); Example: \incGamma@{a}{z}

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

  • Imaginary unit was translated to: I
  • Natural logarithm; Example: \ln@@{z}

Will be translated to: Log[$0] Constraints: z != 0 Branch Cuts: (-\infty, 0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.2#E2 Mathematica: https://reference.wolfram.com/language/ref/Log.html

Tests

Symbolic
Numeric

SymPy

Translation:

Information

Symbol info

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

Tests

Symbolic
Numeric

Maple

Translation: -(GAMMA(0, - ln(2))+ I*Pi)

Information

Sub Equations

  • -(GAMMA(0, - ln(2))+ I*Pi)

Symbol info

  • Pi was translated to: Pi
  • Incomplete Gamma function (upper); Example: \incGamma@{a}{z}

Will be translated to: GAMMA($0, $1) Relevant links to definitions: DLMF: http://dlmf.nist.gov/8.2#E2 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=GAMMA

  • Imaginary unit was translated to: I
  • Natural logarithm; Example: \ln@@{z}

Will be translated to: ln($0) Constraints: z != 0 Branch Cuts: (-\infty, 0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.2#E2 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=ln

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Is part of

Complete translation information:

{
  "id" : "FORMULA_dc96bb08ca02d4e2d6b97ae20381b356",
  "formula" : "-(\\Gamma\\left(0,-\\ln 2\\right) + i\\pi)",
  "semanticFormula" : "-(\\incGamma@{0}{- \\ln 2} + \\iunit \\cpi)",
  "confidence" : 0.651829967014045,
  "translations" : {
    "Mathematica" : {
      "translation" : "-(Gamma[0, - Log[2]]+ I*Pi)",
      "translationInformation" : {
        "subEquations" : [ "-(Gamma[0, - Log[2]]+ I*Pi)" ],
        "tokenTranslations" : {
          "\\cpi" : "Pi was translated to: Pi",
          "\\incGamma" : "Incomplete Gamma function (upper); Example: \\incGamma@{a}{z}\nWill be translated to: Gamma[$0, $1]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/8.2#E2\nMathematica:  https://reference.wolfram.com/language/ref/Gamma.html",
          "\\iunit" : "Imaginary unit was translated to: I",
          "\\ln" : "Natural logarithm; Example: \\ln@@{z}\nWill be translated to: Log[$0]\nConstraints: z != 0\nBranch Cuts: (-\\infty, 0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/4.2#E2\nMathematica:  https://reference.wolfram.com/language/ref/Log.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: \\incGamma [\\incGamma]"
        }
      },
      "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" : "-(GAMMA(0, - ln(2))+ I*Pi)",
      "translationInformation" : {
        "subEquations" : [ "-(GAMMA(0, - ln(2))+ I*Pi)" ],
        "tokenTranslations" : {
          "\\cpi" : "Pi was translated to: Pi",
          "\\incGamma" : "Incomplete Gamma function (upper); Example: \\incGamma@{a}{z}\nWill be translated to: GAMMA($0, $1)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/8.2#E2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=GAMMA",
          "\\iunit" : "Imaginary unit was translated to: I",
          "\\ln" : "Natural logarithm; Example: \\ln@@{z}\nWill be translated to: ln($0)\nConstraints: z != 0\nBranch Cuts: (-\\infty, 0]\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/4.2#E2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=ln"
        }
      },
      "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" : [ ],
  "includes" : [ "\\Gamma\\left(a,x\\right)", "-(\\Gamma\\left(0,-\\ln 2\\right) + i\\,\\pi)" ],
  "isPartOf" : [ "-(\\Gamma\\left(0,-\\ln 2\\right) + i\\,\\pi)" ],
  "definiens" : [ ]
}

Specify your own input