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{d}{dz}w =\left (z\frac{d}{dz}+a \right )w,}

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

Semantic latex: \deriv [1]{ }{z} w =(z \deriv [1]{ }{z} + a) w

Confidence: 0

Mathematica

Translation: D[w, {z, 1}] == (z*D[+ , {z, 1}]a)*w

Information

Sub Equations

  • D[w, {z, 1}] = (z*D[+ , {z, 1}]a)*w

Free variables

  • a
  • w
  • 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

Tests

Symbolic

Test expression: (D[w, {z, 1}])-((z*D[+ , {z, 1}]a)*w)

ERROR:

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

SymPy

Translation: diff(w, z, 1) == (z*diff(+ , z, 1)a)*w

Information

Sub Equations

  • diff(w, z, 1) = (z*diff(+ , z, 1)a)*w

Free variables

  • a
  • w
  • 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

Tests

Symbolic
Numeric

Maple

Translation: diff(w, [z$(1)]) = (z*diff(+ , [z$(1)])a)*w

Information

Sub Equations

  • diff(w, [z$(1)]) = (z*diff(+ , [z$(1)])a)*w

Free variables

  • a
  • w
  • 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

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • differential equation for this function
  • solution

Complete translation information:

{
  "id" : "FORMULA_da2ec9bfddc82749e0be56a7349cffe8",
  "formula" : "\\frac{d}{dz}w =\\left  (z\\frac{d}{dz}+a \\right )w",
  "semanticFormula" : "\\deriv [1]{ }{z} w =(z \\deriv [1]{ }{z} + a) w",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "D[w, {z, 1}] == (z*D[+ , {z, 1}]a)*w",
      "translationInformation" : {
        "subEquations" : [ "D[w, {z, 1}] = (z*D[+ , {z, 1}]a)*w" ],
        "freeVariables" : [ "a", "w", "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"
        }
      },
      "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[w, {z, 1}]",
          "rhs" : "(z*D[+ , {z, 1}]a)*w",
          "testExpression" : "(D[w, {z, 1}])-((z*D[+ , {z, 1}]a)*w)",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        } ]
      }
    },
    "SymPy" : {
      "translation" : "diff(w, z, 1) == (z*diff(+ , z, 1)a)*w",
      "translationInformation" : {
        "subEquations" : [ "diff(w, z, 1) = (z*diff(+ , z, 1)a)*w" ],
        "freeVariables" : [ "a", "w", "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"
        }
      }
    },
    "Maple" : {
      "translation" : "diff(w, [z$(1)]) = (z*diff(+ , [z$(1)])a)*w",
      "translationInformation" : {
        "subEquations" : [ "diff(w, [z$(1)]) = (z*diff(+ , [z$(1)])a)*w" ],
        "freeVariables" : [ "a", "w", "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"
        }
      }
    }
  },
  "positions" : [ {
    "section" : 17,
    "sentence" : 1,
    "word" : 7
  } ],
  "includes" : [ "d", "z", "a" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "differential equation for this function",
    "score" : 0.7125985104912714
  }, {
    "definition" : "solution",
    "score" : 0.6859086196238077
  } ]
}

Specify your own input