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 \cos(\theta) = -2m_3 / (2l_3 + 1)}
... is translated to the CAS output ...
Semantic latex: \cos(\theta) = -2m_3 / (2l_3 + 1)
Confidence: 0
Mathematica
Translation: Cos[(\[Theta]) ] == - 2*Subscript[m, 3]/(2*Subscript[l, 3]+ 1)
Information
Sub Equations
- Cos[(\[Theta]) ] = - 2*Subscript[m, 3]/(2*Subscript[l, 3]+ 1)
Free variables
- Subscript[l, 3]
- Subscript[m, 3]
- \[Theta]
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
Tests
Symbolic
Numeric
SymPy
Translation: cos((Symbol('theta')) ) == - 2*Symbol('{m}_{3}')/(2*Symbol('{l}_{3}')+ 1)
Information
Sub Equations
- cos((Symbol('theta')) ) = - 2*Symbol('{m}_{3}')/(2*Symbol('{l}_{3}')+ 1)
Free variables
- Symbol('theta')
- Symbol('{l}_{3}')
- Symbol('{m}_{3}')
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
Tests
Symbolic
Numeric
Maple
Translation: cos((theta) ) = - 2*m[3]/(2*l[3]+ 1)
Information
Sub Equations
- cos((theta) ) = - 2*m[3]/(2*l[3]+ 1)
Free variables
- l[3]
- m[3]
- theta
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
Tests
Symbolic
Numeric
Dependency Graph Information
Includes
Description
- Wigner function
- symbol
Complete translation information:
{
"id" : "FORMULA_49cbbfebc17525542fed0ae2754d26bc",
"formula" : "\\cos(\\theta) = -2m_3 / (2l_3 + 1)",
"semanticFormula" : "\\cos(\\theta) = -2m_3 / (2l_3 + 1)",
"confidence" : 0.0,
"translations" : {
"Mathematica" : {
"translation" : "Cos[(\\[Theta]) ] == - 2*Subscript[m, 3]/(2*Subscript[l, 3]+ 1)",
"translationInformation" : {
"subEquations" : [ "Cos[(\\[Theta]) ] = - 2*Subscript[m, 3]/(2*Subscript[l, 3]+ 1)" ],
"freeVariables" : [ "Subscript[l, 3]", "Subscript[m, 3]", "\\[Theta]" ],
"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"
}
},
"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" : "cos((Symbol('theta')) ) == - 2*Symbol('{m}_{3}')/(2*Symbol('{l}_{3}')+ 1)",
"translationInformation" : {
"subEquations" : [ "cos((Symbol('theta')) ) = - 2*Symbol('{m}_{3}')/(2*Symbol('{l}_{3}')+ 1)" ],
"freeVariables" : [ "Symbol('theta')", "Symbol('{l}_{3}')", "Symbol('{m}_{3}')" ],
"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"
}
},
"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" : "cos((theta) ) = - 2*m[3]/(2*l[3]+ 1)",
"translationInformation" : {
"subEquations" : [ "cos((theta) ) = - 2*m[3]/(2*l[3]+ 1)" ],
"freeVariables" : [ "l[3]", "m[3]", "theta" ],
"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"
}
},
"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" : 9,
"sentence" : 0,
"word" : 12
} ],
"includes" : [ "m_{3}", "l_3", "m" ],
"isPartOf" : [ ],
"definiens" : [ {
"definition" : "Wigner function",
"score" : 0.7125985104912714
}, {
"definition" : "symbol",
"score" : 0.6460746792928004
} ]
}