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 H_1=-\pi^{-1/2}y+2\pi^{-1/2}y^2F(y)}

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

Semantic latex: \HeavisideH@{x}_1 = - \cpi^{-1/2} y + 2 \cpi^{-1/2} y^2 F(y)

Confidence: 0.45649673482167

Mathematica

Translation: Subscript[HeavisideTheta[x], 1] == - (Pi)^(- 1/2)* y + 2*(Pi)^(- 1/2)* (y)^(2)* F[y]

Information

Sub Equations

  • Subscript[HeavisideTheta[x], 1] = - (Pi)^(- 1/2)* y + 2*(Pi)^(- 1/2)* (y)^(2)* F[y]

Free variables

  • x
  • y

Symbol info

  • Heaviside step function; Example: \HeavisideH@{x}

Will be translated to: HeavisideTheta[$0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.16#E13 Mathematica: https://reference.wolfram.com/language/ref/HeavisideTheta.html

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

Tests

Symbolic
Numeric

SymPy

Translation:

Information

Symbol info

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

Tests

Symbolic
Numeric

Maple

Translation: Heaviside(x)[1] = - (Pi)^(- 1/2)* y + 2*(Pi)^(- 1/2)* (y)^(2)* F(y)

Information

Sub Equations

  • Heaviside(x)[1] = - (Pi)^(- 1/2)* y + 2*(Pi)^(- 1/2)* (y)^(2)* F(y)

Free variables

  • x
  • y

Symbol info

  • Heaviside step function; Example: \HeavisideH@{x}

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

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

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • example

Complete translation information:

{
  "id" : "FORMULA_984fe8f8d80615767106b808879f6438",
  "formula" : "H_1=-\\pi^{-1/2}y+2\\pi^{-1/2}y^2F(y)",
  "semanticFormula" : "\\HeavisideH@{x}_1 = - \\cpi^{-1/2} y + 2 \\cpi^{-1/2} y^2 F(y)",
  "confidence" : 0.4564967348216724,
  "translations" : {
    "Mathematica" : {
      "translation" : "Subscript[HeavisideTheta[x], 1] == - (Pi)^(- 1/2)* y + 2*(Pi)^(- 1/2)* (y)^(2)* F[y]",
      "translationInformation" : {
        "subEquations" : [ "Subscript[HeavisideTheta[x], 1] = - (Pi)^(- 1/2)* y + 2*(Pi)^(- 1/2)* (y)^(2)* F[y]" ],
        "freeVariables" : [ "x", "y" ],
        "tokenTranslations" : {
          "\\HeavisideH" : "Heaviside step function; Example: \\HeavisideH@{x}\nWill be translated to: HeavisideTheta[$0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/1.16#E13\nMathematica:  https://reference.wolfram.com/language/ref/HeavisideTheta.html",
          "F" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\cpi" : "Pi was translated to: Pi"
        }
      },
      "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: \\HeavisideH [\\HeavisideH]"
        }
      },
      "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" : "Heaviside(x)[1] = - (Pi)^(- 1/2)* y + 2*(Pi)^(- 1/2)* (y)^(2)* F(y)",
      "translationInformation" : {
        "subEquations" : [ "Heaviside(x)[1] = - (Pi)^(- 1/2)* y + 2*(Pi)^(- 1/2)* (y)^(2)* F(y)" ],
        "freeVariables" : [ "x", "y" ],
        "tokenTranslations" : {
          "\\HeavisideH" : "Heaviside step function; Example: \\HeavisideH@{x}\nWill be translated to: Heaviside($0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/1.16#E13\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Heaviside",
          "F" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\cpi" : "Pi was translated to: Pi"
        }
      },
      "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" : 2,
    "sentence" : 10,
    "word" : 3
  } ],
  "includes" : [ "F(x)", "y", "F(y)", "H_n" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "example",
    "score" : 0.7125985104912714
  } ]
}

Specify your own input