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 \frac{1}{\Gamma(z)}= z e^{\gamma z} \prod_{k=1}^\infty \left\{ \left(1+\frac{z}{k}\right)e^{-z/k} \right\}}

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

Semantic latex: \frac{1}{\EulerGamma@{z}} = z \expe^{\EulerConstant z} \prod_{k=1}^\infty \{(1 + \frac{z}{k}) \expe^{-z/k} \}

Confidence: 0.64660228981098

Mathematica

Translation: Divide[1,Gamma[z]] == z*Exp[EulerGamma*z]*Product[(1 +Divide[z,k])*Exp[- z/k], {k, 1, Infinity}, GenerateConditions->None]

Information

Sub Equations

  • Divide[1,Gamma[z]] = z*Exp[EulerGamma*z]*Product[(1 +Divide[z,k])*Exp[- z/k], {k, 1, Infinity}, GenerateConditions->None]

Free variables

  • z

Symbol info

  • Recognizes e with power as the exponential function. It was translated as a function.
  • Euler-Mascheroni constant was translated to: EulerGamma
  • Euler Gamma function; Example: \EulerGamma@{z}

Will be translated to: Gamma[$0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/5.2#E1 Mathematica: https://reference.wolfram.com/language/ref/Gamma.html

Tests

Symbolic

Test expression: (Divide[1,Gamma[z]])-(z*Exp[EulerGamma*z]*Product[(1 +Divide[z,k])*Exp[- z/k], {k, 1, 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: \EulerGamma [\EulerGamma]

Tests

Symbolic
Numeric

Maple

Translation: (1)/(GAMMA(z)) = z*exp(gamma*z)*product((1 +(z)/(k))*exp(- z/k), k = 1..infinity)

Information

Sub Equations

  • (1)/(GAMMA(z)) = z*exp(gamma*z)*product((1 +(z)/(k))*exp(- z/k), k = 1..infinity)

Free variables

  • z

Symbol info

  • Recognizes e with power as the exponential function. It was translated as a function.
  • Euler-Mascheroni constant was translated to: gamma
  • Euler Gamma function; Example: \EulerGamma@{z}

Will be translated to: GAMMA($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/5.2#E1 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=GAMMA

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • proof
  • Adamchik
  • Barnes G-function
  • Euler -- Mascheroni
  • logarithmic difference of the gamma function
  • parametric loggamma
  • Ref
  • result
  • term of the Barnes G-function

Complete translation information:

{
  "id" : "FORMULA_6bc0d742c4d25c1abb61158150489676",
  "formula" : "\\frac{1}{\\Gamma(z)}= z e^{\\gamma z} \\prod_{k=1}^\\infty \\left\\{ \\left(1+\\frac{z}{k}\\right)e^{-z/k} \\right\\}",
  "semanticFormula" : "\\frac{1}{\\EulerGamma@{z}} = z \\expe^{\\EulerConstant z} \\prod_{k=1}^\\infty \\{(1 + \\frac{z}{k}) \\expe^{-z/k} \\}",
  "confidence" : 0.6466022898109791,
  "translations" : {
    "Mathematica" : {
      "translation" : "Divide[1,Gamma[z]] == z*Exp[EulerGamma*z]*Product[(1 +Divide[z,k])*Exp[- z/k], {k, 1, Infinity}, GenerateConditions->None]",
      "translationInformation" : {
        "subEquations" : [ "Divide[1,Gamma[z]] = z*Exp[EulerGamma*z]*Product[(1 +Divide[z,k])*Exp[- z/k], {k, 1, Infinity}, GenerateConditions->None]" ],
        "freeVariables" : [ "z" ],
        "tokenTranslations" : {
          "\\expe" : "Recognizes e with power as the exponential function. It was translated as a function.",
          "\\EulerConstant" : "Euler-Mascheroni constant was translated to: EulerGamma",
          "\\EulerGamma" : "Euler Gamma function; Example: \\EulerGamma@{z}\nWill be translated to: Gamma[$0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/5.2#E1\nMathematica:  https://reference.wolfram.com/language/ref/Gamma.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" : "Divide[1,Gamma[z]]",
          "rhs" : "z*Exp[EulerGamma*z]*Product[(1 +Divide[z,k])*Exp[- z/k], {k, 1, Infinity}, GenerateConditions->None]",
          "testExpression" : "(Divide[1,Gamma[z]])-(z*Exp[EulerGamma*z]*Product[(1 +Divide[z,k])*Exp[- z/k], {k, 1, 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: \\EulerGamma [\\EulerGamma]"
        }
      }
    },
    "Maple" : {
      "translation" : "(1)/(GAMMA(z)) = z*exp(gamma*z)*product((1 +(z)/(k))*exp(- z/k), k = 1..infinity)",
      "translationInformation" : {
        "subEquations" : [ "(1)/(GAMMA(z)) = z*exp(gamma*z)*product((1 +(z)/(k))*exp(- z/k), k = 1..infinity)" ],
        "freeVariables" : [ "z" ],
        "tokenTranslations" : {
          "\\expe" : "Recognizes e with power as the exponential function. It was translated as a function.",
          "\\EulerConstant" : "Euler-Mascheroni constant was translated to: gamma",
          "\\EulerGamma" : "Euler Gamma function; Example: \\EulerGamma@{z}\nWill be translated to: GAMMA($0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/5.2#E1\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=GAMMA"
        }
      }
    }
  },
  "positions" : [ {
    "section" : 8,
    "sentence" : 0,
    "word" : 55
  } ],
  "includes" : [ "\\,\\Gamma(x)", "\\, \\gamma", "z", "\\,\\gamma" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "proof",
    "score" : 0.8426021531523621
  }, {
    "definition" : "Adamchik",
    "score" : 0.6687181434333315
  }, {
    "definition" : "Barnes G-function",
    "score" : 0.6687181434333315
  }, {
    "definition" : "Euler -- Mascheroni",
    "score" : 0.6687181434333315
  }, {
    "definition" : "logarithmic difference of the gamma function",
    "score" : 0.6687181434333315
  }, {
    "definition" : "parametric loggamma",
    "score" : 0.6687181434333315
  }, {
    "definition" : "Ref",
    "score" : 0.6687181434333315
  }, {
    "definition" : "result",
    "score" : 0.6687181434333315
  }, {
    "definition" : "term of the Barnes G-function",
    "score" : 0.6687181434333315
  } ]
}

Specify your own input