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{d^2f}{dz^2} - \left(\tfrac14z^2+a\right)f=0}
... is translated to the CAS output ...
Semantic latex: \deriv [2]{f}{z} -(\tfrac14 z^2 + a) f = 0
Confidence: 0
Mathematica
Translation: D[f, {z, 2}]-(Divide[1,4]*(z)^(2)+ a)*f == 0
Information
Sub Equations
- D[f, {z, 2}]-(Divide[1,4]*(z)^(2)+ a)*f = 0
Free variables
- a
- f
- z
Symbol info
- Derivative; Example: \deriv[n]{f}{x}
Will be translated to: D[$1, {$2, $0}] Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.4#E4 Mathematica: https://reference.wolfram.com/language/ref/D.html
Tests
Symbolic
Test expression: (D[f, {z, 2}]-(Divide[1,4]*(z)^(2)+ a)*f)-(0)
ERROR:
{
"result": "ERROR",
"testTitle": "Simple",
"testExpression": null,
"resultExpression": null,
"wasAborted": false,
"conditionallySuccessful": false
}
Numeric
SymPy
Translation: diff(f, z, 2)-((1)/(4)*(z)**(2)+ a)*f == 0
Information
Sub Equations
- diff(f, z, 2)-((1)/(4)*(z)**(2)+ a)*f = 0
Free variables
- a
- f
- z
Symbol info
- Derivative; Example: \deriv[n]{f}{x}
Will be translated to: diff($1, $2, $0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.4#E4 SymPy: https://docs.sympy.org/latest/tutorial/calculus.html#derivatives
Tests
Symbolic
Numeric
Maple
Translation: diff(f, [z$(2)])-((1)/(4)*(z)^(2)+ a)*f = 0
Information
Sub Equations
- diff(f, [z$(2)])-((1)/(4)*(z)^(2)+ a)*f = 0
Free variables
- a
- f
- z
Symbol info
- Derivative; Example: \deriv[n]{f}{x}
Will be translated to: diff($1, [$2$($0)]) Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.4#E4 Maple: https://www.maplesoft.com/support/help/Maple/view.aspx?path=diff
Tests
Symbolic
Numeric
Dependency Graph Information
Includes
Description
- H. F. Weber 's equation
- above equation
- b
- distinct form
Complete translation information:
{
"id" : "FORMULA_e3c07c729fd828411080942aa3e1ef67",
"formula" : "\\frac{d^2f}{dz^2} - \\left(\\tfrac14z^2+a\\right)f=0",
"semanticFormula" : "\\deriv [2]{f}{z} -(\\tfrac14 z^2 + a) f = 0",
"confidence" : 0.0,
"translations" : {
"Mathematica" : {
"translation" : "D[f, {z, 2}]-(Divide[1,4]*(z)^(2)+ a)*f == 0",
"translationInformation" : {
"subEquations" : [ "D[f, {z, 2}]-(Divide[1,4]*(z)^(2)+ a)*f = 0" ],
"freeVariables" : [ "a", "f", "z" ],
"tokenTranslations" : {
"\\deriv1" : "Derivative; Example: \\deriv[n]{f}{x}\nWill be translated to: D[$1, {$2, $0}]\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/1.4#E4\nMathematica: https://reference.wolfram.com/language/ref/D.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" : "D[f, {z, 2}]-(Divide[1,4]*(z)^(2)+ a)*f",
"rhs" : "0",
"testExpression" : "(D[f, {z, 2}]-(Divide[1,4]*(z)^(2)+ a)*f)-(0)",
"testCalculations" : [ {
"result" : "ERROR",
"testTitle" : "Simple",
"testExpression" : null,
"resultExpression" : null,
"wasAborted" : false,
"conditionallySuccessful" : false
} ]
} ]
}
},
"SymPy" : {
"translation" : "diff(f, z, 2)-((1)/(4)*(z)**(2)+ a)*f == 0",
"translationInformation" : {
"subEquations" : [ "diff(f, z, 2)-((1)/(4)*(z)**(2)+ a)*f = 0" ],
"freeVariables" : [ "a", "f", "z" ],
"tokenTranslations" : {
"\\deriv1" : "Derivative; Example: \\deriv[n]{f}{x}\nWill be translated to: diff($1, $2, $0)\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/1.4#E4\nSymPy: https://docs.sympy.org/latest/tutorial/calculus.html#derivatives"
}
}
},
"Maple" : {
"translation" : "diff(f, [z$(2)])-((1)/(4)*(z)^(2)+ a)*f = 0",
"translationInformation" : {
"subEquations" : [ "diff(f, [z$(2)])-((1)/(4)*(z)^(2)+ a)*f = 0" ],
"freeVariables" : [ "a", "f", "z" ],
"tokenTranslations" : {
"\\deriv1" : "Derivative; Example: \\deriv[n]{f}{x}\nWill be translated to: diff($1, [$2$($0)])\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/1.4#E4\nMaple: https://www.maplesoft.com/support/help/Maple/view.aspx?path=diff"
}
}
}
},
"positions" : [ {
"section" : 0,
"sentence" : 2,
"word" : 32
} ],
"includes" : [ "z", "a" ],
"isPartOf" : [ ],
"definiens" : [ {
"definition" : "H. F. Weber 's equation",
"score" : 0.5758968646127977
}, {
"definition" : "above equation",
"score" : 0.5271746031746032
}, {
"definition" : "b",
"score" : 0.48198679066081446
}, {
"definition" : "distinct form",
"score" : 0.44363867256099365
} ]
}