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+x)=\sum_{k=0}^\infty \Phi(z,s+k,a)(s)_{k}\frac{(-x)^k}{k!};|x|<\Re(a), }

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

Semantic latex: \Phi(z , s , a + x) = \sum_{k=0}^\infty \Phi(z , s + k , a) \Pochhammersym{s}{k} \frac{(-x)^k}{k!} ;|x|< \realpart(a)

Confidence: 0.68872262762278

Mathematica

Translation: \[CapitalPhi][z , s , a + x] == \[CapitalPhi][z , s + k , a]* Pochhammer[s, k]*Divide[(- x)^(k),(k)!] Sum[Abs[x] , {k, 0, Infinity}, GenerateConditions->None]< Re[a]

Information

Free variables

  • \[CapitalPhi]
  • a
  • s
  • x
  • z

Symbol info

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Real part of a complex number; Example: \realpart@@{z}

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

  • Pochhammer symbol; Example: \Pochhammersym{a}{n}

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

Tests

Symbolic

Test expression: \[CapitalPhi]*(z , s , a + x)

ERROR:

{
    "result": "ERROR",
    "testTitle": "Simple",
    "testExpression": null,
    "resultExpression": null,
    "wasAborted": false,
    "conditionallySuccessful": false
}

Test expression: \[CapitalPhi]*(z , s + k , a)*Pochhammer[s, k]*Divide[(- x)^(k),(k)!] Abs[x]

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

Tests

Symbolic
Numeric

Maple

Translation: Phi(z , s , a + x) = Phi(z , s + k , a)* pochhammer(s, k)*((- x)^(k))/(factorial(k)); sum(abs(x) , k = 0..infinity)< Re(a)

Information

Free variables

  • Phi
  • a
  • s
  • x
  • z

Symbol info

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Real part of a complex number; Example: \realpart@@{z}

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

  • Pochhammer symbol; Example: \Pochhammersym{a}{n}

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

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Is part of

Complete translation information:

{
  "id" : "FORMULA_8fea482fce70d2e53ce9ef321efd2406",
  "formula" : "\\Phi(z,s,a+x)=\\sum_{k=0}^\\infty \\Phi(z,s+k,a)(s)_{k}\\frac{(-x)^k}{k!};|x|<\\realpart(a)",
  "semanticFormula" : "\\Phi(z , s , a + x) = \\sum_{k=0}^\\infty \\Phi(z , s + k , a) \\Pochhammersym{s}{k} \\frac{(-x)^k}{k!} ;|x|< \\realpart(a)",
  "confidence" : 0.6887226276227827,
  "translations" : {
    "Mathematica" : {
      "translation" : "\\[CapitalPhi][z , s , a + x] == \\[CapitalPhi][z , s + k , a]* Pochhammer[s, k]*Divide[(- x)^(k),(k)!]\n Sum[Abs[x] , {k, 0, Infinity}, GenerateConditions->None]< Re[a]",
      "translationInformation" : {
        "freeVariables" : [ "\\[CapitalPhi]", "a", "s", "x", "z" ],
        "tokenTranslations" : {
          "\\Phi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\realpart" : "Real part of a complex number; Example: \\realpart@@{z}\nWill be translated to: Re[$0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/1.9#E2\nMathematica:  https://reference.wolfram.com/language/ref/Re.html",
          "\\Pochhammersym" : "Pochhammer symbol; Example: \\Pochhammersym{a}{n}\nWill be translated to: Pochhammer[$0, $1]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/5.2#iii\nMathematica:  https://reference.wolfram.com/language/ref/Pochhammer.html"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "ERROR",
        "numberOfTests" : 2,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 2,
        "crashed" : false,
        "testCalculationsGroup" : [ {
          "lhs" : "\\[CapitalPhi]*(z , s , a + x)",
          "rhs" : "",
          "testExpression" : "\\[CapitalPhi]*(z , s , a + x)",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        }, {
          "lhs" : "\\[CapitalPhi]*(z , s + k , a)*Pochhammer[s, k]*Divide[(- x)^(k),(k)!]\n Abs[x]",
          "rhs" : "",
          "testExpression" : "\\[CapitalPhi]*(z , s + k , a)*Pochhammer[s, k]*Divide[(- x)^(k),(k)!]\n Abs[x]",
          "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: \\Pochhammersym [\\Pochhammersym]"
        }
      }
    },
    "Maple" : {
      "translation" : "Phi(z , s , a + x) = Phi(z , s + k , a)* pochhammer(s, k)*((- x)^(k))/(factorial(k)); sum(abs(x) , k = 0..infinity)< Re(a)",
      "translationInformation" : {
        "freeVariables" : [ "Phi", "a", "s", "x", "z" ],
        "tokenTranslations" : {
          "\\Phi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\realpart" : "Real part of a complex number; Example: \\realpart@@{z}\nWill be translated to: Re($0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/1.9#E2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Re",
          "\\Pochhammersym" : "Pochhammer symbol; Example: \\Pochhammersym{a}{n}\nWill be translated to: pochhammer($0, $1)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/5.2#iii\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=pochhammer"
        }
      }
    }
  },
  "positions" : [ ],
  "includes" : [ "a", "(s)_{k}", "\\Phi(z,s,a)", "z", "s", "\\Phi(z,s,a+x)=\\sum_{k=0}^\\infty \\Phi(z,s+k,a)(s)_{k}\\frac{(-x)^k}{k!};|x|<\\Re(a)" ],
  "isPartOf" : [ "\\Phi(z,s,a+x)=\\sum_{k=0}^\\infty \\Phi(z,s+k,a)(s)_{k}\\frac{(-x)^k}{k!};|x|<\\Re(a)" ],
  "definiens" : [ ]
}

Specify your own input