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 M_n(x,\beta,\gamma) = \sum_{k=0}^n (-1)^k{n \choose k}{x\choose k}k!(x+\beta)_{n-k}\gamma^{-k}}

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

Semantic latex: M_n(x , \beta , \gamma) = \sum_{k=0}^n(- 1)^k{n \choose k}{x\choose k} k! \Pochhammersym{x + \beta}{n-k} \gamma^{-k}

Confidence: 0.89530287320794

Mathematica

Translation: Subscript[M, n][x , \[Beta], \[Gamma]] == Sum[(- 1)^(k)*Binomial[n,k]*Binomial[x,k]*(k)!*Pochhammer[x + \[Beta], n - k]*\[Gamma]^(- k), {k, 0, n}, GenerateConditions->None]

Information

Sub Equations

  • Subscript[M, n][x , \[Beta], \[Gamma]] = Sum[(- 1)^(k)*Binomial[n,k]*Binomial[x,k]*(k)!*Pochhammer[x + \[Beta], n - k]*\[Gamma]^(- k), {k, 0, n}, GenerateConditions->None]

Free variables

  • \[Beta]
  • \[Gamma]
  • n
  • x

Symbol info

  • Could be the Euler-Mascheroni constant.

But it is also a Greek letter. Be aware, that this program translated the letter as a normal Greek letter and not as a constant! Use the DLMF-Macro \EulerConstant to translate \gamma as a constant.

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • 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
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: M[n](x , beta , gamma) = sum((- 1)^(k)*binomial(n,k)*binomial(x,k)*factorial(k)*pochhammer(x + beta, n - k)*(gamma)^(- k), k = 0..n)

Information

Sub Equations

  • M[n](x , beta , gamma) = sum((- 1)^(k)*binomial(n,k)*binomial(x,k)*factorial(k)*pochhammer(x + beta, n - k)*(gamma)^(- k), k = 0..n)

Free variables

  • beta
  • gamma
  • n
  • x

Symbol info

  • Could be the Euler-Mascheroni constant.

But it is also a Greek letter. Be aware, that this program translated the letter as a normal Greek letter and not as a constant! Use the DLMF-Macro \EulerConstant to translate \gamma as a constant.

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • 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

Description

  • Pochhammer symbol
  • term of binomial coefficient

Complete translation information:

{
  "id" : "FORMULA_29a1f82de004c5721c8dfc5dd1dc5b98",
  "formula" : "M_n(x,\\beta,\\gamma) = \\sum_{k=0}^n (-1)^k{n \\choose k}{x\\choose k}k!(x+\\beta)_{n-k}\\gamma^{-k}",
  "semanticFormula" : "M_n(x , \\beta , \\gamma) = \\sum_{k=0}^n(- 1)^k{n \\choose k}{x\\choose k} k! \\Pochhammersym{x + \\beta}{n-k} \\gamma^{-k}",
  "confidence" : 0.8953028732079359,
  "translations" : {
    "Mathematica" : {
      "translation" : "Subscript[M, n][x , \\[Beta], \\[Gamma]] == Sum[(- 1)^(k)*Binomial[n,k]*Binomial[x,k]*(k)!*Pochhammer[x + \\[Beta], n - k]*\\[Gamma]^(- k), {k, 0, n}, GenerateConditions->None]",
      "translationInformation" : {
        "subEquations" : [ "Subscript[M, n][x , \\[Beta], \\[Gamma]] = Sum[(- 1)^(k)*Binomial[n,k]*Binomial[x,k]*(k)!*Pochhammer[x + \\[Beta], n - k]*\\[Gamma]^(- k), {k, 0, n}, GenerateConditions->None]" ],
        "freeVariables" : [ "\\[Beta]", "\\[Gamma]", "n", "x" ],
        "tokenTranslations" : {
          "\\gamma" : "Could be the Euler-Mascheroni constant.\nBut it is also a Greek letter. Be aware, that this program translated the letter as a normal Greek letter and not as a constant!\nUse the DLMF-Macro \\EulerConstant to translate \\gamma as a constant.\n",
          "M" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\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" : "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: \\Pochhammersym [\\Pochhammersym]"
        }
      },
      "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" : "M[n](x , beta , gamma) = sum((- 1)^(k)*binomial(n,k)*binomial(x,k)*factorial(k)*pochhammer(x + beta, n - k)*(gamma)^(- k), k = 0..n)",
      "translationInformation" : {
        "subEquations" : [ "M[n](x , beta , gamma) = sum((- 1)^(k)*binomial(n,k)*binomial(x,k)*factorial(k)*pochhammer(x + beta, n - k)*(gamma)^(- k), k = 0..n)" ],
        "freeVariables" : [ "beta", "gamma", "n", "x" ],
        "tokenTranslations" : {
          "\\gamma" : "Could be the Euler-Mascheroni constant.\nBut it is also a Greek letter. Be aware, that this program translated the letter as a normal Greek letter and not as a constant!\nUse the DLMF-Macro \\EulerConstant to translate \\gamma as a constant.\n",
          "M" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\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"
        }
      },
      "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" : 0,
    "sentence" : 1,
    "word" : 16
  } ],
  "includes" : [ ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "Pochhammer symbol",
    "score" : 0.6859086196238077
  }, {
    "definition" : "term of binomial coefficient",
    "score" : 0.6460746792928004
  } ]
}

Specify your own input