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 \operatorname{Si}(x) = \int_0^x\frac{\sin t}{t}\,dt}

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

Semantic latex: \sinint@{x} = \int_0^x \frac{\sin t}{t} \diff{t}

Confidence: 0.66754720528951

Mathematica

Translation: SinIntegral[x] == Integrate[Divide[Sin[t],t], {t, 0, x}, GenerateConditions->None]

Information

Sub Equations

  • SinIntegral[x] = Integrate[Divide[Sin[t],t], {t, 0, x}, GenerateConditions->None]

Free variables

  • x

Symbol info

  • Sine integral; Example: \sinint@{z}

Will be translated to: SinIntegral[$0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/6.2#E9 Mathematica: https://reference.wolfram.com/language/ref/SinIntegral.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: (SinIntegral[x])-(Integrate[Divide[Sin[t],t], {t, 0, x}, GenerateConditions->None])

ERROR:

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

SymPy

Translation:

Information

Symbol info

  • (LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \sinint [\sinint]

Tests

Symbolic
Numeric

Maple

Translation: Si(x) = int((sin(t))/(t), t = 0..x)

Information

Sub Equations

  • Si(x) = int((sin(t))/(t), t = 0..x)

Free variables

  • x

Symbol info

  • Sine integral; Example: \sinint@{z}

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

  • 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_de947dc71ccc069d88ed6fedef4d1343",
  "formula" : "\\operatorname{Si}(x) = \\int_0^x\\frac{\\sin t}{t}dt",
  "semanticFormula" : "\\sinint@{x} = \\int_0^x \\frac{\\sin t}{t} \\diff{t}",
  "confidence" : 0.6675472052895071,
  "translations" : {
    "Mathematica" : {
      "translation" : "SinIntegral[x] == Integrate[Divide[Sin[t],t], {t, 0, x}, GenerateConditions->None]",
      "translationInformation" : {
        "subEquations" : [ "SinIntegral[x] = Integrate[Divide[Sin[t],t], {t, 0, x}, GenerateConditions->None]" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "\\sinint" : "Sine integral; Example: \\sinint@{z}\nWill be translated to: SinIntegral[$0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/6.2#E9\nMathematica:  https://reference.wolfram.com/language/ref/SinIntegral.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" : 1,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 1,
        "crashed" : false,
        "testCalculationsGroup" : [ {
          "lhs" : "SinIntegral[x]",
          "rhs" : "Integrate[Divide[Sin[t],t], {t, 0, x}, GenerateConditions->None]",
          "testExpression" : "(SinIntegral[x])-(Integrate[Divide[Sin[t],t], {t, 0, x}, GenerateConditions->None])",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        } ]
      }
    },
    "SymPy" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \\sinint [\\sinint]"
        }
      }
    },
    "Maple" : {
      "translation" : "Si(x) = int((sin(t))/(t), t = 0..x)",
      "translationInformation" : {
        "subEquations" : [ "Si(x) = int((sin(t))/(t), t = 0..x)" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "\\sinint" : "Sine integral; Example: \\sinint@{z}\nWill be translated to: Si($0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/6.2#E9\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Si",
          "\\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" : [ "\\operatorname{Si}(x) = \\int_0^x\\frac{\\sin t}{t}\\,dt", "Si", "x", "Si(x)" ],
  "isPartOf" : [ "\\operatorname{Si}(x) = \\int_0^x\\frac{\\sin t}{t}\\,dt" ],
  "definiens" : [ ]
}

Specify your own input