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}{1-z} \frac{1}{a^{s}} + \sum_{n=1}^{N-1} \frac{(-1)^{n} \mathrm{Li}_{-n}(z)}{n!} \frac{(s)_{n}}{a^{n+s}} +O(a^{-N-s})}

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

Semantic latex: \Phi(z , s , a) = \frac{1}{1-z} \frac{1}{a^{s}} + \sum_{n=1}^{N-1} \frac{(- 1)^{n} L \iunit_{-n}(z)}{n!} \frac{(s)_{n}}{a^{n+s}} + O(a^{-N-s})

Confidence: 0

Mathematica

Translation: \[CapitalPhi][z , s , a] == Divide[1,1 - z]*Divide[1,(a)^(s)]+ Sum[Divide[(- 1)^(n)* L*Subscript[I, - n]*(z),(n)!]*Divide[Subscript[s, n],(a)^(n + s)], {n, 1, N - 1}, GenerateConditions->None]+ O[(a)^(- N - s)]

Information

Sub Equations

  • \[CapitalPhi][z , s , a] = Divide[1,1 - z]*Divide[1,(a)^(s)]+ Sum[Divide[(- 1)^(n)* L*Subscript[I, - n]*(z),(n)!]*Divide[Subscript[s, n],(a)^(n + s)], {n, 1, N - 1}, GenerateConditions->None]+ O[(a)^(- N - s)]

Free variables

  • L
  • N
  • \[CapitalPhi]
  • a
  • s
  • z

Symbol info

  • Imaginary unit was translated to: I
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic
Numeric

SymPy

Translation: Symbol('Phi')(z , s , a) == (1)/(1 - z)*(1)/((a)**(s))+ Sum(((- 1)**(n)* L*Symbol('{I}_{- n}')*(z))/(factorial(n))*(Symbol('{s}_{n}'))/((a)**(n + s)), (n, 1, N - 1))+ O((a)**(- N - s))

Information

Sub Equations

  • Symbol('Phi')(z , s , a) = (1)/(1 - z)*(1)/((a)**(s))+ Sum(((- 1)**(n)* L*Symbol('{I}_{- n}')*(z))/(factorial(n))*(Symbol('{s}_{n}'))/((a)**(n + s)), (n, 1, N - 1))+ O((a)**(- N - s))

Free variables

  • L
  • N
  • Symbol('Phi')
  • a
  • s
  • z

Symbol info

  • Imaginary unit was translated to: I
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic
Numeric

Maple

Translation: Phi(z , s , a) = (1)/(1 - z)*(1)/((a)^(s))+ sum(((- 1)^(n)* L*I[- n]*(z))/(factorial(n))*(s[n])/((a)^(n + s)), n = 1..N - 1)+ O((a)^(- N - s))

Information

Sub Equations

  • Phi(z , s , a) = (1)/(1 - z)*(1)/((a)^(s))+ sum(((- 1)^(n)* L*I[- n]*(z))/(factorial(n))*(s[n])/((a)^(n + s)), n = 1..N - 1)+ O((a)^(- N - s))

Free variables

  • L
  • N
  • Phi
  • a
  • s
  • z

Symbol info

  • Imaginary unit was translated to: I
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

  • Failed to parse (syntax error): {\displaystyle {1}{1}
  • Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle =1}^}

Description

  • n
  • z
  • frac
  • TeX Source
  • Formula
  • Gold ID
  • Li
  • link
  • mathrm
  • n-1
  • Phi
  • s
  • sum

Complete translation information:

{
  "id" : "FORMULA_a0cc62efe3cabac6d8bebe5b8b94b5fa",
  "formula" : "\\Phi(z,s,a) = \\frac{1}{1-z} \\frac{1}{a^{s}}    +    \\sum_{n=1}^{N-1} \\frac{(-1)^{n} \\mathrm{Li}_{-n}(z)}{n!} \\frac{(s)_{n}}{a^{n+s}}    +O(a^{-N-s})",
  "semanticFormula" : "\\Phi(z , s , a) = \\frac{1}{1-z} \\frac{1}{a^{s}} + \\sum_{n=1}^{N-1} \\frac{(- 1)^{n} L \\iunit_{-n}(z)}{n!} \\frac{(s)_{n}}{a^{n+s}} + O(a^{-N-s})",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "\\[CapitalPhi][z , s , a] == Divide[1,1 - z]*Divide[1,(a)^(s)]+ Sum[Divide[(- 1)^(n)* L*Subscript[I, - n]*(z),(n)!]*Divide[Subscript[s, n],(a)^(n + s)], {n, 1, N - 1}, GenerateConditions->None]+ O[(a)^(- N - s)]",
      "translationInformation" : {
        "subEquations" : [ "\\[CapitalPhi][z , s , a] = Divide[1,1 - z]*Divide[1,(a)^(s)]+ Sum[Divide[(- 1)^(n)* L*Subscript[I, - n]*(z),(n)!]*Divide[Subscript[s, n],(a)^(n + s)], {n, 1, N - 1}, GenerateConditions->None]+ O[(a)^(- N - s)]" ],
        "freeVariables" : [ "L", "N", "\\[CapitalPhi]", "a", "s", "z" ],
        "tokenTranslations" : {
          "\\iunit" : "Imaginary unit was translated to: I",
          "\\Phi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "O" : "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" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    },
    "SymPy" : {
      "translation" : "Symbol('Phi')(z , s , a) == (1)/(1 - z)*(1)/((a)**(s))+ Sum(((- 1)**(n)* L*Symbol('{I}_{- n}')*(z))/(factorial(n))*(Symbol('{s}_{n}'))/((a)**(n + s)), (n, 1, N - 1))+ O((a)**(- N - s))",
      "translationInformation" : {
        "subEquations" : [ "Symbol('Phi')(z , s , a) = (1)/(1 - z)*(1)/((a)**(s))+ Sum(((- 1)**(n)* L*Symbol('{I}_{- n}')*(z))/(factorial(n))*(Symbol('{s}_{n}'))/((a)**(n + s)), (n, 1, N - 1))+ O((a)**(- N - s))" ],
        "freeVariables" : [ "L", "N", "Symbol('Phi')", "a", "s", "z" ],
        "tokenTranslations" : {
          "\\iunit" : "Imaginary unit was translated to: I",
          "\\Phi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "O" : "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" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    },
    "Maple" : {
      "translation" : "Phi(z , s , a) = (1)/(1 - z)*(1)/((a)^(s))+ sum(((- 1)^(n)* L*I[- n]*(z))/(factorial(n))*(s[n])/((a)^(n + s)), n = 1..N - 1)+ O((a)^(- N - s))",
      "translationInformation" : {
        "subEquations" : [ "Phi(z , s , a) = (1)/(1 - z)*(1)/((a)^(s))+ sum(((- 1)^(n)* L*I[- n]*(z))/(factorial(n))*(s[n])/((a)^(n + s)), n = 1..N - 1)+ O((a)^(- N - s))" ],
        "freeVariables" : [ "L", "N", "Phi", "a", "s", "z" ],
        "tokenTranslations" : {
          "\\iunit" : "Imaginary unit was translated to: I",
          "\\Phi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "O" : "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" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    }
  },
  "positions" : [ {
    "section" : 1,
    "sentence" : 0,
    "word" : 8
  } ],
  "includes" : [ "{1}{1", "=1}^", "= 1" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "n",
    "score" : 0.9040520386825553
  }, {
    "definition" : "z",
    "score" : 0.8744420245282382
  }, {
    "definition" : "frac",
    "score" : 0.8088140202439196
  }, {
    "definition" : "TeX Source",
    "score" : 0.722
  }, {
    "definition" : "Formula",
    "score" : 0.6549657624809504
  }, {
    "definition" : "Gold ID",
    "score" : 0.6549657624809504
  }, {
    "definition" : "Li",
    "score" : 0.6549657624809504
  }, {
    "definition" : "link",
    "score" : 0.6549657624809504
  }, {
    "definition" : "mathrm",
    "score" : 0.6549657624809504
  }, {
    "definition" : "n-1",
    "score" : 0.6549657624809504
  }, {
    "definition" : "Phi",
    "score" : 0.6549657624809504
  }, {
    "definition" : "s",
    "score" : 0.6549657624809504
  }, {
    "definition" : "sum",
    "score" : 0.6549657624809504
  } ]
}

Specify your own input