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 \frac{1}{|\mathbf{x}-\mathbf{y}|^{n-2}} = \sum_{k=0}^\infty \frac{|\mathbf{x}|^k}{|\mathbf{y}|^{k+n-2}}C_k^{(\alpha)}(\mathbf{x}\cdot \mathbf{y}).}
... is translated to the CAS output ...
Semantic latex: \frac{1}{\abs{\mathbf{x} - \mathbf{y}}^{n-2}} = \sum_{k=0}^\infty \frac{\abs{\mathbf{x}}^k}{\abs{\mathbf{y}}^{k+n-2}} \ultrasphpoly{\alpha}{k}@{\mathbf{x} \cdot \mathbf{y}}
Confidence: 0.6805
Mathematica
Translation: Divide[1,(Abs[x - y])^(n - 2)] == Sum[Divide[(Abs[x])^(k),(Abs[y])^(k + n - 2)]*GegenbauerC[k, \[Alpha], x * y], {k, 0, Infinity}, GenerateConditions->None]
Information
Sub Equations
- Divide[1,(Abs[x - y])^(n - 2)] = Sum[Divide[(Abs[x])^(k),(Abs[y])^(k + n - 2)]*GegenbauerC[k, \[Alpha], x * y], {k, 0, Infinity}, GenerateConditions->None]
Free variables
- \[Alpha]
- n
- x
- y
Symbol info
- 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
- was translated to: *
- 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.
- Absolute Value; Example: \abs
Will be translated to: Abs[$0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.9#E7 Mathematica: https://reference.wolfram.com/language/ref/Abs.html
Tests
Symbolic
Test expression: (Divide[1,(Abs[x - y])^(n - 2)])-(Sum[Divide[(Abs[x])^(k),(Abs[y])^(k + n - 2)]*GegenbauerC[k, \[Alpha], x * y], {k, 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: \abs [\abs]
Tests
Symbolic
Numeric
Maple
Translation: (1)/((abs(x - y))^(n - 2)) = sum(((abs(x))^(k))/((abs(y))^(k + n - 2))*GegenbauerC(k, alpha, x * y), k = 0..infinity)
Information
Sub Equations
- (1)/((abs(x - y))^(n - 2)) = sum(((abs(x))^(k))/((abs(y))^(k + n - 2))*GegenbauerC(k, alpha, x * y), k = 0..infinity)
Free variables
- alpha
- n
- x
- y
Symbol info
- 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
- was translated to: *
- 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.
- Absolute Value; Example: \abs
Will be translated to: abs($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.9#E7 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=abs
Tests
Symbolic
Numeric
Dependency Graph Information
Includes
Description
- expansion
- Newtonian potential
Complete translation information:
{
"id" : "FORMULA_9d98f1f7e6b6d48e353924690c7fde97",
"formula" : "\\frac{1}{|\\mathbf{x}-\\mathbf{y}|^{n-2}} = \\sum_{k=0}^\\infty \\frac{|\\mathbf{x}|^k}{|\\mathbf{y}|^{k+n-2}}C_k^{(\\alpha)}(\\mathbf{x}\\cdot \\mathbf{y})",
"semanticFormula" : "\\frac{1}{\\abs{\\mathbf{x} - \\mathbf{y}}^{n-2}} = \\sum_{k=0}^\\infty \\frac{\\abs{\\mathbf{x}}^k}{\\abs{\\mathbf{y}}^{k+n-2}} \\ultrasphpoly{\\alpha}{k}@{\\mathbf{x} \\cdot \\mathbf{y}}",
"confidence" : 0.6805,
"translations" : {
"Mathematica" : {
"translation" : "Divide[1,(Abs[x - y])^(n - 2)] == Sum[Divide[(Abs[x])^(k),(Abs[y])^(k + n - 2)]*GegenbauerC[k, \\[Alpha], x * y], {k, 0, Infinity}, GenerateConditions->None]",
"translationInformation" : {
"subEquations" : [ "Divide[1,(Abs[x - y])^(n - 2)] = Sum[Divide[(Abs[x])^(k),(Abs[y])^(k + n - 2)]*GegenbauerC[k, \\[Alpha], x * y], {k, 0, Infinity}, GenerateConditions->None]" ],
"freeVariables" : [ "\\[Alpha]", "n", "x", "y" ],
"tokenTranslations" : {
"\\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",
"\\cdot" : "was translated to: *",
"\\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",
"\\abs" : "Absolute Value; Example: \\abs\nWill be translated to: Abs[$0]\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/1.9#E7\nMathematica: https://reference.wolfram.com/language/ref/Abs.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,(Abs[x - y])^(n - 2)]",
"rhs" : "Sum[Divide[(Abs[x])^(k),(Abs[y])^(k + n - 2)]*GegenbauerC[k, \\[Alpha], x * y], {k, 0, Infinity}, GenerateConditions->None]",
"testExpression" : "(Divide[1,(Abs[x - y])^(n - 2)])-(Sum[Divide[(Abs[x])^(k),(Abs[y])^(k + n - 2)]*GegenbauerC[k, \\[Alpha], x * y], {k, 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: \\abs [\\abs]"
}
}
},
"Maple" : {
"translation" : "(1)/((abs(x - y))^(n - 2)) = sum(((abs(x))^(k))/((abs(y))^(k + n - 2))*GegenbauerC(k, alpha, x * y), k = 0..infinity)",
"translationInformation" : {
"subEquations" : [ "(1)/((abs(x - y))^(n - 2)) = sum(((abs(x))^(k))/((abs(y))^(k + n - 2))*GegenbauerC(k, alpha, x * y), k = 0..infinity)" ],
"freeVariables" : [ "alpha", "n", "x", "y" ],
"tokenTranslations" : {
"\\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",
"\\cdot" : "was translated to: *",
"\\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",
"\\abs" : "Absolute Value; Example: \\abs\nWill be translated to: abs($0)\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/1.9#E7\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=abs"
}
}
}
},
"positions" : [ {
"section" : 3,
"sentence" : 1,
"word" : 13
} ],
"includes" : [ "C_{n}^{(\\alpha)}(x)", "\\alpha", "n", "\\mathbf{x}" ],
"isPartOf" : [ ],
"definiens" : [ {
"definition" : "expansion",
"score" : 0.6460746792928004
}, {
"definition" : "Newtonian potential",
"score" : 0.5500952380952381
} ]
}