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 C_n^{(\alpha)}(z)=\frac{(2\alpha)_n}{n!} \,_2F_1\left(-n,2\alpha+n;\alpha+\frac{1}{2};\frac{1-z}{2}\right).}
... is translated to the CAS output ...
Semantic latex: \ultrasphpoly{\alpha}{n}@{z} = \frac{\Pochhammersym{2 \alpha}{n}}{n!}_2 F_1(- n , 2 \alpha + n ; \alpha + \frac{1}{2} ; \frac{1-z}{2})
Confidence: 0.66915374128677
Mathematica
Translation: GegenbauerC[n, \[Alpha], z] == Subscript[Divide[Pochhammer[2*\[Alpha], n],(n)!], 2]*Subscript[F, 1][- n , 2*\[Alpha]+ n ; \[Alpha]+Divide[1,2];Divide[1 - z,2]]
Information
Sub Equations
- GegenbauerC[n, \[Alpha], z] = Subscript[Divide[Pochhammer[2*\[Alpha], n],(n)!], 2]*Subscript[F, 1][- n , 2*\[Alpha]+ n ; \[Alpha]+Divide[1,2];Divide[1 - z,2]]
Free variables
- \[Alpha]
- n
- z
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
- 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.
- Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
- Pochhammer symbol; Example: \Pochhammersym{a}{n}
Will be translated to: Pochhammer[$0, $1] Relevant links to definitions: DLMF: http://dlmf.nist.gov/5.2#iii Mathematica: https://reference.wolfram.com/language/ref/Pochhammer.html
Tests
Symbolic
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: GegenbauerC(n, alpha, z) = (pochhammer(2*alpha, n))/(factorial(n))[2]*F[1](- n , 2*alpha + n ; alpha +(1)/(2);(1 - z)/(2))
Information
Sub Equations
- GegenbauerC(n, alpha, z) = (pochhammer(2*alpha, n))/(factorial(n))[2]*F[1](- n , 2*alpha + n ; alpha +(1)/(2);(1 - z)/(2))
Free variables
- alpha
- n
- z
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
- 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.
- Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
- Pochhammer symbol; Example: \Pochhammersym{a}{n}
Will be translated to: pochhammer($0, $1) Relevant links to definitions: DLMF: http://dlmf.nist.gov/5.2#iii Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=pochhammer
Tests
Symbolic
Numeric
Dependency Graph Information
Includes
Is part of
Complete translation information:
{
"id" : "FORMULA_b8811d5fbcf75d82e2a1e94c84e6d386",
"formula" : "C_n^{(\\alpha)}(z)=\\frac{(2\\alpha)_n}{n!}\n_2F_1\\left(-n,2\\alpha+n;\\alpha+\\frac{1}{2};\\frac{1-z}{2}\\right)",
"semanticFormula" : "\\ultrasphpoly{\\alpha}{n}@{z} = \\frac{\\Pochhammersym{2 \\alpha}{n}}{n!}_2 F_1(- n , 2 \\alpha + n ; \\alpha + \\frac{1}{2} ; \\frac{1-z}{2})",
"confidence" : 0.6691537412867716,
"translations" : {
"Mathematica" : {
"translation" : "GegenbauerC[n, \\[Alpha], z] == Subscript[Divide[Pochhammer[2*\\[Alpha], n],(n)!], 2]*Subscript[F, 1][- n , 2*\\[Alpha]+ n ; \\[Alpha]+Divide[1,2];Divide[1 - z,2]]",
"translationInformation" : {
"subEquations" : [ "GegenbauerC[n, \\[Alpha], z] = Subscript[Divide[Pochhammer[2*\\[Alpha], n],(n)!], 2]*Subscript[F, 1][- n , 2*\\[Alpha]+ n ; \\[Alpha]+Divide[1,2];Divide[1 - z,2]]" ],
"freeVariables" : [ "\\[Alpha]", "n", "z" ],
"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",
"\\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",
"F" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
"\\Pochhammersym" : "Pochhammer symbol; Example: \\Pochhammersym{a}{n}\nWill be translated to: Pochhammer[$0, $1]\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/5.2#iii\nMathematica: https://reference.wolfram.com/language/ref/Pochhammer.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" : "",
"translationInformation" : {
"tokenTranslations" : {
"Error" : "(LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \\ultrasphpoly [\\ultrasphpoly]"
}
},
"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" : "GegenbauerC(n, alpha, z) = (pochhammer(2*alpha, n))/(factorial(n))[2]*F[1](- n , 2*alpha + n ; alpha +(1)/(2);(1 - z)/(2))",
"translationInformation" : {
"subEquations" : [ "GegenbauerC(n, alpha, z) = (pochhammer(2*alpha, n))/(factorial(n))[2]*F[1](- n , 2*alpha + n ; alpha +(1)/(2);(1 - z)/(2))" ],
"freeVariables" : [ "alpha", "n", "z" ],
"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",
"\\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",
"F" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
"\\Pochhammersym" : "Pochhammer symbol; Example: \\Pochhammersym{a}{n}\nWill be translated to: pochhammer($0, $1)\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/5.2#iii\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=pochhammer"
}
},
"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" : [ ],
"includes" : [ "C_{n}^{(\\alpha)}(x)", "\\alpha", "C_n^{(\\alpha)}(z)=\\frac{(2\\alpha)_n}{n!}\\,_2F_1\\left(-n,2\\alpha+n;\\alpha+\\frac{1}{2};\\frac{1-z}{2}\\right)", "n", "(2\\alpha)_{n}", "(\\theta)_n" ],
"isPartOf" : [ "C_n^{(\\alpha)}(z)=\\frac{(2\\alpha)_n}{n!}\\,_2F_1\\left(-n,2\\alpha+n;\\alpha+\\frac{1}{2};\\frac{1-z}{2}\\right)" ],
"definiens" : [ ]
}