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 \frac{\mathrm{d}}{\mathrm{d}z} \operatorname{dn}(z) = - k^2 \operatorname{sn}(z) \operatorname{cn}(z)}

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

Semantic latex: \deriv [1]{ }{z} \operatorname{dn}(z) = - k^2 \operatorname{sn}(z) \operatorname{cn}(z)

Confidence: 0

Mathematica

Translation: D[dn[z], {z, 1}] == - (k)^(2)* sn[z]* cn[z]

Information

Sub Equations

  • D[dn[z], {z, 1}] = - (k)^(2)* sn[z]* cn[z]

Free variables

  • k
  • z

Symbol info

  • Derivative; Example: \deriv[n]{f}{x}

Will be translated to: D[$1, {$2, $0}] Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.4#E4 Mathematica: https://reference.wolfram.com/language/ref/D.html

  • Was interpreted as a function call because of a leading \operatorname.
  • Was interpreted as a function call because of a leading \operatorname.
  • Was interpreted as a function call because of a leading \operatorname.

Tests

Symbolic

Test expression: (D[dn[z], {z, 1}])-(- (k)^(2)* sn[z]* cn[z])

ERROR:

{
    "result": "ERROR",
    "testTitle": "Simple",
    "testExpression": null,
    "resultExpression": null,
    "wasAborted": false,
    "conditionallySuccessful": false
}
Numeric

SymPy

Translation: diff(dn(z), z, 1) == - (k)**(2)* sn(z)* cn(z)

Information

Sub Equations

  • diff(dn(z), z, 1) = - (k)**(2)* sn(z)* cn(z)

Free variables

  • k
  • z

Symbol info

  • Derivative; Example: \deriv[n]{f}{x}

Will be translated to: diff($1, $2, $0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.4#E4 SymPy: https://docs.sympy.org/latest/tutorial/calculus.html#derivatives

  • Was interpreted as a function call because of a leading \operatorname.
  • Was interpreted as a function call because of a leading \operatorname.
  • Was interpreted as a function call because of a leading \operatorname.

Tests

Symbolic
Numeric

Maple

Translation: diff(dn(z), [z$(1)]) = - (k)^(2)* sn(z)* cn(z)

Information

Sub Equations

  • diff(dn(z), [z$(1)]) = - (k)^(2)* sn(z)* cn(z)

Free variables

  • k
  • z

Symbol info

  • Derivative; Example: \deriv[n]{f}{x}

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

  • Was interpreted as a function call because of a leading \operatorname.
  • Was interpreted as a function call because of a leading \operatorname.
  • Was interpreted as a function call because of a leading \operatorname.

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • z
  • operatorname
  • d
  • mathrm
  • TeX Source
  • cn
  • dn
  • Formula
  • frac
  • Gold ID
  • k
  • link
  • sn

Complete translation information:

{
  "id" : "FORMULA_b54c03865b3efa9ea9112567cd66f59d",
  "formula" : "\\frac{\\mathrm{d}}{\\mathrm{d}z} \\operatorname{dn}(z) = - k^2 \\operatorname{sn}(z) \\operatorname{cn}(z)",
  "semanticFormula" : "\\deriv [1]{ }{z} \\operatorname{dn}(z) = - k^2 \\operatorname{sn}(z) \\operatorname{cn}(z)",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "D[dn[z], {z, 1}] == - (k)^(2)* sn[z]* cn[z]",
      "translationInformation" : {
        "subEquations" : [ "D[dn[z], {z, 1}] = - (k)^(2)* sn[z]* cn[z]" ],
        "freeVariables" : [ "k", "z" ],
        "tokenTranslations" : {
          "\\deriv1" : "Derivative; Example: \\deriv[n]{f}{x}\nWill be translated to: D[$1, {$2, $0}]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/1.4#E4\nMathematica:  https://reference.wolfram.com/language/ref/D.html",
          "dn" : "Was interpreted as a function call because of a leading \\operatorname.",
          "sn" : "Was interpreted as a function call because of a leading \\operatorname.",
          "cn" : "Was interpreted as a function call because of a leading \\operatorname."
        }
      },
      "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" : "D[dn[z], {z, 1}]",
          "rhs" : "- (k)^(2)* sn[z]* cn[z]",
          "testExpression" : "(D[dn[z], {z, 1}])-(- (k)^(2)* sn[z]* cn[z])",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        } ]
      }
    },
    "SymPy" : {
      "translation" : "diff(dn(z), z, 1) == - (k)**(2)* sn(z)* cn(z)",
      "translationInformation" : {
        "subEquations" : [ "diff(dn(z), z, 1) = - (k)**(2)* sn(z)* cn(z)" ],
        "freeVariables" : [ "k", "z" ],
        "tokenTranslations" : {
          "\\deriv1" : "Derivative; Example: \\deriv[n]{f}{x}\nWill be translated to: diff($1, $2, $0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/1.4#E4\nSymPy: https://docs.sympy.org/latest/tutorial/calculus.html#derivatives",
          "dn" : "Was interpreted as a function call because of a leading \\operatorname.",
          "sn" : "Was interpreted as a function call because of a leading \\operatorname.",
          "cn" : "Was interpreted as a function call because of a leading \\operatorname."
        }
      }
    },
    "Maple" : {
      "translation" : "diff(dn(z), [z$(1)]) = - (k)^(2)* sn(z)* cn(z)",
      "translationInformation" : {
        "subEquations" : [ "diff(dn(z), [z$(1)]) = - (k)^(2)* sn(z)* cn(z)" ],
        "freeVariables" : [ "k", "z" ],
        "tokenTranslations" : {
          "\\deriv1" : "Derivative; Example: \\deriv[n]{f}{x}\nWill be translated to: diff($1, [$2$($0)])\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/1.4#E4\nMaple: https://www.maplesoft.com/support/help/Maple/view.aspx?path=diff",
          "dn" : "Was interpreted as a function call because of a leading \\operatorname.",
          "sn" : "Was interpreted as a function call because of a leading \\operatorname.",
          "cn" : "Was interpreted as a function call because of a leading \\operatorname."
        }
      }
    }
  },
  "positions" : [ {
    "section" : 1,
    "sentence" : 0,
    "word" : 8
  } ],
  "includes" : [ "^2" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "z",
    "score" : 0.9120612552977239
  }, {
    "definition" : "operatorname",
    "score" : 0.8802823775706166
  }, {
    "definition" : "d",
    "score" : 0.8124341773412527
  }, {
    "definition" : "mathrm",
    "score" : 0.8124341773412527
  }, {
    "definition" : "TeX Source",
    "score" : 0.722
  }, {
    "definition" : "cn",
    "score" : 0.6564392318687055
  }, {
    "definition" : "dn",
    "score" : 0.6564392318687055
  }, {
    "definition" : "Formula",
    "score" : 0.6564392318687055
  }, {
    "definition" : "frac",
    "score" : 0.6564392318687055
  }, {
    "definition" : "Gold ID",
    "score" : 0.6564392318687055
  }, {
    "definition" : "k",
    "score" : 0.6564392318687055
  }, {
    "definition" : "link",
    "score" : 0.6564392318687055
  }, {
    "definition" : "sn",
    "score" : 0.6564392318687055
  } ]
}

Specify your own input