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 \mathrm{Gi}(x) = \frac{1}{\pi} \int_0^\infty \sin\left(\frac{t^3}{3} + xt\right)\, dt}

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

Semantic latex: \mathrm{Gi}(x) = \frac{1}{\cpi} \int_0^\infty \sin(\frac{t^3}{3} + xt) \diff{t}

Confidence: 0

Mathematica

Translation: Gi[x] == Divide[1,Pi]*Integrate[Sin[Divide[(t)^(3),3]+ x*t], {t, 0, Infinity}, GenerateConditions->None]

Information

Sub Equations

  • Gi[x] = Divide[1,Pi]*Integrate[Sin[Divide[(t)^(3),3]+ x*t], {t, 0, Infinity}, GenerateConditions->None]

Free variables

  • x

Symbol info

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Pi was translated to: Pi
  • 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: (Gi[x])-(Divide[1,Pi]*Integrate[Sin[Divide[(t)^(3),3]+ x*t], {t, 0, Infinity}, GenerateConditions->None])

ERROR:

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

SymPy

Translation: Gi(x) == (1)/(pi)*integrate(sin(((t)**(3))/(3)+ x*t), (t, 0, oo))

Information

Sub Equations

  • Gi(x) = (1)/(pi)*integrate(sin(((t)**(3))/(3)+ x*t), (t, 0, oo))

Free variables

  • x

Symbol info

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Pi was translated to: pi
  • 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: Gi(x) = (1)/(Pi)*int(sin(((t)^(3))/(3)+ x*t), t = 0..infinity)

Information

Sub Equations

  • Gi(x) = (1)/(Pi)*int(sin(((t)^(3))/(3)+ x*t), t = 0..infinity)

Free variables

  • x

Symbol info

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Pi was translated to: Pi
  • 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 (syntax error): {\displaystyle 0^}
  • Failed to parse (syntax error): {\displaystyle ^3}{3} +}

Is part of

Complete translation information:

{
  "id" : "FORMULA_df9c8c7c4c42c2db05ff36460f65cf90",
  "formula" : "\\mathrm{Gi}(x) = \\frac{1}{\\pi} \\int_0^\\infty \\sin\\left(\\frac{t^3}{3} + xt\\right) dt",
  "semanticFormula" : "\\mathrm{Gi}(x) = \\frac{1}{\\cpi} \\int_0^\\infty \\sin(\\frac{t^3}{3} + xt) \\diff{t}",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "Gi[x] == Divide[1,Pi]*Integrate[Sin[Divide[(t)^(3),3]+ x*t], {t, 0, Infinity}, GenerateConditions->None]",
      "translationInformation" : {
        "subEquations" : [ "Gi[x] = Divide[1,Pi]*Integrate[Sin[Divide[(t)^(3),3]+ x*t], {t, 0, Infinity}, GenerateConditions->None]" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "Gi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\cpi" : "Pi was translated to: Pi",
          "\\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" : "Gi[x]",
          "rhs" : "Divide[1,Pi]*Integrate[Sin[Divide[(t)^(3),3]+ x*t], {t, 0, Infinity}, GenerateConditions->None]",
          "testExpression" : "(Gi[x])-(Divide[1,Pi]*Integrate[Sin[Divide[(t)^(3),3]+ x*t], {t, 0, Infinity}, GenerateConditions->None])",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        } ]
      }
    },
    "SymPy" : {
      "translation" : "Gi(x) == (1)/(pi)*integrate(sin(((t)**(3))/(3)+ x*t), (t, 0, oo))",
      "translationInformation" : {
        "subEquations" : [ "Gi(x) = (1)/(pi)*integrate(sin(((t)**(3))/(3)+ x*t), (t, 0, oo))" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "Gi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\cpi" : "Pi was translated to: pi",
          "\\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" : "Gi(x) = (1)/(Pi)*int(sin(((t)^(3))/(3)+ x*t), t = 0..infinity)",
      "translationInformation" : {
        "subEquations" : [ "Gi(x) = (1)/(Pi)*int(sin(((t)^(3))/(3)+ x*t), t = 0..infinity)" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "Gi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\cpi" : "Pi was translated to: Pi",
          "\\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" : [ "0^", "^3}{3} +", "\\mathrm{Gi}(x) = \\frac{1}{\\pi} \\int_0^\\infty \\sin\\left(\\frac{t^3}{3} + xt\\right)\\, dt" ],
  "isPartOf" : [ "\\mathrm{Gi}(x) = \\frac{1}{\\pi} \\int_0^\\infty \\sin\\left(\\frac{t^3}{3} + xt\\right)\\, dt" ],
  "definiens" : [ ]
}

Specify your own input