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 \mathbf{H}_{-n-\frac{1}{2}} (z) = (-1)^n J_{n+\frac{1}{2}}(z),}

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

Semantic latex: \StruveH{-n-\frac{1}{2}}@{z} =(- 1)^n J_{n+\frac{1}{2}}(z)

Confidence: 0.67620238095238

Mathematica

Translation: StruveH[- n -Divide[1,2], z] == (- 1)^(n)* Subscript[J, n +Divide[1,2]][z]

Information

Sub Equations

  • StruveH[- n -Divide[1,2], z] = (- 1)^(n)* Subscript[J, n +Divide[1,2]][z]

Free variables

  • n
  • z

Symbol info

  • Struve function; Example: \StruveH{\nu}@{z}

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

Tests

Symbolic
Numeric

Maple

Translation: StruveH(- n -(1)/(2), z) = (- 1)^(n)* J[n +(1)/(2)](z)

Information

Sub Equations

  • StruveH(- n -(1)/(2), z) = (- 1)^(n)* J[n +(1)/(2)](z)

Free variables

  • n
  • z

Symbol info

  • Struve function; Example: \StruveH{\nu}@{z}

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

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

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • spherical Bessel function
  • non-negative integer
  • right hand side

Complete translation information:

{
  "id" : "FORMULA_d5bb11da7cdb43d96b01e170ad47f375",
  "formula" : "\\mathbf{H}_{-n-\\frac{1}{2}} (z) = (-1)^n J_{n+\\frac{1}{2}}(z)",
  "semanticFormula" : "\\StruveH{-n-\\frac{1}{2}}@{z} =(- 1)^n J_{n+\\frac{1}{2}}(z)",
  "confidence" : 0.6762023809523809,
  "translations" : {
    "Mathematica" : {
      "translation" : "StruveH[- n -Divide[1,2], z] == (- 1)^(n)* Subscript[J, n +Divide[1,2]][z]",
      "translationInformation" : {
        "subEquations" : [ "StruveH[- n -Divide[1,2], z] = (- 1)^(n)* Subscript[J, n +Divide[1,2]][z]" ],
        "freeVariables" : [ "n", "z" ],
        "tokenTranslations" : {
          "\\StruveH" : "Struve function; Example: \\StruveH{\\nu}@{z}\nWill be translated to: StruveH[$0, $1]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/11.2#E1\nMathematica:  https://reference.wolfram.com/language/ref/StruveH.html",
          "J" : "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: \\StruveH [\\StruveH]"
        }
      },
      "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" : "StruveH(- n -(1)/(2), z) = (- 1)^(n)* J[n +(1)/(2)](z)",
      "translationInformation" : {
        "subEquations" : [ "StruveH(- n -(1)/(2), z) = (- 1)^(n)* J[n +(1)/(2)](z)" ],
        "freeVariables" : [ "n", "z" ],
        "tokenTranslations" : {
          "\\StruveH" : "Struve function; Example: \\StruveH{\\nu}@{z}\nWill be translated to: StruveH($0, $1)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/11.2#E1\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=StruveH",
          "J" : "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" : 6,
    "sentence" : 1,
    "word" : 9
  } ],
  "includes" : [ "n +\\frac{1}{2}", "n" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "spherical Bessel function",
    "score" : 0.7125985104912714
  }, {
    "definition" : "non-negative integer",
    "score" : 0.6859086196238077
  }, {
    "definition" : "right hand side",
    "score" : 0.6859086196238077
  } ]
}

Specify your own input