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 t=\operatorname{sn} x}

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

Semantic latex: t = \Jacobiellsnk@@{x}{k}

Confidence: 0.51053965490595

Mathematica

Translation: t == JacobiSN[x, (k)^2]

Information

Sub Equations

  • t = JacobiSN[x, (k)^2]

Free variables

  • k
  • t
  • x

Symbol info

  • Jacobian elliptic function; Example: \Jacobiellsnk@@{z}{k}

Will be translated to: JacobiSN[$0, ($1)^2] Relevant links to definitions: DLMF: http://dlmf.nist.gov/22.2#E4 Mathematica: https://reference.wolfram.com/language/ref/JacobiSN.html

Tests

Symbolic

Test expression: (t)-(JacobiSN[x, (k)^2])

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

Tests

Symbolic
Numeric

Maple

Translation: t = JacobiSN(x, k)

Information

Sub Equations

  • t = JacobiSN(x, k)

Free variables

  • k
  • t
  • x

Symbol info

  • Jacobian elliptic function; Example: \Jacobiellsnk@@{z}{k}

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

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • algebraic form
  • Lamé 's equation
  • change
  • special case of Heun 's equation

Complete translation information:

{
  "id" : "FORMULA_f17d55ffc9337b536f28d1f9306874be",
  "formula" : "t=\\operatorname{sn} x",
  "semanticFormula" : "t = \\Jacobiellsnk@@{x}{k}",
  "confidence" : 0.510539654905952,
  "translations" : {
    "Mathematica" : {
      "translation" : "t == JacobiSN[x, (k)^2]",
      "translationInformation" : {
        "subEquations" : [ "t = JacobiSN[x, (k)^2]" ],
        "freeVariables" : [ "k", "t", "x" ],
        "tokenTranslations" : {
          "\\Jacobiellsnk" : "Jacobian elliptic function; Example: \\Jacobiellsnk@@{z}{k}\nWill be translated to: JacobiSN[$0, ($1)^2]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/22.2#E4\nMathematica:  https://reference.wolfram.com/language/ref/JacobiSN.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" : "t",
          "rhs" : "JacobiSN[x, (k)^2]",
          "testExpression" : "(t)-(JacobiSN[x, (k)^2])",
          "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: \\Jacobiellsnk [\\Jacobiellsnk]"
        }
      }
    },
    "Maple" : {
      "translation" : "t = JacobiSN(x, k)",
      "translationInformation" : {
        "subEquations" : [ "t = JacobiSN(x, k)" ],
        "freeVariables" : [ "k", "t", "x" ],
        "tokenTranslations" : {
          "\\Jacobiellsnk" : "Jacobian elliptic function; Example: \\Jacobiellsnk@@{z}{k}\nWill be translated to: JacobiSN($0, $1)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/22.2#E4\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=JacobiSN"
        }
      }
    }
  },
  "positions" : [ {
    "section" : 1,
    "sentence" : 3,
    "word" : 8
  } ],
  "includes" : [ "t", "\\operatorname{sn}" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "algebraic form",
    "score" : 0.6460746792928004
  }, {
    "definition" : "Lamé 's equation",
    "score" : 0.5988174995334326
  }, {
    "definition" : "change",
    "score" : 0.5500952380952381
  }, {
    "definition" : "special case of Heun 's equation",
    "score" : 0.5500952380952381
  } ]
}

Specify your own input