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 g_2(x) = \sum_{k \geq 1} (-1)^k \frac{\sin(k \pi / 4)}{k! (8x)^k} \prod_{l = 1}^k (2l - 1)^2.}

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

Semantic latex: g_2(x) = \sum_{k \geq 1}(- 1)^k \frac{\sin(k \cpi / 4)}{k! (8x)^k} \prod_{l = 1}^k(2 l - 1)^2

Confidence: 0

Mathematica

Translation: Subscript[g, 2][x] == Sum[(- 1)^(k)*Divide[Sin[k*Pi/4],(k)!*(8*x)^(k)]*Product[(2*l - 1)^(2), {l, 1, k}, GenerateConditions->None], {k, 1, Infinity}, GenerateConditions->None]

Information

Sub Equations

  • Subscript[g, 2][x] = Sum[(- 1)^(k)*Divide[Sin[k*Pi/4],(k)!*(8*x)^(k)]*Product[(2*l - 1)^(2), {l, 1, k}, GenerateConditions->None], {k, 1, 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
Numeric

SymPy

Translation: Symbol('{g}_{2}')(x) == Sum((- 1)**(k)*(sin(k*pi/4))/(factorial(k)*(8*x)**(k))*Product((2*l - 1)**(2), (l, 1, k)), (k, 1, oo))

Information

Sub Equations

  • Symbol('{g}_{2}')(x) = Sum((- 1)**(k)*(sin(k*pi/4))/(factorial(k)*(8*x)**(k))*Product((2*l - 1)**(2), (l, 1, k)), (k, 1, 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: g[2](x) = sum((- 1)^(k)*(sin(k*Pi/4))/(factorial(k)*(8*x)^(k))*product((2*l - 1)^(2), l = 1..k), k = 1..infinity)

Information

Sub Equations

  • g[2](x) = sum((- 1)^(k)*(sin(k*Pi/4))/(factorial(k)*(8*x)^(k))*product((2*l - 1)^(2), l = 1..k), k = 1..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

Description

  • series expansion
  • special case ker
  • asymptotic series
  • integer
  • ker

Complete translation information:

{
  "id" : "FORMULA_7d924e0090474057e28f17b85499c57a",
  "formula" : "g_2(x) = \\sum_{k \\geq 1} (-1)^k \\frac{\\sin(k \\pi / 4)}{k! (8x)^k} \\prod_{l = 1}^k (2l - 1)^2",
  "semanticFormula" : "g_2(x) = \\sum_{k \\geq 1}(- 1)^k \\frac{\\sin(k \\cpi / 4)}{k! (8x)^k} \\prod_{l = 1}^k(2 l - 1)^2",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "Subscript[g, 2][x] == Sum[(- 1)^(k)*Divide[Sin[k*Pi/4],(k)!*(8*x)^(k)]*Product[(2*l - 1)^(2), {l, 1, k}, GenerateConditions->None], {k, 1, Infinity}, GenerateConditions->None]",
      "translationInformation" : {
        "subEquations" : [ "Subscript[g, 2][x] = Sum[(- 1)^(k)*Divide[Sin[k*Pi/4],(k)!*(8*x)^(k)]*Product[(2*l - 1)^(2), {l, 1, k}, GenerateConditions->None], {k, 1, Infinity}, GenerateConditions->None]" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "g" : "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" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    },
    "SymPy" : {
      "translation" : "Symbol('{g}_{2}')(x) == Sum((- 1)**(k)*(sin(k*pi/4))/(factorial(k)*(8*x)**(k))*Product((2*l - 1)**(2), (l, 1, k)), (k, 1, oo))",
      "translationInformation" : {
        "subEquations" : [ "Symbol('{g}_{2}')(x) = Sum((- 1)**(k)*(sin(k*pi/4))/(factorial(k)*(8*x)**(k))*Product((2*l - 1)**(2), (l, 1, k)), (k, 1, oo))" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "g" : "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"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    },
    "Maple" : {
      "translation" : "g[2](x) = sum((- 1)^(k)*(sin(k*Pi/4))/(factorial(k)*(8*x)^(k))*product((2*l - 1)^(2), l = 1..k), k = 1..infinity)",
      "translationInformation" : {
        "subEquations" : [ "g[2](x) = sum((- 1)^(k)*(sin(k*Pi/4))/(factorial(k)*(8*x)^(k))*product((2*l - 1)^(2), l = 1..k), k = 1..infinity)" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "g" : "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"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    }
  },
  "positions" : [ {
    "section" : 3,
    "sentence" : 0,
    "word" : 43
  } ],
  "includes" : [ "x)", "x", "g_{2}(x)" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "series expansion",
    "score" : 0.7244849196070415
  }, {
    "definition" : "special case ker",
    "score" : 0.6288842031023242
  }, {
    "definition" : "asymptotic series",
    "score" : 0.48771694939097315
  }, {
    "definition" : "integer",
    "score" : 0.48771694939097315
  }, {
    "definition" : "ker",
    "score" : 0.48771694939097315
  } ]
}

Specify your own input