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 P_n^{(\alpha, \beta)} (1) = {n+\alpha\choose n}.}
... is translated to the CAS output ...
Semantic latex: \JacobipolyP{\alpha}{\beta}{n}@{1} ={n+\alpha\choose n}
Confidence: 0.70338171203013
Mathematica
Translation: JacobiP[n, \[Alpha], \[Beta], 1] == Binomial[n + \[Alpha],n]
Information
Sub Equations
- JacobiP[n, \[Alpha], \[Beta], 1] = Binomial[n + \[Alpha],n]
Free variables
- \[Alpha]
- \[Beta]
- n
Symbol info
- Jacobi polynomial; Example: \JacobipolyP{\alpha}{\beta}{n}@{x}
Will be translated to: JacobiP[$2, $0, $1, $3] Relevant links to definitions: DLMF: http://dlmf.nist.gov/18.3#T1.t1.r2 Mathematica: https://reference.wolfram.com/language/ref/JacobiP.html?q=JacobiP
- 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.
Tests
Symbolic
Test expression: (JacobiP[n, \[Alpha], \[Beta], 1])-(Binomial[n + \[Alpha],n])
ERROR:
{
"result": "ERROR",
"testTitle": "Simple",
"testExpression": null,
"resultExpression": null,
"wasAborted": false,
"conditionallySuccessful": false
}
Numeric
SymPy
Translation: jacobi(n, Symbol('alpha'), Symbol('beta'), 1) == binomial(n + Symbol('alpha'),n)
Information
Sub Equations
- jacobi(n, Symbol('alpha'), Symbol('beta'), 1) = binomial(n + Symbol('alpha'),n)
Free variables
- Symbol('alpha')
- Symbol('beta')
- n
Symbol info
- Jacobi polynomial; Example: \JacobipolyP{\alpha}{\beta}{n}@{x}
Will be translated to: jacobi($2, $0, $1, $3) Relevant links to definitions: DLMF: http://dlmf.nist.gov/18.3#T1.t1.r2 SymPy: https://docs.sympy.org/latest/modules/functions/special.html#jacobi-polynomials
- 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.
Tests
Symbolic
Numeric
Maple
Translation: JacobiP(n, alpha, beta, 1) = binomial(n + alpha,n)
Information
Sub Equations
- JacobiP(n, alpha, beta, 1) = binomial(n + alpha,n)
Free variables
- alpha
- beta
- n
Symbol info
- Jacobi polynomial; Example: \JacobipolyP{\alpha}{\beta}{n}@{x}
Will be translated to: JacobiP($2, $0, $1, $3) Relevant links to definitions: DLMF: http://dlmf.nist.gov/18.3#T1.t1.r2 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=JacobiP
- 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.
Tests
Symbolic
Numeric
Dependency Graph Information
Includes
Description
- simplicity
- alternative normalization
- orthonormal basis
Complete translation information:
{
"id" : "FORMULA_885c4cc0c4b31f8e336b9b90a9f5a73a",
"formula" : "P_n^{(\\alpha, \\beta)} (1) = {n+\\alpha\\choose n}",
"semanticFormula" : "\\JacobipolyP{\\alpha}{\\beta}{n}@{1} ={n+\\alpha\\choose n}",
"confidence" : 0.7033817120301267,
"translations" : {
"Mathematica" : {
"translation" : "JacobiP[n, \\[Alpha], \\[Beta], 1] == Binomial[n + \\[Alpha],n]",
"translationInformation" : {
"subEquations" : [ "JacobiP[n, \\[Alpha], \\[Beta], 1] = Binomial[n + \\[Alpha],n]" ],
"freeVariables" : [ "\\[Alpha]", "\\[Beta]", "n" ],
"tokenTranslations" : {
"\\JacobipolyP" : "Jacobi polynomial; Example: \\JacobipolyP{\\alpha}{\\beta}{n}@{x}\nWill be translated to: JacobiP[$2, $0, $1, $3]\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/18.3#T1.t1.r2\nMathematica: https://reference.wolfram.com/language/ref/JacobiP.html?q=JacobiP",
"\\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"
}
},
"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" : "JacobiP[n, \\[Alpha], \\[Beta], 1]",
"rhs" : "Binomial[n + \\[Alpha],n]",
"testExpression" : "(JacobiP[n, \\[Alpha], \\[Beta], 1])-(Binomial[n + \\[Alpha],n])",
"testCalculations" : [ {
"result" : "ERROR",
"testTitle" : "Simple",
"testExpression" : null,
"resultExpression" : null,
"wasAborted" : false,
"conditionallySuccessful" : false
} ]
} ]
}
},
"SymPy" : {
"translation" : "jacobi(n, Symbol('alpha'), Symbol('beta'), 1) == binomial(n + Symbol('alpha'),n)",
"translationInformation" : {
"subEquations" : [ "jacobi(n, Symbol('alpha'), Symbol('beta'), 1) = binomial(n + Symbol('alpha'),n)" ],
"freeVariables" : [ "Symbol('alpha')", "Symbol('beta')", "n" ],
"tokenTranslations" : {
"\\JacobipolyP" : "Jacobi polynomial; Example: \\JacobipolyP{\\alpha}{\\beta}{n}@{x}\nWill be translated to: jacobi($2, $0, $1, $3)\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/18.3#T1.t1.r2\nSymPy: https://docs.sympy.org/latest/modules/functions/special.html#jacobi-polynomials",
"\\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"
}
}
},
"Maple" : {
"translation" : "JacobiP(n, alpha, beta, 1) = binomial(n + alpha,n)",
"translationInformation" : {
"subEquations" : [ "JacobiP(n, alpha, beta, 1) = binomial(n + alpha,n)" ],
"freeVariables" : [ "alpha", "beta", "n" ],
"tokenTranslations" : {
"\\JacobipolyP" : "Jacobi polynomial; Example: \\JacobipolyP{\\alpha}{\\beta}{n}@{x}\nWill be translated to: JacobiP($2, $0, $1, $3)\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/18.3#T1.t1.r2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=JacobiP",
"\\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"
}
}
}
},
"positions" : [ {
"section" : 5,
"sentence" : 3,
"word" : 20
} ],
"includes" : [ "P_{n}^{(\\alpha, \\beta)}(x)", "n", "P_{n}^{(\\alpha, \\beta)}", "\\alpha,\\beta" ],
"isPartOf" : [ ],
"definiens" : [ {
"definition" : "simplicity",
"score" : 0.7125985104912714
}, {
"definition" : "alternative normalization",
"score" : 0.6460746792928004
}, {
"definition" : "orthonormal basis",
"score" : 0.5988174995334326
} ]
}