LaTeX to CAS translator
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_2(x) = 1 + \sum_{k \geq 1} (-1)^k \frac{\cos(k \pi / 4)}{k! (8x)^k} \prod_{l = 1}^k (2l - 1)^2}
... is translated to the CAS output ...
Semantic latex: f_2(x) = 1 + \sum_{k \geq 1}(- 1)^k \frac{\cos(k \cpi / 4)}{k! (8x)^k} \prod_{l = 1}^k(2 l - 1)^2
Confidence: 0
Mathematica
Translation: Subscript[f, 2][x] == 1 + Sum[(- 1)^(k)*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, 2][x] = 1 + Sum[(- 1)^(k)*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}_{2}')(x) == 1 + Sum((- 1)**(k)*(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}_{2}')(x) = 1 + Sum((- 1)**(k)*(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[2](x) = 1 + sum((- 1)^(k)*(cos(k*Pi/4))/(factorial(k)*(8*x)^(k))*product((2*l - 1)^(2), l = 1..k), k = 1..infinity)
Information
Sub Equations
- f[2](x) = 1 + sum((- 1)^(k)*(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 ker
- asymptotic series
- integer
- ker
Complete translation information:
{
"id" : "FORMULA_6fdd18ae8fdde9ac279e8353bd069be7",
"formula" : "f_2(x) = 1 + \\sum_{k \\geq 1} (-1)^k \\frac{\\cos(k \\pi / 4)}{k! (8x)^k} \\prod_{l = 1}^k (2l - 1)^2",
"semanticFormula" : "f_2(x) = 1 + \\sum_{k \\geq 1}(- 1)^k \\frac{\\cos(k \\cpi / 4)}{k! (8x)^k} \\prod_{l = 1}^k(2 l - 1)^2",
"confidence" : 0.0,
"translations" : {
"Mathematica" : {
"translation" : "Subscript[f, 2][x] == 1 + Sum[(- 1)^(k)*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, 2][x] = 1 + Sum[(- 1)^(k)*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}_{2}')(x) == 1 + Sum((- 1)**(k)*(cos(k*pi/4))/(factorial(k)*(8*x)**(k))*Product((2*l - 1)**(2), (l, 1, k)), (k, 1, oo))",
"translationInformation" : {
"subEquations" : [ "Symbol('{f}_{2}')(x) = 1 + Sum((- 1)**(k)*(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[2](x) = 1 + sum((- 1)^(k)*(cos(k*Pi/4))/(factorial(k)*(8*x)^(k))*product((2*l - 1)^(2), l = 1..k), k = 1..infinity)",
"translationInformation" : {
"subEquations" : [ "f[2](x) = 1 + sum((- 1)^(k)*(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" : 3,
"sentence" : 0,
"word" : 42
} ],
"includes" : [ "x)", "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
} ]
}