LaTeX to CAS translator

Jump to navigation Jump to search

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 \hbox{li}(x)=\hbox{Ei}(\ln x) , \,\!}

... is translated to the CAS output ...

Semantic latex: l \iunit(x) ={\expintEi@{\ln x}}

Confidence: 0.65722105077558

Mathematica

Translation: l*I*(x) == ExpIntegralEi[Log[x]]

Information

Sub Equations

  • l*I*(x) = ExpIntegralEi[Log[x]]

Free variables

  • l
  • x

Symbol info

  • Imaginary unit was translated to: I
  • Exponential integral; Example: \expintEi@{x}

Will be translated to: Alternative translations: [ExpIntegralEi[$0]]Constraints: z != 0 Branch Cuts: (-\infty, 0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/6.2#E1 Mathematica:

  • 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: (l*I*(x))-(ExpIntegralEi[Log[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: \expintEi [\expintEi]

Tests

Symbolic
Numeric

Maple

Translation:

Information

Symbol info

  • (LaTeX -> Maple) No translation possible for given token: Cannot extract information from feature set: \expintEi [\expintEi]

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Is part of

Complete translation information:

{
  "id" : "FORMULA_22995dbf9018c3eb300778170a8c1241",
  "formula" : "{li}(x)={Ei}(\\ln x)",
  "semanticFormula" : "l \\iunit(x) ={\\expintEi@{\\ln x}}",
  "confidence" : 0.657221050775581,
  "translations" : {
    "Mathematica" : {
      "translation" : "l*I*(x) == ExpIntegralEi[Log[x]]",
      "translationInformation" : {
        "subEquations" : [ "l*I*(x) = ExpIntegralEi[Log[x]]" ],
        "freeVariables" : [ "l", "x" ],
        "tokenTranslations" : {
          "\\iunit" : "Imaginary unit was translated to: I",
          "\\expintEi" : "Exponential integral; Example: \\expintEi@{x}\nWill be translated to: \nAlternative translations: [ExpIntegralEi[$0]]Constraints: z != 0\nBranch Cuts: (-\\infty, 0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/6.2#E1\nMathematica:  ",
          "\\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" : "l*I*(x)",
          "rhs" : "ExpIntegralEi[Log[x]]",
          "testExpression" : "(l*I*(x))-(ExpIntegralEi[Log[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: \\expintEi [\\expintEi]"
        }
      }
    },
    "Maple" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> Maple) No translation possible for given token: Cannot extract information from feature set: \\expintEi [\\expintEi]"
        }
      }
    }
  },
  "positions" : [ ],
  "includes" : [ "x)", "x", "\\hbox{li}(x)=\\hbox{Ei}(\\ln x) , \\," ],
  "isPartOf" : [ "\\hbox{li}(x)=\\hbox{Ei}(\\ln x) , \\," ],
  "definiens" : [ ]
}

Specify your own input