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 y = mx \pm\sqrt{m^2 a^2 + b^2}\; .}

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

Semantic latex: y = mx \pm\sqrt{m^2 a^2 + b^2}

Confidence: 0

Mathematica

Translation: y == m*x \[PlusMinus]Sqrt[(m)^(2)* (a)^(2)+ (b)^(2)]

Information

Sub Equations

  • y = m*x +Sqrt[(m)^(2)* (a)^(2)+ (b)^(2)]
  • y = m*x -Sqrt[(m)^(2)* (a)^(2)+ (b)^(2)]

Free variables

  • a
  • b
  • m
  • x
  • y

Symbol info

  • was translated to: \[PlusMinus]
  • Found a potential abbreviation. This program cannot translate abbreviations. Hence it was interpreted as a sequence of variable multiplications, e.g. 'etc' -> 'e*t*c'.

Tests

Symbolic

Test expression: (y)-(m*x +Sqrt[(m)^(2)* (a)^(2)+ (b)^(2)])

ERROR:

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

Test expression: (y)-(m*x -Sqrt[(m)^(2)* (a)^(2)+ (b)^(2)])

ERROR:

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

SymPy

Translation:

Information

Symbol info

  • (LaTeX -> SymPy) An unknown or missing element occurred: Cannot translate operation \pm

Tests

Symbolic
Numeric

Maple

Translation: y = m*x &+- sqrt((m)^(2)* (a)^(2)+ (b)^(2))

Information

Sub Equations

  • y = m*x +sqrt((m)^(2)* (a)^(2)+ (b)^(2))
  • y = m*x -sqrt((m)^(2)* (a)^(2)+ (b)^(2))

Free variables

  • a
  • b
  • m
  • x
  • y

Symbol info

  • was translated to: &+-
  • Found a potential abbreviation. This program cannot translate abbreviations. Hence it was interpreted as a sequence of variable multiplications, e.g. 'etc' -> 'e*t*c'.

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Is part of

Complete translation information:

{
  "id" : "FORMULA_80d5a819b4f3522a25671256b0319001",
  "formula" : "y = mx \\pm\\sqrt{m^2 a^2 + b^2}",
  "semanticFormula" : "y = mx \\pm\\sqrt{m^2 a^2 + b^2}",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "y == m*x \\[PlusMinus]Sqrt[(m)^(2)* (a)^(2)+ (b)^(2)]",
      "translationInformation" : {
        "subEquations" : [ "y = m*x +Sqrt[(m)^(2)* (a)^(2)+ (b)^(2)]", "y = m*x -Sqrt[(m)^(2)* (a)^(2)+ (b)^(2)]" ],
        "freeVariables" : [ "a", "b", "m", "x", "y" ],
        "tokenTranslations" : {
          "\\pm" : "was translated to: \\[PlusMinus]",
          "mx" : "Found a potential abbreviation. This program cannot translate abbreviations. Hence it was interpreted as a sequence of variable multiplications, e.g. 'etc' -> 'e*t*c'."
        }
      },
      "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" : "y",
          "rhs" : "m*x +Sqrt[(m)^(2)* (a)^(2)+ (b)^(2)]",
          "testExpression" : "(y)-(m*x +Sqrt[(m)^(2)* (a)^(2)+ (b)^(2)])",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        }, {
          "lhs" : "y",
          "rhs" : "m*x -Sqrt[(m)^(2)* (a)^(2)+ (b)^(2)]",
          "testExpression" : "(y)-(m*x -Sqrt[(m)^(2)* (a)^(2)+ (b)^(2)])",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        } ]
      }
    },
    "SymPy" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> SymPy) An unknown or missing element occurred: Cannot translate operation \\pm"
        }
      }
    },
    "Maple" : {
      "translation" : "y = m*x &+- sqrt((m)^(2)* (a)^(2)+ (b)^(2))",
      "translationInformation" : {
        "subEquations" : [ "y = m*x +sqrt((m)^(2)* (a)^(2)+ (b)^(2))", "y = m*x -sqrt((m)^(2)* (a)^(2)+ (b)^(2))" ],
        "freeVariables" : [ "a", "b", "m", "x", "y" ],
        "tokenTranslations" : {
          "\\pm" : "was translated to: &+-",
          "mx" : "Found a potential abbreviation. This program cannot translate abbreviations. Hence it was interpreted as a sequence of variable multiplications, e.g. 'etc' -> 'e*t*c'."
        }
      }
    }
  },
  "positions" : [ ],
  "includes" : [ "b", "y = mx \\pm\\sqrt{m^2 a^2 + b^2}\\;", "a", "y", "m", "\\pi b^2" ],
  "isPartOf" : [ "y = mx \\pm\\sqrt{m^2 a^2 + b^2}\\;" ],
  "definiens" : [ ]
}

Specify your own input