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 w(x) = \frac{k}{\sqrt{\pi}} x^{-1/2} \exp(-k^2\log^2 x)}
... is translated to the CAS output ...
Semantic latex: w(x) = \frac{k}{\sqrt{\cpi}} x^{-1/2} \exp(- k^2 \log^2 x)
Confidence: 0
Mathematica
Translation: w[x] == Divide[k,Sqrt[Pi]]*(x)^(- 1/2)* Exp[- (k)^(2)* (Log[x])^(2)]
Information
Sub Equations
- w[x] = Divide[k,Sqrt[Pi]]*(x)^(- 1/2)* Exp[- (k)^(2)* (Log[x])^(2)]
Free variables
- k
- x
Symbol info
- Exponential function; Example: \exp@@{z}
Will be translated to: Exp[$0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.2#E19 Mathematica: https://reference.wolfram.com/language/ref/Exp.html
- Pi was translated to: Pi
- Logarithm; Example: \log@@{z}
Will be translated to: Log[$0] Constraints: z != 0 Branch Cuts: (-\infty, 0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.2#E2 Mathematica: https://reference.wolfram.com/language/ref/Log.html
- Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
Tests
Symbolic
Test expression: (w*(x))-(Divide[k,Sqrt[Pi]]*(x)^(- 1/2)* Exp[- (k)^(2)* (Log[x])^(2)])
ERROR:
{
"result": "ERROR",
"testTitle": "Simple",
"testExpression": null,
"resultExpression": null,
"wasAborted": false,
"conditionallySuccessful": false
}
Numeric
SymPy
Translation: w(x) == (k)/(sqrt(pi))*(x)**(- 1/2)* exp(- (k)**(2)* (log(x))**(2))
Information
Sub Equations
- w(x) = (k)/(sqrt(pi))*(x)**(- 1/2)* exp(- (k)**(2)* (log(x))**(2))
Free variables
- k
- x
Symbol info
- Exponential function; Example: \exp@@{z}
Will be translated to: exp($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.2#E19 SymPy: https://docs.sympy.org/latest/modules/functions/elementary.html#exp
- Pi was translated to: pi
- Logarithm; Example: \log@@{z}
Will be translated to: log($0) Constraints: z != 0 Branch Cuts: (-\infty, 0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.2#E2 SymPy: https://docs.sympy.org/latest/modules/functions/elementary.html#log
- Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
Tests
Symbolic
Numeric
Maple
Translation: w(x) = (k)/(sqrt(Pi))*(x)^(- 1/2)* exp(- (k)^(2)* (log(x))^(2))
Information
Sub Equations
- w(x) = (k)/(sqrt(Pi))*(x)^(- 1/2)* exp(- (k)^(2)* (log(x))^(2))
Free variables
- k
- x
Symbol info
- Exponential function; Example: \exp@@{z}
Will be translated to: exp($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.2#E19 Maple: https://www.maplesoft.com/support/help/Maple/view.aspx?path=LinearAlgebra/Trace
- Pi was translated to: Pi
- Logarithm; Example: \log@@{z}
Will be translated to: log($0) Constraints: z != 0 Branch Cuts: (-\infty, 0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.2#E2 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=log
- Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
Tests
Symbolic
Numeric
Dependency Graph Information
Includes
Description
- x
- TeX Source
- Formula
- link
- Gold ID
- exp
- k
- log
- pi
- sqrt
Complete translation information:
{
"id" : "FORMULA_583d3b9e00bbd73091b01f368d1a82c7",
"formula" : "w(x) = \\frac{k}{\\sqrt{\\pi}} x^{-1/2} \\exp(-k^2\\log^2 x)",
"semanticFormula" : "w(x) = \\frac{k}{\\sqrt{\\cpi}} x^{-1/2} \\exp(- k^2 \\log^2 x)",
"confidence" : 0.0,
"translations" : {
"Mathematica" : {
"translation" : "w[x] == Divide[k,Sqrt[Pi]]*(x)^(- 1/2)* Exp[- (k)^(2)* (Log[x])^(2)]",
"translationInformation" : {
"subEquations" : [ "w[x] = Divide[k,Sqrt[Pi]]*(x)^(- 1/2)* Exp[- (k)^(2)* (Log[x])^(2)]" ],
"freeVariables" : [ "k", "x" ],
"tokenTranslations" : {
"\\exp" : "Exponential function; Example: \\exp@@{z}\nWill be translated to: Exp[$0]\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/4.2#E19\nMathematica: https://reference.wolfram.com/language/ref/Exp.html",
"\\cpi" : "Pi was translated to: Pi",
"\\log" : "Logarithm; Example: \\log@@{z}\nWill be translated to: Log[$0]\nConstraints: z != 0\nBranch Cuts: (-\\infty, 0]\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/4.2#E2\nMathematica: https://reference.wolfram.com/language/ref/Log.html",
"w" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
}
},
"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" : "w*(x)",
"rhs" : "Divide[k,Sqrt[Pi]]*(x)^(- 1/2)* Exp[- (k)^(2)* (Log[x])^(2)]",
"testExpression" : "(w*(x))-(Divide[k,Sqrt[Pi]]*(x)^(- 1/2)* Exp[- (k)^(2)* (Log[x])^(2)])",
"testCalculations" : [ {
"result" : "ERROR",
"testTitle" : "Simple",
"testExpression" : null,
"resultExpression" : null,
"wasAborted" : false,
"conditionallySuccessful" : false
} ]
} ]
}
},
"SymPy" : {
"translation" : "w(x) == (k)/(sqrt(pi))*(x)**(- 1/2)* exp(- (k)**(2)* (log(x))**(2))",
"translationInformation" : {
"subEquations" : [ "w(x) = (k)/(sqrt(pi))*(x)**(- 1/2)* exp(- (k)**(2)* (log(x))**(2))" ],
"freeVariables" : [ "k", "x" ],
"tokenTranslations" : {
"\\exp" : "Exponential function; Example: \\exp@@{z}\nWill be translated to: exp($0)\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/4.2#E19\nSymPy: https://docs.sympy.org/latest/modules/functions/elementary.html#exp",
"\\cpi" : "Pi was translated to: pi",
"\\log" : "Logarithm; Example: \\log@@{z}\nWill be translated to: log($0)\nConstraints: z != 0\nBranch Cuts: (-\\infty, 0]\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/4.2#E2\nSymPy: https://docs.sympy.org/latest/modules/functions/elementary.html#log",
"w" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
}
}
},
"Maple" : {
"translation" : "w(x) = (k)/(sqrt(Pi))*(x)^(- 1/2)* exp(- (k)^(2)* (log(x))^(2))",
"translationInformation" : {
"subEquations" : [ "w(x) = (k)/(sqrt(Pi))*(x)^(- 1/2)* exp(- (k)^(2)* (log(x))^(2))" ],
"freeVariables" : [ "k", "x" ],
"tokenTranslations" : {
"\\exp" : "Exponential function; Example: \\exp@@{z}\nWill be translated to: exp($0)\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/4.2#E19\nMaple: https://www.maplesoft.com/support/help/Maple/view.aspx?path=LinearAlgebra/Trace",
"\\cpi" : "Pi was translated to: Pi",
"\\log" : "Logarithm; Example: \\log@@{z}\nWill be translated to: log($0)\nConstraints: z != 0\nBranch Cuts: (-\\infty, 0]\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/4.2#E2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=log",
"w" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
}
}
}
},
"positions" : [ {
"section" : 1,
"sentence" : 0,
"word" : 8
} ],
"includes" : [ "^{-1/2}", "^2" ],
"isPartOf" : [ ],
"definiens" : [ {
"definition" : "x",
"score" : 0.7687941485698011
}, {
"definition" : "TeX Source",
"score" : 0.722
}, {
"definition" : "Formula",
"score" : 0.6896778755706364
}, {
"definition" : "link",
"score" : 0.6629879847031728
}, {
"definition" : "Gold ID",
"score" : 0.6231540443721655
}, {
"definition" : "exp",
"score" : 0.5758968646127977
}, {
"definition" : "k",
"score" : 0.5758968646127977
}, {
"definition" : "log",
"score" : 0.5758968646127977
}, {
"definition" : "pi",
"score" : 0.5758968646127977
}, {
"definition" : "sqrt",
"score" : 0.5758968646127977
} ]
}