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 \Phi(z,s,a)=\frac{1}{2a^s}+ \frac{1}{z^a}\sum_{k=1}^\infty \frac{e^{-2\pi i(k-1)a}\Gamma(1-s,a(-2\pi i(k-1)-\log(z)))} {(-2\pi i(k-1)-\log(z))^{1-s}}+ \frac{e^{2\pi ika}\Gamma(1-s,a(2\pi ik-\log(z)))}{(2\pi ik-\log(z))^{1-s}} }

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

Semantic latex: \Phi(z , s , a) = \frac{1}{2a^s} + \frac{1}{z^a} \sum_{k=1}^\infty \frac{\expe^{- 2 \cpi \iunit(k - 1) a} \incGamma@{1 - s}{a(- 2 \cpi \iunit(k - 1) - \log(z))}}{(- 2 \cpi \iunit(k - 1) - \log(z))^{1-s}} + \frac{\expe^{2 \cpi \iunit ka} \incGamma@{1 - s}{a(2 \cpi \iunit k - \log(z))}}{(2 \cpi \iunit k - \log(z))^{1-s}}

Confidence: 0.65182996701405

Mathematica

Translation: \[CapitalPhi][z , s , a] == Divide[1,2*(a)^(s)]+Divide[1,(z)^(a)]*Sum[Divide[Exp[- 2*Pi*I*(k - 1)*a]*Gamma[1 - s, a*(- 2*Pi*I*(k - 1)- Log[z])],(- 2*Pi*I*(k - 1)- Log[z])^(1 - s)]+Divide[Exp[2*Pi*I*k*a]*Gamma[1 - s, a*(2*Pi*I*k - Log[z])],(2*Pi*I*k - Log[z])^(1 - s)], {k, 1, Infinity}, GenerateConditions->None]

Information

Sub Equations

  • \[CapitalPhi][z , s , a] = Divide[1,2*(a)^(s)]+Divide[1,(z)^(a)]*Sum[Divide[Exp[- 2*Pi*I*(k - 1)*a]*Gamma[1 - s, a*(- 2*Pi*I*(k - 1)- Log[z])],(- 2*Pi*I*(k - 1)- Log[z])^(1 - s)]+Divide[Exp[2*Pi*I*k*a]*Gamma[1 - s, a*(2*Pi*I*k - Log[z])],(2*Pi*I*k - Log[z])^(1 - s)], {k, 1, Infinity}, GenerateConditions->None]

Free variables

  • \[CapitalPhi]
  • a
  • s
  • z

Symbol info

  • Pi was translated to: Pi
  • Logarithm; Example: \log@@{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

  • 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

  • Recognizes e with power as the exponential function. It was translated as a function.
  • Imaginary unit was translated to: I
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic

Test expression: (\[CapitalPhi]*(z , s , a))-(Divide[1,2*(a)^(s)]+Divide[1,(z)^(a)]*Sum[Divide[Exp[- 2*Pi*I*(k - 1)*a]*Gamma[1 - s, a*(- 2*Pi*I*(k - 1)- Log[z])],(- 2*Pi*I*(k - 1)- Log[z])^(1 - s)]+Divide[Exp[2*Pi*I*k*a]*Gamma[1 - s, a*(2*Pi*I*k - Log[z])],(2*Pi*I*k - Log[z])^(1 - s)], {k, 1, Infinity}, GenerateConditions->None])

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: \incGamma [\incGamma]

Tests

Symbolic
Numeric

Maple

Translation: Phi(z , s , a) = (1)/(2*(a)^(s))+(1)/((z)^(a))*sum((exp(- 2*Pi*I*(k - 1)*a)*GAMMA(1 - s, a*(- 2*Pi*I*(k - 1)- log(z))))/((- 2*Pi*I*(k - 1)- log(z))^(1 - s))+(exp(2*Pi*I*k*a)*GAMMA(1 - s, a*(2*Pi*I*k - log(z))))/((2*Pi*I*k - log(z))^(1 - s)), k = 1..infinity)

Information

Sub Equations

  • Phi(z , s , a) = (1)/(2*(a)^(s))+(1)/((z)^(a))*sum((exp(- 2*Pi*I*(k - 1)*a)*GAMMA(1 - s, a*(- 2*Pi*I*(k - 1)- log(z))))/((- 2*Pi*I*(k - 1)- log(z))^(1 - s))+(exp(2*Pi*I*k*a)*GAMMA(1 - s, a*(2*Pi*I*k - log(z))))/((2*Pi*I*k - log(z))^(1 - s)), k = 1..infinity)

Free variables

  • Phi
  • a
  • s
  • z

Symbol info

  • Pi was translated to: Pi
  • Logarithm; Example: \log@@{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 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=log

  • 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

  • Recognizes e with power as the exponential function. It was translated as a function.
  • Imaginary unit was translated to: I
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Is part of

Complete translation information:

{
  "id" : "FORMULA_7a79399429aafb33d44663240c1d3e18",
  "formula" : "\\Phi(z,s,a)=\\frac{1}{2a^s}+\n\\frac{1}{z^a}\\sum_{k=1}^\\infty\n\\frac{e^{-2\\pi i(k-1)a}\\Gamma(1-s,a(-2\\pi i(k-1)-\\log(z)))}\n     {(-2\\pi i(k-1)-\\log(z))^{1-s}}+\n\\frac{e^{2\\pi ika}\\Gamma(1-s,a(2\\pi ik-\\log(z)))}{(2\\pi ik-\\log(z))^{1-s}}",
  "semanticFormula" : "\\Phi(z , s , a) = \\frac{1}{2a^s} + \\frac{1}{z^a} \\sum_{k=1}^\\infty \\frac{\\expe^{- 2 \\cpi \\iunit(k - 1) a} \\incGamma@{1 - s}{a(- 2 \\cpi \\iunit(k - 1) - \\log(z))}}{(- 2 \\cpi \\iunit(k - 1) - \\log(z))^{1-s}} + \\frac{\\expe^{2 \\cpi \\iunit ka} \\incGamma@{1 - s}{a(2 \\cpi \\iunit k - \\log(z))}}{(2 \\cpi \\iunit k - \\log(z))^{1-s}}",
  "confidence" : 0.651829967014045,
  "translations" : {
    "Mathematica" : {
      "translation" : "\\[CapitalPhi][z , s , a] == Divide[1,2*(a)^(s)]+Divide[1,(z)^(a)]*Sum[Divide[Exp[- 2*Pi*I*(k - 1)*a]*Gamma[1 - s, a*(- 2*Pi*I*(k - 1)- Log[z])],(- 2*Pi*I*(k - 1)- Log[z])^(1 - s)]+Divide[Exp[2*Pi*I*k*a]*Gamma[1 - s, a*(2*Pi*I*k - Log[z])],(2*Pi*I*k - Log[z])^(1 - s)], {k, 1, Infinity}, GenerateConditions->None]",
      "translationInformation" : {
        "subEquations" : [ "\\[CapitalPhi][z , s , a] = Divide[1,2*(a)^(s)]+Divide[1,(z)^(a)]*Sum[Divide[Exp[- 2*Pi*I*(k - 1)*a]*Gamma[1 - s, a*(- 2*Pi*I*(k - 1)- Log[z])],(- 2*Pi*I*(k - 1)- Log[z])^(1 - s)]+Divide[Exp[2*Pi*I*k*a]*Gamma[1 - s, a*(2*Pi*I*k - Log[z])],(2*Pi*I*k - Log[z])^(1 - s)], {k, 1, Infinity}, GenerateConditions->None]" ],
        "freeVariables" : [ "\\[CapitalPhi]", "a", "s", "z" ],
        "tokenTranslations" : {
          "\\cpi" : "Pi was translated to: Pi",
          "\\log" : "Logarithm; Example: \\log@@{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",
          "\\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",
          "\\expe" : "Recognizes e with power as the exponential function. It was translated as a function.",
          "\\iunit" : "Imaginary unit was translated to: I",
          "\\Phi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
        }
      },
      "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" : "\\[CapitalPhi]*(z , s , a)",
          "rhs" : "Divide[1,2*(a)^(s)]+Divide[1,(z)^(a)]*Sum[Divide[Exp[- 2*Pi*I*(k - 1)*a]*Gamma[1 - s, a*(- 2*Pi*I*(k - 1)- Log[z])],(- 2*Pi*I*(k - 1)- Log[z])^(1 - s)]+Divide[Exp[2*Pi*I*k*a]*Gamma[1 - s, a*(2*Pi*I*k - Log[z])],(2*Pi*I*k - Log[z])^(1 - s)], {k, 1, Infinity}, GenerateConditions->None]",
          "testExpression" : "(\\[CapitalPhi]*(z , s , a))-(Divide[1,2*(a)^(s)]+Divide[1,(z)^(a)]*Sum[Divide[Exp[- 2*Pi*I*(k - 1)*a]*Gamma[1 - s, a*(- 2*Pi*I*(k - 1)- Log[z])],(- 2*Pi*I*(k - 1)- Log[z])^(1 - s)]+Divide[Exp[2*Pi*I*k*a]*Gamma[1 - s, a*(2*Pi*I*k - Log[z])],(2*Pi*I*k - Log[z])^(1 - s)], {k, 1, Infinity}, GenerateConditions->None])",
          "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: \\incGamma [\\incGamma]"
        }
      }
    },
    "Maple" : {
      "translation" : "Phi(z , s , a) = (1)/(2*(a)^(s))+(1)/((z)^(a))*sum((exp(- 2*Pi*I*(k - 1)*a)*GAMMA(1 - s, a*(- 2*Pi*I*(k - 1)- log(z))))/((- 2*Pi*I*(k - 1)- log(z))^(1 - s))+(exp(2*Pi*I*k*a)*GAMMA(1 - s, a*(2*Pi*I*k - log(z))))/((2*Pi*I*k - log(z))^(1 - s)), k = 1..infinity)",
      "translationInformation" : {
        "subEquations" : [ "Phi(z , s , a) = (1)/(2*(a)^(s))+(1)/((z)^(a))*sum((exp(- 2*Pi*I*(k - 1)*a)*GAMMA(1 - s, a*(- 2*Pi*I*(k - 1)- log(z))))/((- 2*Pi*I*(k - 1)- log(z))^(1 - s))+(exp(2*Pi*I*k*a)*GAMMA(1 - s, a*(2*Pi*I*k - log(z))))/((2*Pi*I*k - log(z))^(1 - s)), k = 1..infinity)" ],
        "freeVariables" : [ "Phi", "a", "s", "z" ],
        "tokenTranslations" : {
          "\\cpi" : "Pi was translated to: Pi",
          "\\log" : "Logarithm; Example: \\log@@{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\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=log",
          "\\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",
          "\\expe" : "Recognizes e with power as the exponential function. It was translated as a function.",
          "\\iunit" : "Imaginary unit was translated to: I",
          "\\Phi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
        }
      }
    }
  },
  "positions" : [ ],
  "includes" : [ "a", "\\Phi(z,s,a)", "\\Phi(z,s,a)=\\frac{1}{2a^s}+\\frac{1}{z^a}\\sum_{k=1}^\\infty\\frac{e^{-2\\pi i(k-1)a}\\Gamma(1-s,a(-2\\pi i(k-1)-\\log(z)))}     {(-2\\pi i(k-1)-\\log(z))^{1-s}}+\\frac{e^{2\\pi ika}\\Gamma(1-s,a(2\\pi ik-\\log(z)))}{(2\\pi ik-\\log(z))^{1-s}}", "z", "s" ],
  "isPartOf" : [ "\\Phi(z,s,a)=\\frac{1}{2a^s}+\\frac{1}{z^a}\\sum_{k=1}^\\infty\\frac{e^{-2\\pi i(k-1)a}\\Gamma(1-s,a(-2\\pi i(k-1)-\\log(z)))}     {(-2\\pi i(k-1)-\\log(z))^{1-s}}+\\frac{e^{2\\pi ika}\\Gamma(1-s,a(2\\pi ik-\\log(z)))}{(2\\pi ik-\\log(z))^{1-s}}" ],
  "definiens" : [ ]
}

Specify your own input