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}{a^s} +\sum_{m=0}^\infty (1-m-s)_m \operatorname{Li}_{s+m}(z)\frac{a^m}{m!}; |a|<1, }

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

Semantic latex: \Phi(z , s , a) = \frac{1}{a^s} + \sum_{m=0}^\infty \Pochhammersym{1 - m - s}{m} \polylog{s+m}@{z} \frac{a^m}{m!} ;|a|< 1 ,

Confidence: 0.68128731809899

Mathematica

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

Information

Free variables

  • \[CapitalPhi]
  • a
  • s
  • z

Symbol info

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

Will be translated to: PolyLog[$0, $1] Relevant links to definitions: DLMF: http://dlmf.nist.gov/25.12#E10 Mathematica: https://reference.wolfram.com/language/ref/PolyLog.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)

ERROR:

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

Test expression: Divide[1,(a)^(s)]+ Pochhammer[1 - m - s, m]*PolyLog[s + m, z]*Divide[(a)^(m),(m)!] Abs[a]

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) = (1)/((a)^(s))+ pochhammer(1 - m - s, m)*polylog(s + m, z)*((a)^(m))/(factorial(m)); sum(abs(a) , m = 0..infinity)< 1

Information

Free variables

  • Phi
  • a
  • s
  • z

Symbol info

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

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

  • 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

Complete translation information:

{
  "id" : "FORMULA_e8bb2fcc0c9b2390cc30490a47c806b1",
  "formula" : "\\Phi(z,s,a)=\\frac{1}{a^s}\n+\\sum_{m=0}^\\infty (1-m-s)_m \\operatorname{Li}_{s+m}(z)\\frac{a^m}{m!}; |a|<1,",
  "semanticFormula" : "\\Phi(z , s , a) = \\frac{1}{a^s} + \\sum_{m=0}^\\infty \\Pochhammersym{1 - m - s}{m} \\polylog{s+m}@{z} \\frac{a^m}{m!} ;|a|< 1 ,",
  "confidence" : 0.6812873180989907,
  "translations" : {
    "Mathematica" : {
      "translation" : "\\[CapitalPhi][z , s , a] == Divide[1,(a)^(s)]+ Pochhammer[1 - m - s, m]*PolyLog[s + m, z]*Divide[(a)^(m),(m)!]\n Sum[Abs[a] , {m, 0, Infinity}, GenerateConditions->None]< 1",
      "translationInformation" : {
        "freeVariables" : [ "\\[CapitalPhi]", "a", "s", "z" ],
        "tokenTranslations" : {
          "\\Phi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\polylog" : "Polylogarithm; Example: \\polylog{s}@{z}\nWill be translated to: PolyLog[$0, $1]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/25.12#E10\nMathematica:  https://reference.wolfram.com/language/ref/PolyLog.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)",
          "rhs" : "",
          "testExpression" : "\\[CapitalPhi]*(z , s , a)",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        }, {
          "lhs" : "Divide[1,(a)^(s)]+ Pochhammer[1 - m - s, m]*PolyLog[s + m, z]*Divide[(a)^(m),(m)!]\n Abs[a]",
          "rhs" : "",
          "testExpression" : "Divide[1,(a)^(s)]+ Pochhammer[1 - m - s, m]*PolyLog[s + m, z]*Divide[(a)^(m),(m)!]\n Abs[a]",
          "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) = (1)/((a)^(s))+ pochhammer(1 - m - s, m)*polylog(s + m, z)*((a)^(m))/(factorial(m)); sum(abs(a) , m = 0..infinity)< 1",
      "translationInformation" : {
        "freeVariables" : [ "Phi", "a", "s", "z" ],
        "tokenTranslations" : {
          "\\Phi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\polylog" : "Polylogarithm; Example: \\polylog{s}@{z}\nWill be translated to: polylog($0, $1)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/25.12#E10\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=polylog",
          "\\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", "\\Phi(z,s,a)=\\frac{1}{a^s}+\\sum_{m=0}^\\infty (1-m-s)_m \\operatorname{Li}_{s+m}(z)\\frac{a^m}{m!}; |a|<1", "\\Phi(z,s,a)", "\\operatorname{Li}_s(z)", "z", "s", "\\mathrm{Li}_n(z)" ],
  "isPartOf" : [ ],
  "definiens" : [ ]
}

Specify your own input