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

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

Semantic latex: \ScorerHi@{x} = \frac{1}{\cpi} \int_0^\infty \exp(- \frac{t^3}{3} + xt) \diff{t}

Confidence: 0.67405357142857

Mathematica

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

Information

Sub Equations

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

Free variables

  • x

Symbol info

  • Exponential function; Example: \exp@@{z}

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

  • Pi was translated to: Pi
  • Scorer function Hi; Example: \ScorerHi@{z}

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

Tests

Symbolic

Test expression: (ScorerHi[x])-(Divide[1,Pi]*Integrate[Exp[-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:

Information

Symbol info

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

Tests

Symbolic
Numeric

Maple

Translation: AiryBi(x)*(int(AiryAi(t), t = -infinity .. (x)))-AiryAi(x)*(int(AiryBi(t), t = -infinity .. (x))) = (1)/(Pi)*int(exp(-((t)^(3))/(3)+ x*t), t = 0..infinity)

Information

Sub Equations

  • AiryBi(x)*(int(AiryAi(t), t = -infinity .. (x)))-AiryAi(x)*(int(AiryBi(t), t = -infinity .. (x))) = (1)/(Pi)*int(exp(-((t)^(3))/(3)+ x*t), t = 0..infinity)

Free variables

  • x

Symbol info

  • Exponential function; Example: \exp@@{z}

Will be translated to: exp($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.2#E19 Maple: https://www.maplesoft.com/support/help/Maple/view.aspx?path=LinearAlgebra/Trace

  • Pi was translated to: Pi
  • Scorer function Hi; Example: \ScorerHi@{z}

Will be translated to: Alternative translations: [AiryBi($0)*(int(AiryAi(t), t = -infinity .. ($0)))-AiryAi($0)*(int(AiryBi(t), t = -infinity .. ($0)))]Relevant links to definitions: DLMF: http://dlmf.nist.gov/9.12#i Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Airy

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Is part of

Complete translation information:

{
  "id" : "FORMULA_7bf3763d35d4779768130fd4a1917719",
  "formula" : "\\mathrm{Hi}(x) = \\frac{1}{\\pi} \\int_0^\\infty \\exp\\left(-\\frac{t^3}{3} + xt\\right) dt",
  "semanticFormula" : "\\ScorerHi@{x} = \\frac{1}{\\cpi} \\int_0^\\infty \\exp(- \\frac{t^3}{3} + xt) \\diff{t}",
  "confidence" : 0.6740535714285714,
  "translations" : {
    "Mathematica" : {
      "translation" : "ScorerHi[x] == Divide[1,Pi]*Integrate[Exp[-Divide[(t)^(3),3]+ x*t], {t, 0, Infinity}, GenerateConditions->None]",
      "translationInformation" : {
        "subEquations" : [ "ScorerHi[x] = Divide[1,Pi]*Integrate[Exp[-Divide[(t)^(3),3]+ x*t], {t, 0, Infinity}, GenerateConditions->None]" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "\\exp" : "Exponential function; Example: \\exp@@{z}\nWill be translated to: Exp[$0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/4.2#E19\nMathematica:  https://reference.wolfram.com/language/ref/Exp.html",
          "\\cpi" : "Pi was translated to: Pi",
          "\\ScorerHi" : "Scorer function Hi; Example: \\ScorerHi@{z}\nWill be translated to: ScorerHi[$0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/9.12#i\nMathematica:  https://reference.wolfram.com/language/ref/ScorerHi.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" : "ScorerHi[x]",
          "rhs" : "Divide[1,Pi]*Integrate[Exp[-Divide[(t)^(3),3]+ x*t], {t, 0, Infinity}, GenerateConditions->None]",
          "testExpression" : "(ScorerHi[x])-(Divide[1,Pi]*Integrate[Exp[-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" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \\ScorerHi [\\ScorerHi]"
        }
      }
    },
    "Maple" : {
      "translation" : "AiryBi(x)*(int(AiryAi(t), t = -infinity .. (x)))-AiryAi(x)*(int(AiryBi(t), t = -infinity .. (x))) = (1)/(Pi)*int(exp(-((t)^(3))/(3)+ x*t), t = 0..infinity)",
      "translationInformation" : {
        "subEquations" : [ "AiryBi(x)*(int(AiryAi(t), t = -infinity .. (x)))-AiryAi(x)*(int(AiryBi(t), t = -infinity .. (x))) = (1)/(Pi)*int(exp(-((t)^(3))/(3)+ x*t), t = 0..infinity)" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "\\exp" : "Exponential function; Example: \\exp@@{z}\nWill be translated to: exp($0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/4.2#E19\nMaple: https://www.maplesoft.com/support/help/Maple/view.aspx?path=LinearAlgebra/Trace",
          "\\cpi" : "Pi was translated to: Pi",
          "\\ScorerHi" : "Scorer function Hi; Example: \\ScorerHi@{z}\nWill be translated to: \nAlternative translations: [AiryBi($0)*(int(AiryAi(t), t = -infinity .. ($0)))-AiryAi($0)*(int(AiryBi(t), t = -infinity .. ($0)))]Relevant links to definitions:\nDLMF:  http://dlmf.nist.gov/9.12#i\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Airy"
        }
      }
    }
  },
  "positions" : [ ],
  "includes" : [ "x", "\\mathrm{Hi}(x) = \\frac{1}{\\pi} \\int_0^\\infty \\exp\\left(-\\frac{t^3}{3} + xt\\right)\\, dt", "x)" ],
  "isPartOf" : [ "\\mathrm{Hi}(x) = \\frac{1}{\\pi} \\int_0^\\infty \\exp\\left(-\\frac{t^3}{3} + xt\\right)\\, dt" ],
  "definiens" : [ ]
}

Specify your own input