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 \begin{align} \mathbf{H}_{\alpha -1}(x) + \mathbf{H}_{\alpha+1}(x) &= \frac{2\alpha}{x} \mathbf{H}_\alpha (x) + \frac{\left (\frac{x}{2}\right)^{\alpha}}{\sqrt{\pi}\Gamma \left (\alpha + \frac{3}{2} \right )}, \\ \mathbf{H}_{\alpha -1}(x) - \mathbf{H}_{\alpha+1}(x) &= 2 \frac{d}{dx} \left (\mathbf{H}_\alpha(x) \right) - \frac{ \left( \frac{x}{2} \right)^\alpha}{\sqrt{\pi}\Gamma \left (\alpha + \frac{3}{2} \right )}. \end{align}}
... is translated to the CAS output ...
Semantic latex: \begin{align}\StruveH{\alpha -1}@{x} + \StruveH{\alpha+1}@{x} &= \frac{2\alpha}{x} \StruveH{\alpha}@{x} + \frac{(\frac{x}{2})^{\alpha}}{\sqrt{\cpi} \EulerGamma@{\alpha + \frac{3}{2}}} , \\ \StruveH{\alpha -1}@{x} - \StruveH{\alpha+1}@{x} &= 2 \deriv [1]{ }{x}(\StruveH{\alpha}@{x}) - \frac{(\frac{x}{2})^\alpha{\sqrt{\cpi} \EulerGamma@{\alpha + \frac{3}{2}}}} .\end{align}
Confidence: 0.66012076646182
Mathematica
Translation: StruveH[\[Alpha]- 1, x]+ StruveH[\[Alpha]+ 1, x] == Divide[2*\[Alpha],x]*StruveH[\[Alpha], x]+Divide[(Divide[x,2])^\[Alpha],Sqrt[Pi]*Gamma[\[Alpha]+Divide[3,2]]] StruveH[\[Alpha]- 1, x]- StruveH[\[Alpha]+ 1, x] == 2*D[(StruveH[\[Alpha], x])-Divide[(Divide[x,2])^\[Alpha]*Sqrt[Pi]*Gamma[\[Alpha]+Divide[3,2]],], {x, 1}]
Information
Sub Equations
- StruveH[\[Alpha]- 1, x]+ StruveH[\[Alpha]+ 1, x] = Divide[2*\[Alpha],x]*StruveH[\[Alpha], x]+Divide[(Divide[x,2])^\[Alpha],Sqrt[Pi]*Gamma[\[Alpha]+Divide[3,2]]]
- StruveH[\[Alpha]- 1, x]- StruveH[\[Alpha]+ 1, x] = 2*D[(StruveH[\[Alpha], x])-Divide[(Divide[x,2])^\[Alpha]*Sqrt[Pi]*Gamma[\[Alpha]+Divide[3,2]],], {x, 1}]
Free variables
- \[Alpha]
- x
Symbol info
- Struve function; Example: \StruveH{\nu}@{z}
Will be translated to: StruveH[$0, $1] Relevant links to definitions: DLMF: http://dlmf.nist.gov/11.2#E1 Mathematica: https://reference.wolfram.com/language/ref/StruveH.html
- 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
- Pi was translated to: Pi
- 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.
- Euler Gamma function; Example: \EulerGamma@{z}
Will be translated to: Gamma[$0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/5.2#E1 Mathematica: https://reference.wolfram.com/language/ref/Gamma.html
Tests
Symbolic
Test expression: (StruveH[\[Alpha]- 1, x]+ StruveH[\[Alpha]+ 1, x])-(Divide[2*\[Alpha],x]*StruveH[\[Alpha], x]+Divide[(Divide[x,2])^\[Alpha],Sqrt[Pi]*Gamma[\[Alpha]+Divide[3,2]]])
ERROR:
{
"result": "ERROR",
"testTitle": "Simple",
"testExpression": null,
"resultExpression": null,
"wasAborted": false,
"conditionallySuccessful": false
}
Test expression: (StruveH[\[Alpha]- 1, x]- StruveH[\[Alpha]+ 1, x])-(2*D[(StruveH[\[Alpha], x])-Divide[(Divide[x,2])^\[Alpha]*Sqrt[Pi]*Gamma[\[Alpha]+Divide[3,2]],], {x, 1}])
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: \StruveH [\StruveH]
Tests
Symbolic
Numeric
Maple
Translation: StruveH(alpha - 1, x)+ StruveH(alpha + 1, x) = (2*alpha)/(x)*StruveH(alpha, x)+(((x)/(2))^(alpha))/(sqrt(Pi)*GAMMA(alpha +(3)/(2))); StruveH(alpha - 1, x)- StruveH(alpha + 1, x) = 2*diff((StruveH(alpha, x))-(((x)/(2))^(alpha)*sqrt(Pi)*GAMMA(alpha +(3)/(2)))/(), [x$(1)])
Information
Sub Equations
- StruveH(alpha - 1, x)+ StruveH(alpha + 1, x) = (2*alpha)/(x)*StruveH(alpha, x)+(((x)/(2))^(alpha))/(sqrt(Pi)*GAMMA(alpha +(3)/(2)))
- StruveH(alpha - 1, x)- StruveH(alpha + 1, x) = 2*diff((StruveH(alpha, x))-(((x)/(2))^(alpha)*sqrt(Pi)*GAMMA(alpha +(3)/(2)))/(), [x$(1)])
Free variables
- alpha
- x
Symbol info
- Struve function; Example: \StruveH{\nu}@{z}
Will be translated to: StruveH($0, $1) Relevant links to definitions: DLMF: http://dlmf.nist.gov/11.2#E1 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=StruveH
- 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
- Pi was translated to: Pi
- 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.
- Euler Gamma function; Example: \EulerGamma@{z}
Will be translated to: GAMMA($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/5.2#E1 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=GAMMA
Tests
Symbolic
Numeric
Dependency Graph Information
Includes
Is part of
Complete translation information:
{
"id" : "FORMULA_bb3a0a81a718747763efe1de1aaebfc8",
"formula" : "\\begin{align}\n\\mathbf{H}_{\\alpha -1}(x) + \\mathbf{H}_{\\alpha+1}(x) &= \\frac{2\\alpha}{x} \\mathbf{H}_\\alpha (x) + \\frac{\\left (\\frac{x}{2}\\right)^{\\alpha}}{\\sqrt{\\pi}\\Gamma \\left (\\alpha + \\frac{3}{2} \\right )}, \\\\\n\\mathbf{H}_{\\alpha -1}(x) - \\mathbf{H}_{\\alpha+1}(x) &= 2 \\frac{d}{dx} \\left (\\mathbf{H}_\\alpha(x) \\right) - \\frac{ \\left( \\frac{x}{2} \\right)^\\alpha}{\\sqrt{\\pi}\\Gamma \\left (\\alpha + \\frac{3}{2} \\right )}.\n\\end{align}",
"semanticFormula" : "\\begin{align}\\StruveH{\\alpha -1}@{x} + \\StruveH{\\alpha+1}@{x} &= \\frac{2\\alpha}{x} \\StruveH{\\alpha}@{x} + \\frac{(\\frac{x}{2})^{\\alpha}}{\\sqrt{\\cpi} \\EulerGamma@{\\alpha + \\frac{3}{2}}} , \\\\ \\StruveH{\\alpha -1}@{x} - \\StruveH{\\alpha+1}@{x} &= 2 \\deriv [1]{ }{x}(\\StruveH{\\alpha}@{x}) - \\frac{(\\frac{x}{2})^\\alpha{\\sqrt{\\cpi} \\EulerGamma@{\\alpha + \\frac{3}{2}}}} .\\end{align}",
"confidence" : 0.6601207664618238,
"translations" : {
"Mathematica" : {
"translation" : "StruveH[\\[Alpha]- 1, x]+ StruveH[\\[Alpha]+ 1, x] == Divide[2*\\[Alpha],x]*StruveH[\\[Alpha], x]+Divide[(Divide[x,2])^\\[Alpha],Sqrt[Pi]*Gamma[\\[Alpha]+Divide[3,2]]]\nStruveH[\\[Alpha]- 1, x]- StruveH[\\[Alpha]+ 1, x] == 2*D[(StruveH[\\[Alpha], x])-Divide[(Divide[x,2])^\\[Alpha]*Sqrt[Pi]*Gamma[\\[Alpha]+Divide[3,2]],], {x, 1}]",
"translationInformation" : {
"subEquations" : [ "StruveH[\\[Alpha]- 1, x]+ StruveH[\\[Alpha]+ 1, x] = Divide[2*\\[Alpha],x]*StruveH[\\[Alpha], x]+Divide[(Divide[x,2])^\\[Alpha],Sqrt[Pi]*Gamma[\\[Alpha]+Divide[3,2]]]", "StruveH[\\[Alpha]- 1, x]- StruveH[\\[Alpha]+ 1, x] = 2*D[(StruveH[\\[Alpha], x])-Divide[(Divide[x,2])^\\[Alpha]*Sqrt[Pi]*Gamma[\\[Alpha]+Divide[3,2]],], {x, 1}]" ],
"freeVariables" : [ "\\[Alpha]", "x" ],
"tokenTranslations" : {
"\\StruveH" : "Struve function; Example: \\StruveH{\\nu}@{z}\nWill be translated to: StruveH[$0, $1]\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/11.2#E1\nMathematica: https://reference.wolfram.com/language/ref/StruveH.html",
"\\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",
"\\cpi" : "Pi was translated to: Pi",
"\\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",
"\\EulerGamma" : "Euler Gamma function; Example: \\EulerGamma@{z}\nWill be translated to: Gamma[$0]\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/5.2#E1\nMathematica: https://reference.wolfram.com/language/ref/Gamma.html"
}
},
"numericResults" : {
"overallResult" : "SKIPPED",
"numberOfTests" : 0,
"numberOfFailedTests" : 0,
"numberOfSuccessfulTests" : 0,
"numberOfSkippedTests" : 0,
"numberOfErrorTests" : 0,
"wasAborted" : false,
"crashed" : false,
"testCalculationsGroups" : [ ]
},
"symbolicResults" : {
"overallResult" : "ERROR",
"numberOfTests" : 2,
"numberOfFailedTests" : 0,
"numberOfSuccessfulTests" : 0,
"numberOfSkippedTests" : 0,
"numberOfErrorTests" : 2,
"crashed" : false,
"testCalculationsGroup" : [ {
"lhs" : "StruveH[\\[Alpha]- 1, x]+ StruveH[\\[Alpha]+ 1, x]",
"rhs" : "Divide[2*\\[Alpha],x]*StruveH[\\[Alpha], x]+Divide[(Divide[x,2])^\\[Alpha],Sqrt[Pi]*Gamma[\\[Alpha]+Divide[3,2]]]",
"testExpression" : "(StruveH[\\[Alpha]- 1, x]+ StruveH[\\[Alpha]+ 1, x])-(Divide[2*\\[Alpha],x]*StruveH[\\[Alpha], x]+Divide[(Divide[x,2])^\\[Alpha],Sqrt[Pi]*Gamma[\\[Alpha]+Divide[3,2]]])",
"testCalculations" : [ {
"result" : "ERROR",
"testTitle" : "Simple",
"testExpression" : null,
"resultExpression" : null,
"wasAborted" : false,
"conditionallySuccessful" : false
} ]
}, {
"lhs" : "StruveH[\\[Alpha]- 1, x]- StruveH[\\[Alpha]+ 1, x]",
"rhs" : "2*D[(StruveH[\\[Alpha], x])-Divide[(Divide[x,2])^\\[Alpha]*Sqrt[Pi]*Gamma[\\[Alpha]+Divide[3,2]],], {x, 1}]",
"testExpression" : "(StruveH[\\[Alpha]- 1, x]- StruveH[\\[Alpha]+ 1, x])-(2*D[(StruveH[\\[Alpha], x])-Divide[(Divide[x,2])^\\[Alpha]*Sqrt[Pi]*Gamma[\\[Alpha]+Divide[3,2]],], {x, 1}])",
"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: \\StruveH [\\StruveH]"
}
}
},
"Maple" : {
"translation" : "StruveH(alpha - 1, x)+ StruveH(alpha + 1, x) = (2*alpha)/(x)*StruveH(alpha, x)+(((x)/(2))^(alpha))/(sqrt(Pi)*GAMMA(alpha +(3)/(2))); StruveH(alpha - 1, x)- StruveH(alpha + 1, x) = 2*diff((StruveH(alpha, x))-(((x)/(2))^(alpha)*sqrt(Pi)*GAMMA(alpha +(3)/(2)))/(), [x$(1)])",
"translationInformation" : {
"subEquations" : [ "StruveH(alpha - 1, x)+ StruveH(alpha + 1, x) = (2*alpha)/(x)*StruveH(alpha, x)+(((x)/(2))^(alpha))/(sqrt(Pi)*GAMMA(alpha +(3)/(2)))", "StruveH(alpha - 1, x)- StruveH(alpha + 1, x) = 2*diff((StruveH(alpha, x))-(((x)/(2))^(alpha)*sqrt(Pi)*GAMMA(alpha +(3)/(2)))/(), [x$(1)])" ],
"freeVariables" : [ "alpha", "x" ],
"tokenTranslations" : {
"\\StruveH" : "Struve function; Example: \\StruveH{\\nu}@{z}\nWill be translated to: StruveH($0, $1)\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/11.2#E1\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=StruveH",
"\\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",
"\\cpi" : "Pi was translated to: Pi",
"\\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",
"\\EulerGamma" : "Euler Gamma function; Example: \\EulerGamma@{z}\nWill be translated to: GAMMA($0)\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/5.2#E1\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=GAMMA"
}
}
}
},
"positions" : [ ],
"includes" : [ "\\mathbf{K}_\\alpha(x)", "\\alpha", "\\Gamma(z)", "\\mathbf{H}_{\\alpha}(x)", "\\mathbf{L}_{\\alpha}(x)", "x", "\\mathbf{H}_{\\alpha}(z)", "Y_{\\alpha}(x)", "\\mathbf{M}_\\alpha(x)", "\\begin{align}\\mathbf{H}_{\\alpha -1}(x) + \\mathbf{H}_{\\alpha+1}(x) &= \\frac{2\\alpha}{x} \\mathbf{H}_\\alpha (x) + \\frac{\\left (\\frac{x}{2}\\right)^{\\alpha}}{\\sqrt{\\pi}\\Gamma \\left (\\alpha + \\frac{3}{2} \\right )}, \\\\\\mathbf{H}_{\\alpha -1}(x) - \\mathbf{H}_{\\alpha+1}(x) &= 2 \\frac{d}{dx} \\left (\\mathbf{H}_\\alpha(x) \\right) - \\frac{ \\left( \\frac{x}{2} \\right)^\\alpha}{\\sqrt{\\pi}\\Gamma \\left (\\alpha + \\frac{3}{2} \\right )}.\\end{align}" ],
"isPartOf" : [ "\\begin{align}\\mathbf{H}_{\\alpha -1}(x) + \\mathbf{H}_{\\alpha+1}(x) &= \\frac{2\\alpha}{x} \\mathbf{H}_\\alpha (x) + \\frac{\\left (\\frac{x}{2}\\right)^{\\alpha}}{\\sqrt{\\pi}\\Gamma \\left (\\alpha + \\frac{3}{2} \\right )}, \\\\\\mathbf{H}_{\\alpha -1}(x) - \\mathbf{H}_{\\alpha+1}(x) &= 2 \\frac{d}{dx} \\left (\\mathbf{H}_\\alpha(x) \\right) - \\frac{ \\left( \\frac{x}{2} \\right)^\\alpha}{\\sqrt{\\pi}\\Gamma \\left (\\alpha + \\frac{3}{2} \\right )}.\\end{align}" ],
"definiens" : [ ]
}