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!(x+\beta)_{n-k}\gamma^{-k}

Confidence: 0

Mathematica

Translation: Subscript[M, n][x , \[Beta], \[Gamma]] == Sum[(- 1)^(k)*Binomial[n,k]*Binomial[x,k]*(k)!*Subscript[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)!*Subscript[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).

Tests

Symbolic
Numeric

SymPy

Translation: Symbol('{M}_{n}')(x , Symbol('beta'), Symbol('gamma')) == Sum((- 1)**(k)*binomial(n,k)*binomial(x,k)*factorial(k)*Symbol('{x + Symbol('beta')}_{n - k}')*(Symbol('gamma'))**(- k), (k, 0, n))

Information

Sub Equations

  • Symbol('{M}_{n}')(x , Symbol('beta'), Symbol('gamma')) = Sum((- 1)**(k)*binomial(n,k)*binomial(x,k)*factorial(k)*Symbol('{x + Symbol('beta')}_{n - k}')*(Symbol('gamma'))**(- k), (k, 0, n))

Free variables

  • Symbol('beta')
  • Symbol('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).

Tests

Symbolic
Numeric

Maple

Translation: M[n](x , beta , gamma) = sum((- 1)^(k)*binomial(n,k)*binomial(x,k)*factorial(k)*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)*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).

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

  • Failed to parse (syntax error): {\displaystyle =0}}

Description

  • k
  • n
  • x
  • TeX Source
  • beta
  • Formula
  • gamma
  • Gold ID
  • link
  • M_n
  • sum

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!(x+\\beta)_{n-k}\\gamma^{-k}",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "Subscript[M, n][x , \\[Beta], \\[Gamma]] == Sum[(- 1)^(k)*Binomial[n,k]*Binomial[x,k]*(k)!*Subscript[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)!*Subscript[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)."
        }
      },
      "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('{M}_{n}')(x , Symbol('beta'), Symbol('gamma')) == Sum((- 1)**(k)*binomial(n,k)*binomial(x,k)*factorial(k)*Symbol('{x + Symbol('beta')}_{n - k}')*(Symbol('gamma'))**(- k), (k, 0, n))",
      "translationInformation" : {
        "subEquations" : [ "Symbol('{M}_{n}')(x , Symbol('beta'), Symbol('gamma')) = Sum((- 1)**(k)*binomial(n,k)*binomial(x,k)*factorial(k)*Symbol('{x + Symbol('beta')}_{n - k}')*(Symbol('gamma'))**(- k), (k, 0, n))" ],
        "freeVariables" : [ "Symbol('beta')", "Symbol('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)."
        }
      },
      "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)*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)*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)."
        }
      },
      "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" : [ "=0}", "= 0" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "k",
    "score" : 0.8692920440198258
  }, {
    "definition" : "n",
    "score" : 0.8426021531523621
  }, {
    "definition" : "x",
    "score" : 0.8426021531523621
  }, {
    "definition" : "TeX Source",
    "score" : 0.722
  }, {
    "definition" : "beta",
    "score" : 0.6687181434333315
  }, {
    "definition" : "Formula",
    "score" : 0.6687181434333315
  }, {
    "definition" : "gamma",
    "score" : 0.6687181434333315
  }, {
    "definition" : "Gold ID",
    "score" : 0.6687181434333315
  }, {
    "definition" : "link",
    "score" : 0.6687181434333315
  }, {
    "definition" : "M_n",
    "score" : 0.6687181434333315
  }, {
    "definition" : "sum",
    "score" : 0.6687181434333315
  } ]
}

Specify your own input