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 P_{n}(z) = \frac{1 }{2^n n! } \frac{d^n }{ d z^n } ( z^2 - 1 )^n \; . }

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

Semantic latex: \LegendrepolyP{n}@{z} = \frac{1 }{2^n n! } \deriv [n]{ }{z}(z^2 - 1)^n

Confidence: 0.67814962762282

Mathematica

Translation: LegendreP[n, z] == Divide[1,(2)^(n)* (n)!]*D[((z)^(2)- 1)^(n), {z, n}]

Information

Sub Equations

  • LegendreP[n, z] = Divide[1,(2)^(n)* (n)!]*D[((z)^(2)- 1)^(n), {z, n}]

Free variables

  • n
  • z

Symbol info

  • Legendre polynomial; Example: \LegendrepolyP{n}@{x}

Will be translated to: LegendreP[$0, $1] Relevant links to definitions: DLMF: http://dlmf.nist.gov/18.3#T1.t1.r10 Mathematica: https://reference.wolfram.com/language/ref/LegendreP.html

  • Derivative; Example: \deriv[n]{f}{x}

Will be translated to: D[$1, {$2, $0}] Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.4#E4 Mathematica: https://reference.wolfram.com/language/ref/D.html

Tests

Symbolic

Test expression: (LegendreP[n, z])-(Divide[1,(2)^(n)* (n)!]*D[((z)^(2)- 1)^(n), {z, n}])

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

Tests

Symbolic
Numeric

Maple

Translation: LegendreP(n, z) = (1)/((2)^(n)* factorial(n))*diff(((z)^(2)- 1)^(n), [z$(n)])

Information

Sub Equations

  • LegendreP(n, z) = (1)/((2)^(n)* factorial(n))*diff(((z)^(2)- 1)^(n), [z$(n)])

Free variables

  • n
  • z

Symbol info

  • Legendre polynomial; Example: \LegendrepolyP{n}@{x}

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

  • Derivative; Example: \deriv[n]{f}{x}

Will be translated to: diff($1, [$2$($0)]) Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.4#E4 Maple: https://www.maplesoft.com/support/help/Maple/view.aspx?path=diff

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Is part of

Complete translation information:

{
  "id" : "FORMULA_0d9e2107b86d41c929d755c9eaac3f88",
  "formula" : "P_{n}(z) = \\frac{1 }{2^n  n! } \\frac{d^n }{ d z^n }  ( z^2 - 1 )^n",
  "semanticFormula" : "\\LegendrepolyP{n}@{z} = \\frac{1 }{2^n  n! } \\deriv [n]{ }{z}(z^2 - 1)^n",
  "confidence" : 0.6781496276228178,
  "translations" : {
    "Mathematica" : {
      "translation" : "LegendreP[n, z] == Divide[1,(2)^(n)* (n)!]*D[((z)^(2)- 1)^(n), {z, n}]",
      "translationInformation" : {
        "subEquations" : [ "LegendreP[n, z] = Divide[1,(2)^(n)* (n)!]*D[((z)^(2)- 1)^(n), {z, n}]" ],
        "freeVariables" : [ "n", "z" ],
        "tokenTranslations" : {
          "\\LegendrepolyP" : "Legendre polynomial; Example: \\LegendrepolyP{n}@{x}\nWill be translated to: LegendreP[$0, $1]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/18.3#T1.t1.r10\nMathematica:  https://reference.wolfram.com/language/ref/LegendreP.html",
          "\\deriv1" : "Derivative; Example: \\deriv[n]{f}{x}\nWill be translated to: D[$1, {$2, $0}]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/1.4#E4\nMathematica:  https://reference.wolfram.com/language/ref/D.html"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "ERROR",
        "numberOfTests" : 1,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 1,
        "crashed" : false,
        "testCalculationsGroup" : [ {
          "lhs" : "LegendreP[n, z]",
          "rhs" : "Divide[1,(2)^(n)* (n)!]*D[((z)^(2)- 1)^(n), {z, n}]",
          "testExpression" : "(LegendreP[n, z])-(Divide[1,(2)^(n)* (n)!]*D[((z)^(2)- 1)^(n), {z, n}])",
          "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: \\LegendrepolyP [\\LegendrepolyP]"
        }
      }
    },
    "Maple" : {
      "translation" : "LegendreP(n, z) = (1)/((2)^(n)* factorial(n))*diff(((z)^(2)- 1)^(n), [z$(n)])",
      "translationInformation" : {
        "subEquations" : [ "LegendreP(n, z) = (1)/((2)^(n)* factorial(n))*diff(((z)^(2)- 1)^(n), [z$(n)])" ],
        "freeVariables" : [ "n", "z" ],
        "tokenTranslations" : {
          "\\LegendrepolyP" : "Legendre polynomial; Example: \\LegendrepolyP{n}@{x}\nWill be translated to: LegendreP($0, $1)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/18.3#T1.t1.r10\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=LegendreP",
          "\\deriv1" : "Derivative; Example: \\deriv[n]{f}{x}\nWill be translated to: diff($1, [$2$($0)])\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/1.4#E4\nMaple: https://www.maplesoft.com/support/help/Maple/view.aspx?path=diff"
        }
      }
    }
  },
  "positions" : [ ],
  "includes" : [ "z", "P_{n}(z) = \\frac{1 }{2^n  n! } \\frac{d^n }{ d z^n }  ( z^2 - 1 )^n  \\;", "n" ],
  "isPartOf" : [ "P_{n}(z) = \\frac{1 }{2^n  n! } \\frac{d^n }{ d z^n }  ( z^2 - 1 )^n  \\;" ],
  "definiens" : [ ]
}

Specify your own input