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 \mathrm{ker}(x) = -\ln\left(\frac{x}{2}\right) \mathrm{ber}(x) + \frac{\pi}{4}\mathrm{bei}(x) + \sum_{k \geq 0} (-1)^k \frac{\psi(2k + 1)}{[(2k)!]^2} \left(\frac{x^2}{4}\right)^{2k}}
... is translated to the CAS output ...
Semantic latex: \mathrm{ker}(x) = - \ln(\frac{x}{2}) \mathrm{ber}(x) + \frac{\cpi}{4} \mathrm{bei}(x) + \sum_{k \geq 0}(- 1)^k \frac{\digamma@{2 k + 1}}{[(2k)!]^2}(\frac{x^2}{4})^{2k}
Confidence: 0.6805
Mathematica
Translation: ker[x] == - Log[Divide[x,2]]*ber[x]+Divide[Pi,4]*bei[x]+ Sum[(- 1)^(k)*Divide[PolyGamma[2*k + 1],((2*k)!)^(2)]*(Divide[(x)^(2),4])^(2*k), {k, 0, Infinity}, GenerateConditions->None]
Information
Sub Equations
- ker[x] = - Log[Divide[x,2]]*ber[x]+Divide[Pi,4]*bei[x]+ Sum[(- 1)^(k)*Divide[PolyGamma[2*k + 1],((2*k)!)^(2)]*(Divide[(x)^(2),4])^(2*k), {k, 0, Infinity}, GenerateConditions->None]
Free variables
- x
Symbol info
- Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
- Pi was translated to: Pi
- Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
- Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
- Digamma / Psi function; Example: \digamma@{z}
Will be translated to: PolyGamma[$0] Constraints: z not element of {0, -1, -2, ...} Relevant links to definitions: DLMF: http://dlmf.nist.gov/5.2#E2 Mathematica: https://reference.wolfram.com/language/ref/PolyGamma.html
- Natural logarithm; Example: \ln@@{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
Tests
Symbolic
Test expression: (k*e*r*(x))-(- Log[Divide[x,2]]*ber[x]+Divide[Pi,4]*bei[x]+ Sum[(- 1)^(k)*Divide[PolyGamma[2*k + 1],((2*k)!)^(2)]*(Divide[(x)^(2),4])^(2*k), {k, 0, Infinity}, GenerateConditions->None])
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: \digamma [\digamma]
Tests
Symbolic
Numeric
Maple
Translation: ker(x) = - ln((x)/(2))*ber(x)+(Pi)/(4)*bei(x)+ sum((- 1)^(k)*(Psi(2*k + 1))/((factorial(2*k))^(2))*(((x)^(2))/(4))^(2*k), k = 0..infinity)
Information
Sub Equations
- ker(x) = - ln((x)/(2))*ber(x)+(Pi)/(4)*bei(x)+ sum((- 1)^(k)*(Psi(2*k + 1))/((factorial(2*k))^(2))*(((x)^(2))/(4))^(2*k), k = 0..infinity)
Free variables
- x
Symbol info
- Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
- Pi was translated to: Pi
- Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
- Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
- Digamma / Psi function; Example: \digamma@{z}
Will be translated to: Psi($0) Constraints: z not element of {0, -1, -2, ...} Relevant links to definitions: DLMF: http://dlmf.nist.gov/5.2#E2 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Psi
- Natural logarithm; Example: \ln@@{z}
Will be translated to: ln($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=ln
Tests
Symbolic
Numeric
Dependency Graph Information
Includes
Description
- series expansion
- asymptotic series
- special case ker
- integer
- ker
Complete translation information:
{
"id" : "FORMULA_b890f5f533c0be0f65a764e03c97147a",
"formula" : "\\mathrm{ker}(x) = -\\ln\\left(\\frac{x}{2}\\right) \\mathrm{ber}(x) + \\frac{\\pi}{4}\\mathrm{bei}(x) + \\sum_{k \\geq 0} (-1)^k \\frac{\\psi(2k + 1)}{[(2k)!]^2} \\left(\\frac{x^2}{4}\\right)^{2k}",
"semanticFormula" : "\\mathrm{ker}(x) = - \\ln(\\frac{x}{2}) \\mathrm{ber}(x) + \\frac{\\cpi}{4} \\mathrm{bei}(x) + \\sum_{k \\geq 0}(- 1)^k \\frac{\\digamma@{2 k + 1}}{[(2k)!]^2}(\\frac{x^2}{4})^{2k}",
"confidence" : 0.6805,
"translations" : {
"Mathematica" : {
"translation" : "ker[x] == - Log[Divide[x,2]]*ber[x]+Divide[Pi,4]*bei[x]+ Sum[(- 1)^(k)*Divide[PolyGamma[2*k + 1],((2*k)!)^(2)]*(Divide[(x)^(2),4])^(2*k), {k, 0, Infinity}, GenerateConditions->None]",
"translationInformation" : {
"subEquations" : [ "ker[x] = - Log[Divide[x,2]]*ber[x]+Divide[Pi,4]*bei[x]+ Sum[(- 1)^(k)*Divide[PolyGamma[2*k + 1],((2*k)!)^(2)]*(Divide[(x)^(2),4])^(2*k), {k, 0, Infinity}, GenerateConditions->None]" ],
"freeVariables" : [ "x" ],
"tokenTranslations" : {
"ker" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
"\\cpi" : "Pi was translated to: Pi",
"ber" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
"bei" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
"\\digamma" : "Digamma / Psi function; Example: \\digamma@{z}\nWill be translated to: PolyGamma[$0]\nConstraints: z not element of {0, -1, -2, ...}\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/5.2#E2\nMathematica: https://reference.wolfram.com/language/ref/PolyGamma.html",
"\\ln" : "Natural logarithm; Example: \\ln@@{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"
}
},
"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" : "k*e*r*(x)",
"rhs" : "- Log[Divide[x,2]]*ber[x]+Divide[Pi,4]*bei[x]+ Sum[(- 1)^(k)*Divide[PolyGamma[2*k + 1],((2*k)!)^(2)]*(Divide[(x)^(2),4])^(2*k), {k, 0, Infinity}, GenerateConditions->None]",
"testExpression" : "(k*e*r*(x))-(- Log[Divide[x,2]]*ber[x]+Divide[Pi,4]*bei[x]+ Sum[(- 1)^(k)*Divide[PolyGamma[2*k + 1],((2*k)!)^(2)]*(Divide[(x)^(2),4])^(2*k), {k, 0, Infinity}, GenerateConditions->None])",
"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: \\digamma [\\digamma]"
}
}
},
"Maple" : {
"translation" : "ker(x) = - ln((x)/(2))*ber(x)+(Pi)/(4)*bei(x)+ sum((- 1)^(k)*(Psi(2*k + 1))/((factorial(2*k))^(2))*(((x)^(2))/(4))^(2*k), k = 0..infinity)",
"translationInformation" : {
"subEquations" : [ "ker(x) = - ln((x)/(2))*ber(x)+(Pi)/(4)*bei(x)+ sum((- 1)^(k)*(Psi(2*k + 1))/((factorial(2*k))^(2))*(((x)^(2))/(4))^(2*k), k = 0..infinity)" ],
"freeVariables" : [ "x" ],
"tokenTranslations" : {
"ker" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
"\\cpi" : "Pi was translated to: Pi",
"ber" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
"bei" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
"\\digamma" : "Digamma / Psi function; Example: \\digamma@{z}\nWill be translated to: Psi($0)\nConstraints: z not element of {0, -1, -2, ...}\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/5.2#E2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Psi",
"\\ln" : "Natural logarithm; Example: \\ln@@{z}\nWill be translated to: ln($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=ln"
}
}
}
},
"positions" : [ {
"section" : 3,
"sentence" : 0,
"word" : 32
} ],
"includes" : [ "\\psi(z)", "x)", "x" ],
"isPartOf" : [ ],
"definiens" : [ {
"definition" : "series expansion",
"score" : 0.8869384888466118
}, {
"definition" : "asymptotic series",
"score" : 0.6954080343007951
}, {
"definition" : "special case ker",
"score" : 0.5816270233429564
}, {
"definition" : "integer",
"score" : 0.44936883129115235
}, {
"definition" : "ker",
"score" : 0.44936883129115235
} ]
}