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

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

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

Confidence: 0

Mathematica

Translation: Subscript[f, 1][x] == 1 + Sum[Divide[Cos[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[f, 1][x] = 1 + Sum[Divide[Cos[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

  • Cosine; Example: \cos@@{z}

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

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Pi was translated to: Pi

Tests

Symbolic
Numeric

SymPy

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

Information

Sub Equations

  • Symbol('{f}_{1}')(x) = 1 + Sum((cos(k*pi/4))/(factorial(k)*(8*x)**(k))*Product((2*l - 1)**(2), (l, 1, k)), (k, 1, oo))

Free variables

  • x

Symbol info

  • Cosine; Example: \cos@@{z}

Will be translated to: cos($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.14#E2 SymPy: https://docs.sympy.org/latest/modules/functions/elementary.html#cos

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Pi was translated to: pi

Tests

Symbolic
Numeric

Maple

Translation: f[1](x) = 1 + sum((cos(k*Pi/4))/(factorial(k)*(8*x)^(k))*product((2*l - 1)^(2), l = 1..k), k = 1..infinity)

Information

Sub Equations

  • f[1](x) = 1 + sum((cos(k*Pi/4))/(factorial(k)*(8*x)^(k))*product((2*l - 1)^(2), l = 1..k), k = 1..infinity)

Free variables

  • x

Symbol info

  • Cosine; Example: \cos@@{z}

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

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Pi was translated to: Pi

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • series expansion
  • special case
  • asymptotic series

Complete translation information:

{
  "id" : "FORMULA_fd205932472039b407dcb6c3c1c689a5",
  "formula" : "f_1(x) = 1 + \\sum_{k \\geq 1} \\frac{\\cos(k \\pi / 4)}{k! (8x)^k} \\prod_{l = 1}^k (2l - 1)^2",
  "semanticFormula" : "f_1(x) = 1 + \\sum_{k \\geq 1} \\frac{\\cos(k \\cpi / 4)}{k! (8x)^k} \\prod_{l = 1}^k(2 l - 1)^2",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "Subscript[f, 1][x] == 1 + Sum[Divide[Cos[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[f, 1][x] = 1 + Sum[Divide[Cos[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" : {
          "\\cos" : "Cosine; Example: \\cos@@{z}\nWill be translated to: Cos[$0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/4.14#E2\nMathematica:  https://reference.wolfram.com/language/ref/Cos.html",
          "f" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\cpi" : "Pi was translated to: Pi"
        }
      },
      "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('{f}_{1}')(x) == 1 + Sum((cos(k*pi/4))/(factorial(k)*(8*x)**(k))*Product((2*l - 1)**(2), (l, 1, k)), (k, 1, oo))",
      "translationInformation" : {
        "subEquations" : [ "Symbol('{f}_{1}')(x) = 1 + Sum((cos(k*pi/4))/(factorial(k)*(8*x)**(k))*Product((2*l - 1)**(2), (l, 1, k)), (k, 1, oo))" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "\\cos" : "Cosine; Example: \\cos@@{z}\nWill be translated to: cos($0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/4.14#E2\nSymPy: https://docs.sympy.org/latest/modules/functions/elementary.html#cos",
          "f" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\cpi" : "Pi was translated to: pi"
        }
      },
      "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" : "f[1](x) = 1 + sum((cos(k*Pi/4))/(factorial(k)*(8*x)^(k))*product((2*l - 1)^(2), l = 1..k), k = 1..infinity)",
      "translationInformation" : {
        "subEquations" : [ "f[1](x) = 1 + sum((cos(k*Pi/4))/(factorial(k)*(8*x)^(k))*product((2*l - 1)^(2), l = 1..k), k = 1..infinity)" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "\\cos" : "Cosine; Example: \\cos@@{z}\nWill be translated to: cos($0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/4.14#E2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=cos",
          "f" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\cpi" : "Pi was translated to: Pi"
        }
      },
      "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" : 1,
    "sentence" : 1,
    "word" : 27
  } ],
  "includes" : [ "x", "x)", "f_1(x)" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "series expansion",
    "score" : 0.6460746792928004
  }, {
    "definition" : "special case",
    "score" : 0.6460746792928004
  }, {
    "definition" : "asymptotic series",
    "score" : 0.5988174995334326
  } ]
}

Specify your own input