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 1+\frac{1}{\ln x} < \operatorname{li}(x) \frac{\ln x}{x} < 1+\frac{1}{\ln x}+\frac{3}{(\ln x)^2} }
... is translated to the CAS output ...
Semantic latex: 1 + \frac{1}{\ln x} < \logint@{x} \frac{\ln x}{x} < 1 + \frac{1}{\ln x} + \frac{3}{(\ln x)^2}
Confidence: 0.65464247934701
Mathematica
Translation: 1 +Divide[1,Log[x]] < LogIntegral[x]*Divide[Log[x],x] < 1 +Divide[1,Log[x]]+Divide[3,(Log[x])^(2)]
Information
Sub Equations
- 1 +Divide[1,Log[x]] < LogIntegral[x]*Divide[Log[x],x]
- LogIntegral[x]*Divide[Log[x],x] < 1 +Divide[1,Log[x]]+Divide[3,(Log[x])^(2)]
Free variables
- x
Symbol info
- Logarithmic integral; Example: \logint@{x}
Will be translated to: LogIntegral[$0] Constraints: x > 1 Mathematica uses other branch cuts: (-\inf, 1) Relevant links to definitions: DLMF: http://dlmf.nist.gov/6.2#E8 Mathematica: https://reference.wolfram.com/language/ref/LogIntegral.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: 1 +Divide[1,Log[x]]<LogIntegral[x]*Divide[Log[x],x]
ERROR:
{
"result": "ERROR",
"testTitle": "Simple",
"testExpression": null,
"resultExpression": null,
"wasAborted": false,
"conditionallySuccessful": false
}
Test expression: LogIntegral[x]*Divide[Log[x],x]<1 +Divide[1,Log[x]]+Divide[3,(Log[x])^(2)]
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: \logint [\logint]
Tests
Symbolic
Numeric
Maple
Translation: 1 +(1)/(ln(x)) < Li(x)*(ln(x))/(x) < 1 +(1)/(ln(x))+(3)/((ln(x))^(2))
Information
Sub Equations
- 1 +(1)/(ln(x)) < Li(x)*(ln(x))/(x)
- Li(x)*(ln(x))/(x) < 1 +(1)/(ln(x))+(3)/((ln(x))^(2))
Free variables
- x
Symbol info
- Logarithmic integral; Example: \logint@{x}
Will be translated to: Li($0) Constraints: x > 1 Relevant links to definitions: DLMF: http://dlmf.nist.gov/6.2#E8 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Li
- 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
- bracket li
- e.g.
Complete translation information:
{
"id" : "FORMULA_62e4d613cc7cd8a6a22c7926e2ec0657",
"formula" : "1+\\frac{1}{\\ln x} < \\operatorname{li}(x) \\frac{\\ln x}{x} < 1+\\frac{1}{\\ln x}+\\frac{3}{(\\ln x)^2}",
"semanticFormula" : "1 + \\frac{1}{\\ln x} < \\logint@{x} \\frac{\\ln x}{x} < 1 + \\frac{1}{\\ln x} + \\frac{3}{(\\ln x)^2}",
"confidence" : 0.6546424793470096,
"translations" : {
"Mathematica" : {
"translation" : "1 +Divide[1,Log[x]] < LogIntegral[x]*Divide[Log[x],x] < 1 +Divide[1,Log[x]]+Divide[3,(Log[x])^(2)]",
"translationInformation" : {
"subEquations" : [ "1 +Divide[1,Log[x]] < LogIntegral[x]*Divide[Log[x],x]", "LogIntegral[x]*Divide[Log[x],x] < 1 +Divide[1,Log[x]]+Divide[3,(Log[x])^(2)]" ],
"freeVariables" : [ "x" ],
"tokenTranslations" : {
"\\logint" : "Logarithmic integral; Example: \\logint@{x}\nWill be translated to: LogIntegral[$0]\nConstraints: x > 1\nMathematica uses other branch cuts: (-\\inf, 1)\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/6.2#E8\nMathematica: https://reference.wolfram.com/language/ref/LogIntegral.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" : 2,
"numberOfFailedTests" : 0,
"numberOfSuccessfulTests" : 0,
"numberOfSkippedTests" : 0,
"numberOfErrorTests" : 2,
"crashed" : false,
"testCalculationsGroup" : [ {
"lhs" : "1 +Divide[1,Log[x]]",
"rhs" : "LogIntegral[x]*Divide[Log[x],x]",
"testExpression" : "1 +Divide[1,Log[x]]<LogIntegral[x]*Divide[Log[x],x]",
"testCalculations" : [ {
"result" : "ERROR",
"testTitle" : "Simple",
"testExpression" : null,
"resultExpression" : null,
"wasAborted" : false,
"conditionallySuccessful" : false
} ]
}, {
"lhs" : "LogIntegral[x]*Divide[Log[x],x]",
"rhs" : "1 +Divide[1,Log[x]]+Divide[3,(Log[x])^(2)]",
"testExpression" : "LogIntegral[x]*Divide[Log[x],x]<1 +Divide[1,Log[x]]+Divide[3,(Log[x])^(2)]",
"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: \\logint [\\logint]"
}
}
},
"Maple" : {
"translation" : "1 +(1)/(ln(x)) < Li(x)*(ln(x))/(x) < 1 +(1)/(ln(x))+(3)/((ln(x))^(2))",
"translationInformation" : {
"subEquations" : [ "1 +(1)/(ln(x)) < Li(x)*(ln(x))/(x)", "Li(x)*(ln(x))/(x) < 1 +(1)/(ln(x))+(3)/((ln(x))^(2))" ],
"freeVariables" : [ "x" ],
"tokenTranslations" : {
"\\logint" : "Logarithmic integral; Example: \\logint@{x}\nWill be translated to: Li($0)\nConstraints: x > 1\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/6.2#E8\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Li",
"\\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" : 5,
"sentence" : 6,
"word" : 10
} ],
"includes" : [ "x)", "x" ],
"isPartOf" : [ ],
"definiens" : [ {
"definition" : "bracket li",
"score" : 0.7125985104912714
}, {
"definition" : "e.g.",
"score" : 0.6859086196238077
} ]
}