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 \beta(x;s)= 2\Gamma(s+1)\sum_{n=1}^\infty \frac {\exp(2\pi inx) } {(2\pi n)^s}= \frac{2\Gamma(s+1)}{(2\pi)^s} \mbox{Li}_s (e^{2\pi ix}) }

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

Semantic latex: \beta(x ; s) = 2 \EulerGamma@{s + 1} \sum_{n=1}^\infty \frac{\exp(2 \cpi \iunit nx){(2 \cpi n)^s}} = \frac{2 \EulerGamma@{s + 1}}{(2 \cpi)^s}{Li}_s(\expe^{2 \cpi \iunit x})

Confidence: 0.62884815014109

Mathematica

Translation: \[Beta][x ; s] == 2*Gamma[s + 1]*Sum[Divide[Exp[2*Pi*I*n*x]*(2*Pi*n)^(s),==]*Divide[2*Gamma[s + 1],(2*Pi)^(s)]*L*Subscript[i, s]*(Exp[2*Pi*I*x]), {n, 1, Infinity}, GenerateConditions->None]

Information

Sub Equations

  • \[Beta][x ; s] = 2*Gamma[s + 1]*Sum[Divide[Exp[2*Pi*I*n*x]*(2*Pi*n)^(s),==]*Divide[2*Gamma[s + 1],(2*Pi)^(s)]*L*Subscript[i, s]*(Exp[2*Pi*I*x]), {n, 1, Infinity}, GenerateConditions->None]

Free variables

  • L
  • Subscript[i, s]
  • \[Beta]
  • s
  • x

Symbol info

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

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

  • Pi was translated to: Pi
  • Recognizes e with power as the exponential function. It was translated as a function.
  • Imaginary unit was translated to: I
  • 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
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: beta(x ; s) = 2*GAMMA(s + 1)*sum((exp(2*Pi*I*n*x)*(2*Pi*n)^(s))/(=)*(2*GAMMA(s + 1))/((2*Pi)^(s))*L*i[s]*(exp(2*Pi*I*x)), n = 1..infinity)

Information

Sub Equations

  • beta(x ; s) = 2*GAMMA(s + 1)*sum((exp(2*Pi*I*n*x)*(2*Pi*n)^(s))/(=)*(2*GAMMA(s + 1))/((2*Pi)^(s))*L*i[s]*(exp(2*Pi*I*x)), n = 1..infinity)

Free variables

  • L
  • beta
  • i[s]
  • s
  • x

Symbol info

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

Will be translated to: exp($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.2#E19 Maple: https://www.maplesoft.com/support/help/Maple/view.aspx?path=LinearAlgebra/Trace

  • Pi was translated to: Pi
  • Recognizes e with power as the exponential function. It was translated as a function.
  • Imaginary unit was translated to: I
  • Euler Gamma function; Example: \EulerGamma@{z}

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

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Is part of

Complete translation information:

{
  "id" : "FORMULA_f3a6d43fb4e20bfadc1fe598a58c0573",
  "formula" : "\\beta(x;s)=\n2\\Gamma(s+1)\\sum_{n=1}^\\infty \\frac {\\exp(2\\pi inx) } {(2\\pi n)^s}=\n\\frac{2\\Gamma(s+1)}{(2\\pi)^s} \\mbox{Li}_s (e^{2\\pi ix})",
  "semanticFormula" : "\\beta(x ; s) = 2 \\EulerGamma@{s + 1} \\sum_{n=1}^\\infty \\frac{\\exp(2 \\cpi \\iunit nx){(2 \\cpi n)^s}} = \\frac{2 \\EulerGamma@{s + 1}}{(2 \\cpi)^s}{Li}_s(\\expe^{2 \\cpi \\iunit x})",
  "confidence" : 0.6288481501410905,
  "translations" : {
    "Mathematica" : {
      "translation" : "\\[Beta][x ; s] == 2*Gamma[s + 1]*Sum[Divide[Exp[2*Pi*I*n*x]*(2*Pi*n)^(s),==]*Divide[2*Gamma[s + 1],(2*Pi)^(s)]*L*Subscript[i, s]*(Exp[2*Pi*I*x]), {n, 1, Infinity}, GenerateConditions->None]",
      "translationInformation" : {
        "subEquations" : [ "\\[Beta][x ; s] = 2*Gamma[s + 1]*Sum[Divide[Exp[2*Pi*I*n*x]*(2*Pi*n)^(s),==]*Divide[2*Gamma[s + 1],(2*Pi)^(s)]*L*Subscript[i, s]*(Exp[2*Pi*I*x]), {n, 1, Infinity}, GenerateConditions->None]" ],
        "freeVariables" : [ "L", "Subscript[i, s]", "\\[Beta]", "s", "x" ],
        "tokenTranslations" : {
          "\\beta" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\exp" : "Exponential function; Example: \\exp@@{z}\nWill be translated to: Exp[$0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/4.2#E19\nMathematica:  https://reference.wolfram.com/language/ref/Exp.html",
          "\\cpi" : "Pi was translated to: Pi",
          "\\expe" : "Recognizes e with power as the exponential function. It was translated as a function.",
          "\\iunit" : "Imaginary unit was translated to: I",
          "\\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" : "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: \\EulerGamma [\\EulerGamma]"
        }
      },
      "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" : "beta(x ; s) = 2*GAMMA(s + 1)*sum((exp(2*Pi*I*n*x)*(2*Pi*n)^(s))/(=)*(2*GAMMA(s + 1))/((2*Pi)^(s))*L*i[s]*(exp(2*Pi*I*x)), n = 1..infinity)",
      "translationInformation" : {
        "subEquations" : [ "beta(x ; s) = 2*GAMMA(s + 1)*sum((exp(2*Pi*I*n*x)*(2*Pi*n)^(s))/(=)*(2*GAMMA(s + 1))/((2*Pi)^(s))*L*i[s]*(exp(2*Pi*I*x)), n = 1..infinity)" ],
        "freeVariables" : [ "L", "beta", "i[s]", "s", "x" ],
        "tokenTranslations" : {
          "\\beta" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\exp" : "Exponential function; Example: \\exp@@{z}\nWill be translated to: exp($0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/4.2#E19\nMaple: https://www.maplesoft.com/support/help/Maple/view.aspx?path=LinearAlgebra/Trace",
          "\\cpi" : "Pi was translated to: Pi",
          "\\expe" : "Recognizes e with power as the exponential function. It was translated as a function.",
          "\\iunit" : "Imaginary unit was translated to: I",
          "\\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\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=GAMMA"
        }
      },
      "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", "\\beta", "1", "\\text{Li}_s (z)", "n", "\\beta(x;s)=2\\Gamma(s+1)\\sum_{n=1}^\\infty \\frac {\\exp(2\\pi inx) } {(2\\pi n)^s}=\\frac{2\\Gamma(s+1)}{(2\\pi)^s} \\mbox{Li}_s (e^{2\\pi ix})", "s" ],
  "isPartOf" : [ "\\beta(x;s)=2\\Gamma(s+1)\\sum_{n=1}^\\infty \\frac {\\exp(2\\pi inx) } {(2\\pi n)^s}=\\frac{2\\Gamma(s+1)}{(2\\pi)^s} \\mbox{Li}_s (e^{2\\pi ix})" ],
  "definiens" : [ ]
}

Specify your own input