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 w_i = \frac {2^{n-1} n! \sqrt{\pi}} {n^2[H_{n-1}(x_i)]^2}.}

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

Semantic latex: w_i = \frac{2^{n-1} n! \sqrt{\cpi}}{n^2 [\HermitepolyH{n-1}@{x_i}]^2}

Confidence: 0.86627249984448

Mathematica

Translation: Subscript[w, i] == Divide[(2)^(n[-]*1)* (n)![Sqrt[Pi]],((n[HermiteH[n[-]*1, Subscript[x, i]]])^(2))^(2)]

Information

Sub Equations

  • Subscript[w, i] = Divide[(2)^(n[-]*1)* (n)![Sqrt[Pi]],((n[HermiteH[n[-]*1, Subscript[x, i]]])^(2))^(2)]

Free variables

  • Subscript[w, i]
  • Subscript[x, i]
  • i

Symbol info

  • You use a typical letter for a constant [the imaginary unit == the principal square root of -1].

We keep it like it is! But you should know that Mathematica uses I for this constant. If you want to translate it as a constant, use the corresponding DLMF macro \iunit

  • Pi was translated to: Pi
  • Hermite polynomial; Example: \HermitepolyH{n}@{x}

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

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic
Numeric

SymPy

Translation:

Information

Symbol info

  • (LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \HermitepolyH [\HermitepolyH]

Tests

Symbolic
Numeric

Maple

Translation: w[i] = ((2)^(n(-)*1)* factorial(n)(sqrt(Pi)))/(((n(HermiteH(n(-)*1, x[i])))^(2))^(2))

Information

Sub Equations

  • w[i] = ((2)^(n(-)*1)* factorial(n)(sqrt(Pi)))/(((n(HermiteH(n(-)*1, x[i])))^(2))^(2))

Free variables

  • i
  • w[i]
  • x[i]

Symbol info

  • You use a typical letter for a constant [the imaginary unit == the principal square root of -1].

We keep it like it is! But you should know that Maple uses I for this constant. If you want to translate it as a constant, use the corresponding DLMF macro \iunit

  • Pi was translated to: Pi
  • Hermite polynomial; Example: \HermitepolyH{n}@{x}

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

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • associated weight
  • root of the physicists ' version
  • Hermite polynomial

Complete translation information:

{
  "id" : "FORMULA_d63515a7330191b7725d61ec4cbb99b8",
  "formula" : "w_i = \\frac {2^{n-1} n! \\sqrt{\\pi}} {n^2[H_{n-1}(x_i)]^2}",
  "semanticFormula" : "w_i = \\frac{2^{n-1} n! \\sqrt{\\cpi}}{n^2 [\\HermitepolyH{n-1}@{x_i}]^2}",
  "confidence" : 0.8662724998444776,
  "translations" : {
    "Mathematica" : {
      "translation" : "Subscript[w, i] == Divide[(2)^(n[-]*1)* (n)![Sqrt[Pi]],((n[HermiteH[n[-]*1, Subscript[x, i]]])^(2))^(2)]",
      "translationInformation" : {
        "subEquations" : [ "Subscript[w, i] = Divide[(2)^(n[-]*1)* (n)![Sqrt[Pi]],((n[HermiteH[n[-]*1, Subscript[x, i]]])^(2))^(2)]" ],
        "freeVariables" : [ "Subscript[w, i]", "Subscript[x, i]", "i" ],
        "tokenTranslations" : {
          "i" : "You use a typical letter for a constant [the imaginary unit == the principal square root of -1].\nWe keep it like it is! But you should know that Mathematica uses I for this constant.\nIf you want to translate it as a constant, use the corresponding DLMF macro \\iunit\n",
          "\\cpi" : "Pi was translated to: Pi",
          "\\HermitepolyH" : "Hermite polynomial; Example: \\HermitepolyH{n}@{x}\nWill be translated to: HermiteH[$0, $1]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/18.3#T1.t1.r13\nMathematica:  https://reference.wolfram.com/language/ref/HermiteH.html",
          "n" : "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" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \\HermitepolyH [\\HermitepolyH]"
        }
      },
      "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" : "w[i] = ((2)^(n(-)*1)* factorial(n)(sqrt(Pi)))/(((n(HermiteH(n(-)*1, x[i])))^(2))^(2))",
      "translationInformation" : {
        "subEquations" : [ "w[i] = ((2)^(n(-)*1)* factorial(n)(sqrt(Pi)))/(((n(HermiteH(n(-)*1, x[i])))^(2))^(2))" ],
        "freeVariables" : [ "i", "w[i]", "x[i]" ],
        "tokenTranslations" : {
          "i" : "You use a typical letter for a constant [the imaginary unit == the principal square root of -1].\nWe keep it like it is! But you should know that Maple uses I for this constant.\nIf you want to translate it as a constant, use the corresponding DLMF macro \\iunit\n",
          "\\cpi" : "Pi was translated to: Pi",
          "\\HermitepolyH" : "Hermite polynomial; Example: \\HermitepolyH{n}@{x}\nWill be translated to: HermiteH($0, $1)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/18.3#T1.t1.r13\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=HermiteH",
          "n" : "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" : 0,
    "sentence" : 2,
    "word" : 24
  } ],
  "includes" : [ "x_{i}", "w_{i}", "n" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "associated weight",
    "score" : 0.6859086196238077
  }, {
    "definition" : "root of the physicists ' version",
    "score" : 0.6859086196238077
  }, {
    "definition" : "Hermite polynomial",
    "score" : 0.5988174995334326
  } ]
}

Specify your own input