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 \frac{1}{(1-2xt+t^2)^\alpha}=\sum_{n=0}^\infty C_n^{(\alpha)}(x) t^n.}

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

Semantic latex: \frac{1}{(1-2xt+t^2)^\alpha} = \sum_{n=0}^\infty \ultrasphpoly{\alpha}{n}@{x} t^n

Confidence: 0.6805

Mathematica

Translation: Divide[1,(1 - 2*x*t + (t)^(2))^\[Alpha]] == Sum[GegenbauerC[n, \[Alpha], x]*(t)^(n), {n, 0, Infinity}, GenerateConditions->None]

Information

Sub Equations

  • Divide[1,(1 - 2*x*t + (t)^(2))^\[Alpha]] = Sum[GegenbauerC[n, \[Alpha], x]*(t)^(n), {n, 0, Infinity}, GenerateConditions->None]

Free variables

  • \[Alpha]
  • t
  • x

Symbol info

  • Could be the second Feigenbaum constant.

But this system doesn't know how to translate it as a constant. It was translated as a general letter.

  • Ultraspherical Gegenbauer polynomial; Example: \ultrasphpoly{\lambda}{n}@{x}

Will be translated to: GegenbauerC[$1, $0, $2] Relevant links to definitions: DLMF: http://dlmf.nist.gov/18.3#T1.t1.r3 Mathematica: https://reference.wolfram.com/language/ref/GegenbauerC.html

Tests

Symbolic

Test expression: (Divide[1,(1 - 2*x*t + (t)^(2))^\[Alpha]])-(Sum[GegenbauerC[n, \[Alpha], x]*(t)^(n), {n, 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: \ultrasphpoly [\ultrasphpoly]

Tests

Symbolic
Numeric

Maple

Translation: (1)/((1 - 2*x*t + (t)^(2))^(alpha)) = sum(GegenbauerC(n, alpha, x)*(t)^(n), n = 0..infinity)

Information

Sub Equations

  • (1)/((1 - 2*x*t + (t)^(2))^(alpha)) = sum(GegenbauerC(n, alpha, x)*(t)^(n), n = 0..infinity)

Free variables

  • alpha
  • t
  • x

Symbol info

  • Could be the second Feigenbaum constant.

But this system doesn't know how to translate it as a constant. It was translated as a general letter.

  • Ultraspherical Gegenbauer polynomial; Example: \ultrasphpoly{\lambda}{n}@{x}

Will be translated to: GegenbauerC($1, $0, $2) Relevant links to definitions: DLMF: http://dlmf.nist.gov/18.3#T1.t1.r3 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=GegenbauerC

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • term
  • function
  • polynomial

Complete translation information:

{
  "id" : "FORMULA_d5c06dec4eda047cbeb93360a4340771",
  "formula" : "\\frac{1}{(1-2xt+t^2)^\\alpha}=\\sum_{n=0}^\\infty C_n^{(\\alpha)}(x) t^n",
  "semanticFormula" : "\\frac{1}{(1-2xt+t^2)^\\alpha} = \\sum_{n=0}^\\infty \\ultrasphpoly{\\alpha}{n}@{x} t^n",
  "confidence" : 0.6805,
  "translations" : {
    "Mathematica" : {
      "translation" : "Divide[1,(1 - 2*x*t + (t)^(2))^\\[Alpha]] == Sum[GegenbauerC[n, \\[Alpha], x]*(t)^(n), {n, 0, Infinity}, GenerateConditions->None]",
      "translationInformation" : {
        "subEquations" : [ "Divide[1,(1 - 2*x*t + (t)^(2))^\\[Alpha]] = Sum[GegenbauerC[n, \\[Alpha], x]*(t)^(n), {n, 0, Infinity}, GenerateConditions->None]" ],
        "freeVariables" : [ "\\[Alpha]", "t", "x" ],
        "tokenTranslations" : {
          "\\alpha" : "Could be the second Feigenbaum constant.\nBut this system doesn't know how to translate it as a constant. It was translated as a general letter.\n",
          "\\ultrasphpoly" : "Ultraspherical Gegenbauer polynomial; Example: \\ultrasphpoly{\\lambda}{n}@{x}\nWill be translated to: GegenbauerC[$1, $0, $2]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/18.3#T1.t1.r3\nMathematica:  https://reference.wolfram.com/language/ref/GegenbauerC.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" : "Divide[1,(1 - 2*x*t + (t)^(2))^\\[Alpha]]",
          "rhs" : "Sum[GegenbauerC[n, \\[Alpha], x]*(t)^(n), {n, 0, Infinity}, GenerateConditions->None]",
          "testExpression" : "(Divide[1,(1 - 2*x*t + (t)^(2))^\\[Alpha]])-(Sum[GegenbauerC[n, \\[Alpha], x]*(t)^(n), {n, 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: \\ultrasphpoly [\\ultrasphpoly]"
        }
      }
    },
    "Maple" : {
      "translation" : "(1)/((1 - 2*x*t + (t)^(2))^(alpha)) = sum(GegenbauerC(n, alpha, x)*(t)^(n), n = 0..infinity)",
      "translationInformation" : {
        "subEquations" : [ "(1)/((1 - 2*x*t + (t)^(2))^(alpha)) = sum(GegenbauerC(n, alpha, x)*(t)^(n), n = 0..infinity)" ],
        "freeVariables" : [ "alpha", "t", "x" ],
        "tokenTranslations" : {
          "\\alpha" : "Could be the second Feigenbaum constant.\nBut this system doesn't know how to translate it as a constant. It was translated as a general letter.\n",
          "\\ultrasphpoly" : "Ultraspherical Gegenbauer polynomial; Example: \\ultrasphpoly{\\lambda}{n}@{x}\nWill be translated to: GegenbauerC($1, $0, $2)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/18.3#T1.t1.r3\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=GegenbauerC"
        }
      }
    }
  },
  "positions" : [ {
    "section" : 1,
    "sentence" : 2,
    "word" : 12
  } ],
  "includes" : [ "\\alpha", "C_{n}^{(\\alpha)}(x)", "n", "\\mathbf{R}^{n}" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "term",
    "score" : 0.7125985104912714
  }, {
    "definition" : "function",
    "score" : 0.6859086196238077
  }, {
    "definition" : "polynomial",
    "score" : 0.6460746792928004
  } ]
}

Specify your own input