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 \operatorname{Ci}(x)=f(x)\sin(x)-g(x)\cos(x) }
... is translated to the CAS output ...
Semantic latex: \operatorname{Ci}(x) = \auxFresnelf@{x} \sin(x) - \auxFresnelg@{x} \cos(x)
Confidence: 0.65966666666667
Mathematica
Translation: Ci[x] == FresnelF[x]*Sin[x]- FresnelG[x]*Cos[x]
Information
Sub Equations
- Ci[x] = FresnelF[x]*Sin[x]- FresnelG[x]*Cos[x]
Free variables
- x
Symbol info
- Cosine; Example: \cos@@{z}
Will be translated to: Cos[$0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.14#E2 Mathematica: https://reference.wolfram.com/language/ref/Cos.html
- Fresnel Auxiliaty Functions; Example: \auxFresnelg@{z}
Will be translated to: FresnelG[$0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/7.2#E11 Mathematica: https://reference.wolfram.com/language/ref/FresnelG.html
- Fresnel Auxiliaty Functions; Example: \auxFresnelf@{z}
Will be translated to: FresnelF[$0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/7.2#E10 Mathematica: https://reference.wolfram.com/language/ref/FresnelF.html
- Was interpreted as a function call because of a leading \operatorname.
- Sine; Example: \sin@@{z}
Will be translated to: Sin[$0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.14#E1 Mathematica: https://reference.wolfram.com/language/ref/Sin.html
Tests
Symbolic
Test expression: (Ci[x])-(FresnelF[x]*Sin[x]- FresnelG[x]*Cos[x])
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: \auxFresnelf [\auxFresnelf]
Tests
Symbolic
Numeric
Maple
Translation: Ci(x) = Fresnelf(x)*sin(x)- Fresnelg(x)*cos(x)
Information
Sub Equations
- Ci(x) = Fresnelf(x)*sin(x)- Fresnelg(x)*cos(x)
Free variables
- x
Symbol info
- Cosine; Example: \cos@@{z}
Will be translated to: cos($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.14#E2 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=cos
- Fresnel Auxiliaty Functions; Example: \auxFresnelg@{z}
Will be translated to: Fresnelg($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/7.2#E11 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Fresnelg
- Fresnel Auxiliaty Functions; Example: \auxFresnelf@{z}
Will be translated to: Fresnelf($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/7.2#E10 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Fresnelf
- Was interpreted as a function call because of a leading \operatorname.
- Sine; Example: \sin@@{z}
Will be translated to: sin($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.14#E1 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=sin
Tests
Symbolic
Numeric
Dependency Graph Information
Includes
Complete translation information:
{
"id" : "FORMULA_ac92554a1b7f333e165e011e9ff35272",
"formula" : "\\operatorname{Ci}(x)=f(x)\\sin(x)-g(x)\\cos(x)",
"semanticFormula" : "\\operatorname{Ci}(x) = \\auxFresnelf@{x} \\sin(x) - \\auxFresnelg@{x} \\cos(x)",
"confidence" : 0.6596666666666666,
"translations" : {
"Mathematica" : {
"translation" : "Ci[x] == FresnelF[x]*Sin[x]- FresnelG[x]*Cos[x]",
"translationInformation" : {
"subEquations" : [ "Ci[x] = FresnelF[x]*Sin[x]- FresnelG[x]*Cos[x]" ],
"freeVariables" : [ "x" ],
"tokenTranslations" : {
"\\cos" : "Cosine; Example: \\cos@@{z}\nWill be translated to: Cos[$0]\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/4.14#E2\nMathematica: https://reference.wolfram.com/language/ref/Cos.html",
"\\auxFresnelg" : "Fresnel Auxiliaty Functions; Example: \\auxFresnelg@{z}\nWill be translated to: FresnelG[$0]\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/7.2#E11\nMathematica: https://reference.wolfram.com/language/ref/FresnelG.html",
"\\auxFresnelf" : "Fresnel Auxiliaty Functions; Example: \\auxFresnelf@{z}\nWill be translated to: FresnelF[$0]\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/7.2#E10\nMathematica: https://reference.wolfram.com/language/ref/FresnelF.html",
"Ci" : "Was interpreted as a function call because of a leading \\operatorname.",
"\\sin" : "Sine; Example: \\sin@@{z}\nWill be translated to: Sin[$0]\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/4.14#E1\nMathematica: https://reference.wolfram.com/language/ref/Sin.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" : "Ci[x]",
"rhs" : "FresnelF[x]*Sin[x]- FresnelG[x]*Cos[x]",
"testExpression" : "(Ci[x])-(FresnelF[x]*Sin[x]- FresnelG[x]*Cos[x])",
"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: \\auxFresnelf [\\auxFresnelf]"
}
}
},
"Maple" : {
"translation" : "Ci(x) = Fresnelf(x)*sin(x)- Fresnelg(x)*cos(x)",
"translationInformation" : {
"subEquations" : [ "Ci(x) = Fresnelf(x)*sin(x)- Fresnelg(x)*cos(x)" ],
"freeVariables" : [ "x" ],
"tokenTranslations" : {
"\\cos" : "Cosine; Example: \\cos@@{z}\nWill be translated to: cos($0)\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/4.14#E2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=cos",
"\\auxFresnelg" : "Fresnel Auxiliaty Functions; Example: \\auxFresnelg@{z}\nWill be translated to: Fresnelg($0)\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/7.2#E11\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Fresnelg",
"\\auxFresnelf" : "Fresnel Auxiliaty Functions; Example: \\auxFresnelf@{z}\nWill be translated to: Fresnelf($0)\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/7.2#E10\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Fresnelf",
"Ci" : "Was interpreted as a function call because of a leading \\operatorname.",
"\\sin" : "Sine; Example: \\sin@@{z}\nWill be translated to: sin($0)\nRelevant links to definitions:\nDLMF: http://dlmf.nist.gov/4.14#E1\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=sin"
}
}
}
},
"positions" : [ ],
"includes" : [ "Ci", "f(x)", "x", "g(x)", "Ci(x)" ],
"isPartOf" : [ ],
"definiens" : [ ]
}