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 E(e) \,=\, \int_0^{\pi/2}\sqrt {1 - e^2 \sin^2\theta}\ d\theta}

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

Semantic latex: E(\expe) = \int_0^{\cpi / 2} \sqrt{1 - \expe^2 \sin^2 \theta} \diff{\theta}

Confidence: 0

Mathematica

Translation: E[E] == Integrate[Sqrt[1 - Exp[2]*(Sin[\[Theta]])^(2)], {\[Theta], 0, Pi/2}, GenerateConditions->None]

Information

Sub Equations

  • E[E] = Integrate[Sqrt[1 - Exp[2]*(Sin[\[Theta]])^(2)], {\[Theta], 0, Pi/2}, GenerateConditions->None]

Symbol info

  • Pi was translated to: Pi
  • Recognizes e with power as the exponential function. It was translated as a function.
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • 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: (E*(E))-(Integrate[Sqrt[1 - Exp[2]*(Sin[\[Theta]])^(2)], {\[Theta], 0, Pi/2}, GenerateConditions->None])

ERROR:

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

SymPy

Translation: E(E) == integrate(sqrt(1 - exp(2)*(sin(Symbol('theta')))**(2)), (Symbol('theta'), 0, pi/2))

Information

Sub Equations

  • E(E) = integrate(sqrt(1 - exp(2)*(sin(Symbol('theta')))**(2)), (Symbol('theta'), 0, pi/2))

Symbol info

  • Pi was translated to: pi
  • Recognizes e with power as the exponential function. It was translated as a function.
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • 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: E(exp(1)) = int(sqrt(1 - exp(2)*(sin(theta))^(2)), theta = 0..Pi/2)

Information

Sub Equations

  • E(exp(1)) = int(sqrt(1 - exp(2)*(sin(theta))^(2)), theta = 0..Pi/2)

Symbol info

  • Pi was translated to: Pi
  • Recognizes e with power as the exponential function. It was translated as a function.
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • 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

  • Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 0^{}

Is part of

Complete translation information:

{
  "id" : "FORMULA_0b1647709983b3f7478f28e3a53b6044",
  "formula" : "E(e) = \\int_0^{\\pi/2}\\sqrt {1 - e^2 \\sin^2\\theta}d\\theta",
  "semanticFormula" : "E(\\expe) = \\int_0^{\\cpi / 2} \\sqrt{1 - \\expe^2 \\sin^2 \\theta} \\diff{\\theta}",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "E[E] == Integrate[Sqrt[1 - Exp[2]*(Sin[\\[Theta]])^(2)], {\\[Theta], 0, Pi/2}, GenerateConditions->None]",
      "translationInformation" : {
        "subEquations" : [ "E[E] = Integrate[Sqrt[1 - Exp[2]*(Sin[\\[Theta]])^(2)], {\\[Theta], 0, Pi/2}, GenerateConditions->None]" ],
        "tokenTranslations" : {
          "\\cpi" : "Pi was translated to: Pi",
          "\\expe" : "Recognizes e with power as the exponential function. It was translated as a function.",
          "E" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\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" : 1,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 1,
        "crashed" : false,
        "testCalculationsGroup" : [ {
          "lhs" : "E*(E)",
          "rhs" : "Integrate[Sqrt[1 - Exp[2]*(Sin[\\[Theta]])^(2)], {\\[Theta], 0, Pi/2}, GenerateConditions->None]",
          "testExpression" : "(E*(E))-(Integrate[Sqrt[1 - Exp[2]*(Sin[\\[Theta]])^(2)], {\\[Theta], 0, Pi/2}, GenerateConditions->None])",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        } ]
      }
    },
    "SymPy" : {
      "translation" : "E(E) == integrate(sqrt(1 - exp(2)*(sin(Symbol('theta')))**(2)), (Symbol('theta'), 0, pi/2))",
      "translationInformation" : {
        "subEquations" : [ "E(E) = integrate(sqrt(1 - exp(2)*(sin(Symbol('theta')))**(2)), (Symbol('theta'), 0, pi/2))" ],
        "tokenTranslations" : {
          "\\cpi" : "Pi was translated to: pi",
          "\\expe" : "Recognizes e with power as the exponential function. It was translated as a function.",
          "E" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\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" : "E(exp(1)) = int(sqrt(1 - exp(2)*(sin(theta))^(2)), theta = 0..Pi/2)",
      "translationInformation" : {
        "subEquations" : [ "E(exp(1)) = int(sqrt(1 - exp(2)*(sin(theta))^(2)), theta = 0..Pi/2)" ],
        "tokenTranslations" : {
          "\\cpi" : "Pi was translated to: Pi",
          "\\expe" : "Recognizes e with power as the exponential function. It was translated as a function.",
          "E" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\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" : [ "E(e) \\,=\\, \\int_0^{\\pi/2}\\sqrt {1 - e^2 \\sin^2\\theta}\\ d\\theta", "^2", "0^{" ],
  "isPartOf" : [ "E(e) \\,=\\, \\int_0^{\\pi/2}\\sqrt {1 - e^2 \\sin^2\\theta}\\ d\\theta" ],
  "definiens" : [ ]
}

Specify your own input