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 \cos^2 t -\sin^2 t=\cos 2t,\ \ 2\sin t \cos t = \sin 2t}

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

Semantic latex: \cos^2 t -\sin^2 t=\cos 2t,2\sin t \cos t = \sin 2t

Confidence: 0

Mathematica

Translation: (Cos[t])^(2)- (Sin[t])^(2) == Cos[2]*t 2*Sin[t]*Cos[t] == Sin[2]*t

Information

Free variables

  • t

Symbol info

  • Cosine; Example: \cos@@{z}

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

  • Sine; Example: \sin@@{z}

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

Tests

Symbolic

Test expression: (Cos[t])^(2)- (Sin[t])^(2)

ERROR:

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

Test expression: Cos[2]*t 2*Sin[t]*Cos[t]

ERROR:

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

SymPy

Translation: (cos(t))**(2)- (sin(t))**(2) == cos(2)*t 2*sin(t)*cos(t) == sin(2)*t

Information

Free variables

  • t

Symbol info

  • Cosine; Example: \cos@@{z}

Will be translated to: cos($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.14#E2 SymPy: https://docs.sympy.org/latest/modules/functions/elementary.html#cos

  • Sine; Example: \sin@@{z}

Will be translated to: sin($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.14#E1 SymPy: https://docs.sympy.org/latest/modules/functions/elementary.html#sin

Tests

Symbolic
Numeric

Maple

Translation: (cos(t))^(2)- (sin(t))^(2) = cos(2)*t; 2*sin(t)*cos(t) = sin(2)*t

Information

Free variables

  • t

Symbol info

  • Cosine; Example: \cos@@{z}

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

  • Sine; Example: \sin@@{z}

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

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Is part of

Complete translation information:

{
  "id" : "FORMULA_c01f2b9fe14ebebd3015297ea0bfe5c6",
  "formula" : "\\cos^2 t -\\sin^2 t=\\cos 2t,2\\sin t \\cos t = \\sin 2t",
  "semanticFormula" : "\\cos^2 t -\\sin^2 t=\\cos 2t,2\\sin t \\cos t = \\sin 2t",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "(Cos[t])^(2)- (Sin[t])^(2) == Cos[2]*t\n 2*Sin[t]*Cos[t] == Sin[2]*t",
      "translationInformation" : {
        "freeVariables" : [ "t" ],
        "tokenTranslations" : {
          "\\cos" : "Cosine; Example: \\cos@@{z}\nWill be translated to: Cos[$0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/4.14#E2\nMathematica:  https://reference.wolfram.com/language/ref/Cos.html",
          "\\sin" : "Sine; Example: \\sin@@{z}\nWill be translated to: Sin[$0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/4.14#E1\nMathematica:  https://reference.wolfram.com/language/ref/Sin.html"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "ERROR",
        "numberOfTests" : 2,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 2,
        "crashed" : false,
        "testCalculationsGroup" : [ {
          "lhs" : "(Cos[t])^(2)- (Sin[t])^(2)",
          "rhs" : "",
          "testExpression" : "(Cos[t])^(2)- (Sin[t])^(2)",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        }, {
          "lhs" : "Cos[2]*t\n 2*Sin[t]*Cos[t]",
          "rhs" : "",
          "testExpression" : "Cos[2]*t\n 2*Sin[t]*Cos[t]",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        } ]
      }
    },
    "SymPy" : {
      "translation" : "(cos(t))**(2)- (sin(t))**(2) == cos(2)*t\n 2*sin(t)*cos(t) == sin(2)*t",
      "translationInformation" : {
        "freeVariables" : [ "t" ],
        "tokenTranslations" : {
          "\\cos" : "Cosine; Example: \\cos@@{z}\nWill be translated to: cos($0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/4.14#E2\nSymPy: https://docs.sympy.org/latest/modules/functions/elementary.html#cos",
          "\\sin" : "Sine; Example: \\sin@@{z}\nWill be translated to: sin($0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/4.14#E1\nSymPy: https://docs.sympy.org/latest/modules/functions/elementary.html#sin"
        }
      }
    },
    "Maple" : {
      "translation" : "(cos(t))^(2)- (sin(t))^(2) = cos(2)*t; 2*sin(t)*cos(t) = sin(2)*t",
      "translationInformation" : {
        "freeVariables" : [ "t" ],
        "tokenTranslations" : {
          "\\cos" : "Cosine; Example: \\cos@@{z}\nWill be translated to: cos($0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/4.14#E2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=cos",
          "\\sin" : "Sine; Example: \\sin@@{z}\nWill be translated to: sin($0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/4.14#E1\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=sin"
        }
      }
    }
  },
  "positions" : [ ],
  "includes" : [ "\\cos^2 t -\\sin^2 t=\\cos 2t,\\ \\ 2\\sin t \\cos t = \\sin 2t", "\\cos t", "t", "\\sin t" ],
  "isPartOf" : [ "\\cos^2 t -\\sin^2 t=\\cos 2t,\\ \\ 2\\sin t \\cos t = \\sin 2t" ],
  "definiens" : [ ]
}

Specify your own input