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

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

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

Confidence: 0.66892330633843

Mathematica

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

Information

Sub Equations

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

Free variables

  • 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

Test expression: (HeavisideTheta[y])-(2*(Pi)^(- 1/2)* F*(y))

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

Tests

Symbolic
Numeric

Maple

Translation: Heaviside(y) = 2*(Pi)^(- 1/2)* F(y)

Information

Sub Equations

  • Heaviside(y) = 2*(Pi)^(- 1/2)* F(y)

Free variables

  • 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

  • Dawson function
  • imaginary part of the result

Complete translation information:

{
  "id" : "FORMULA_ce1cf0e8f1490ae0c1d1ceda8efa80d7",
  "formula" : "H(y) = 2\\pi^{-1/2} F(y)",
  "semanticFormula" : "\\HeavisideH@{y} = 2 \\cpi^{-1/2} F(y)",
  "confidence" : 0.6689233063384251,
  "translations" : {
    "Mathematica" : {
      "translation" : "HeavisideTheta[y] == 2*(Pi)^(- 1/2)* F[y]",
      "translationInformation" : {
        "subEquations" : [ "HeavisideTheta[y] = 2*(Pi)^(- 1/2)* F[y]" ],
        "freeVariables" : [ "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" : "ERROR",
        "numberOfTests" : 1,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 1,
        "crashed" : false,
        "testCalculationsGroup" : [ {
          "lhs" : "HeavisideTheta[y]",
          "rhs" : "2*(Pi)^(- 1/2)* F*(y)",
          "testExpression" : "(HeavisideTheta[y])-(2*(Pi)^(- 1/2)* F*(y))",
          "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: \\HeavisideH [\\HeavisideH]"
        }
      }
    },
    "Maple" : {
      "translation" : "Heaviside(y) = 2*(Pi)^(- 1/2)* F(y)",
      "translationInformation" : {
        "subEquations" : [ "Heaviside(y) = 2*(Pi)^(- 1/2)* F(y)" ],
        "freeVariables" : [ "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"
        }
      }
    }
  },
  "positions" : [ {
    "section" : 2,
    "sentence" : 4,
    "word" : 8
  } ],
  "includes" : [ "H(y)", "F(x)", "y", "F(y)" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "Dawson function",
    "score" : 0.7125985104912714
  }, {
    "definition" : "imaginary part of the result",
    "score" : 0.6460746792928004
  } ]
}

Specify your own input