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 \,\zeta(s,\alpha)=L(0, \alpha,s)=\Phi(1,s,\alpha).}

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

Semantic latex: \Hurwitzzeta@{s}{\alpha} = L(0 , \alpha , s) = \Phi(1 , s , \alpha)

Confidence: 0.67147715490595

Mathematica

Translation: HurwitzZeta[s, \[Alpha]] == L[0 , \[Alpha], s] == \[CapitalPhi][1 , s , \[Alpha]]

Information

Sub Equations

  • HurwitzZeta[s, \[Alpha]] = L[0 , \[Alpha], s]
  • L[0 , \[Alpha], s] = \[CapitalPhi][1 , s , \[Alpha]]

Free variables

  • \[Alpha]
  • \[CapitalPhi]
  • s

Symbol info

  • Hurwitz zeta function; Example: \Hurwitzzeta@{s}{a}

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

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Could be the second Feigenbaum constant.

But this system doesn't know how to translate it as a constant. It was translated as a general letter.

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic

Test expression: (HurwitzZeta[s, \[Alpha]])-(L*(0 , \[Alpha], s))

ERROR:

{
    "result": "ERROR",
    "testTitle": "Simple",
    "testExpression": null,
    "resultExpression": null,
    "wasAborted": false,
    "conditionallySuccessful": false
}

Test expression: (L*(0 , \[Alpha], s))-(\[CapitalPhi]*(1 , s , \[Alpha]))

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: \Hurwitzzeta [\Hurwitzzeta]

Tests

Symbolic
Numeric

Maple

Translation: Zeta(0, s, alpha) = L(0 , alpha , s) = Phi(1 , s , alpha)

Information

Sub Equations

  • Zeta(0, s, alpha) = L(0 , alpha , s)
  • L(0 , alpha , s) = Phi(1 , s , alpha)

Free variables

  • Phi
  • alpha
  • s

Symbol info

  • Hurwitz zeta function; Example: \Hurwitzzeta@{s}{a}

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

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Could be the second Feigenbaum constant.

But this system doesn't know how to translate it as a constant. It was translated as a general letter.

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Is part of

Complete translation information:

{
  "id" : "FORMULA_3fddad6c5f5388922c1fa7f2addc324b",
  "formula" : "\\zeta(s,\\alpha)=L(0, \\alpha,s)=\\Phi(1,s,\\alpha)",
  "semanticFormula" : "\\Hurwitzzeta@{s}{\\alpha} = L(0 , \\alpha , s) = \\Phi(1 , s , \\alpha)",
  "confidence" : 0.671477154905952,
  "translations" : {
    "Mathematica" : {
      "translation" : "HurwitzZeta[s, \\[Alpha]] == L[0 , \\[Alpha], s] == \\[CapitalPhi][1 , s , \\[Alpha]]",
      "translationInformation" : {
        "subEquations" : [ "HurwitzZeta[s, \\[Alpha]] = L[0 , \\[Alpha], s]", "L[0 , \\[Alpha], s] = \\[CapitalPhi][1 , s , \\[Alpha]]" ],
        "freeVariables" : [ "\\[Alpha]", "\\[CapitalPhi]", "s" ],
        "tokenTranslations" : {
          "\\Hurwitzzeta" : "Hurwitz zeta function; Example: \\Hurwitzzeta@{s}{a}\nWill be translated to: HurwitzZeta[$0, $1]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/25.11#E1\nMathematica:  https://reference.wolfram.com/language/ref/HurwitzZeta.html",
          "L" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\alpha" : "Could be the second Feigenbaum constant.\nBut this system doesn't know how to translate it as a constant. It was translated as a general letter.\n",
          "\\Phi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
        }
      },
      "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" : "HurwitzZeta[s, \\[Alpha]]",
          "rhs" : "L*(0 , \\[Alpha], s)",
          "testExpression" : "(HurwitzZeta[s, \\[Alpha]])-(L*(0 , \\[Alpha], s))",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        }, {
          "lhs" : "L*(0 , \\[Alpha], s)",
          "rhs" : "\\[CapitalPhi]*(1 , s , \\[Alpha])",
          "testExpression" : "(L*(0 , \\[Alpha], s))-(\\[CapitalPhi]*(1 , s , \\[Alpha]))",
          "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: \\Hurwitzzeta [\\Hurwitzzeta]"
        }
      }
    },
    "Maple" : {
      "translation" : "Zeta(0, s, alpha) = L(0 , alpha , s) = Phi(1 , s , alpha)",
      "translationInformation" : {
        "subEquations" : [ "Zeta(0, s, alpha) = L(0 , alpha , s)", "L(0 , alpha , s) = Phi(1 , s , alpha)" ],
        "freeVariables" : [ "Phi", "alpha", "s" ],
        "tokenTranslations" : {
          "\\Hurwitzzeta" : "Hurwitz zeta function; Example: \\Hurwitzzeta@{s}{a}\nWill be translated to: Zeta(0, $0, $1)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/25.11#E1\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Zeta",
          "L" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\alpha" : "Could be the second Feigenbaum constant.\nBut this system doesn't know how to translate it as a constant. It was translated as a general letter.\n",
          "\\Phi" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
        }
      }
    }
  },
  "positions" : [ ],
  "includes" : [ "\\Phi(z,s,a)", "L(\\lambda, \\alpha, s)", "s", "\\,\\zeta(s,\\alpha)=L(0, \\alpha,s)=\\Phi(1,s,\\alpha)" ],
  "isPartOf" : [ "\\,\\zeta(s,\\alpha)=L(0, \\alpha,s)=\\Phi(1,s,\\alpha)" ],
  "definiens" : [ ]
}

Specify your own input