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 \mathbf{E}_\nu(z)=\frac{1}{\pi} \int_0^\pi \sin (\nu\theta-z\sin\theta) \,d\theta}

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

Semantic latex: \WeberE{\nu}@{z} = \frac{1}{\cpi} \int_0^{\cpi} \sin(\nu \theta - z \sin \theta) \diff{\theta}

Confidence: 0.6615186698232

Mathematica

Translation: WeberE[\[Nu], z] == Divide[1,Pi]*Integrate[Sin[\[Nu]*\[Theta]- z*Sin[\[Theta]]], {\[Theta], 0, Pi}, GenerateConditions->None]

Information

Sub Equations

  • WeberE[\[Nu], z] = Divide[1,Pi]*Integrate[Sin[\[Nu]*\[Theta]- z*Sin[\[Theta]]], {\[Theta], 0, Pi}, GenerateConditions->None]

Free variables

  • \[Nu]
  • z

Symbol info

  • Weber function; Example: \WeberE{v}@{z}

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

  • Pi was translated to: Pi
  • 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: (WeberE[\[Nu], z])-(Divide[1,Pi]*Integrate[Sin[\[Nu]*\[Theta]- z*Sin[\[Theta]]], {\[Theta], 0, Pi}, 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: \WeberE [\WeberE]

Tests

Symbolic
Numeric

Maple

Translation: WeberE(nu, z) = (1)/(Pi)*int(sin(nu*theta - z*sin(theta)), theta = 0..Pi)

Information

Sub Equations

  • WeberE(nu, z) = (1)/(Pi)*int(sin(nu*theta - z*sin(theta)), theta = 0..Pi)

Free variables

  • nu
  • z

Symbol info

  • Weber function; Example: \WeberE{v}@{z}

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

  • Pi was translated to: Pi
  • 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

Is part of

Complete translation information:

{
  "id" : "FORMULA_60a97a1a6695b198c985e613d2b53061",
  "formula" : "\\mathbf{E}_\\nu(z)=\\frac{1}{\\pi} \\int_0^\\pi \\sin (\\nu\\theta-z\\sin\\theta) d\\theta",
  "semanticFormula" : "\\WeberE{\\nu}@{z} = \\frac{1}{\\cpi} \\int_0^{\\cpi} \\sin(\\nu \\theta - z \\sin \\theta) \\diff{\\theta}",
  "confidence" : 0.6615186698232001,
  "translations" : {
    "Mathematica" : {
      "translation" : "WeberE[\\[Nu], z] == Divide[1,Pi]*Integrate[Sin[\\[Nu]*\\[Theta]- z*Sin[\\[Theta]]], {\\[Theta], 0, Pi}, GenerateConditions->None]",
      "translationInformation" : {
        "subEquations" : [ "WeberE[\\[Nu], z] = Divide[1,Pi]*Integrate[Sin[\\[Nu]*\\[Theta]- z*Sin[\\[Theta]]], {\\[Theta], 0, Pi}, GenerateConditions->None]" ],
        "freeVariables" : [ "\\[Nu]", "z" ],
        "tokenTranslations" : {
          "\\WeberE" : "Weber function; Example: \\WeberE{v}@{z}\nWill be translated to: WeberE[$0, $1]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/11.10#E2\nMathematica:  https://reference.wolfram.com/language/ref/WeberE.html",
          "\\cpi" : "Pi was translated to: Pi",
          "\\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" : "WeberE[\\[Nu], z]",
          "rhs" : "Divide[1,Pi]*Integrate[Sin[\\[Nu]*\\[Theta]- z*Sin[\\[Theta]]], {\\[Theta], 0, Pi}, GenerateConditions->None]",
          "testExpression" : "(WeberE[\\[Nu], z])-(Divide[1,Pi]*Integrate[Sin[\\[Nu]*\\[Theta]- z*Sin[\\[Theta]]], {\\[Theta], 0, Pi}, 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: \\WeberE [\\WeberE]"
        }
      }
    },
    "Maple" : {
      "translation" : "WeberE(nu, z) = (1)/(Pi)*int(sin(nu*theta - z*sin(theta)), theta = 0..Pi)",
      "translationInformation" : {
        "subEquations" : [ "WeberE(nu, z) = (1)/(Pi)*int(sin(nu*theta - z*sin(theta)), theta = 0..Pi)" ],
        "freeVariables" : [ "nu", "z" ],
        "tokenTranslations" : {
          "\\WeberE" : "Weber function; Example: \\WeberE{v}@{z}\nWill be translated to: WeberE($0, $1)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/11.10#E2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=AngerJ",
          "\\cpi" : "Pi was translated to: Pi",
          "\\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" : [ "\\mathbf{E}_\\nu(z)=\\frac{1}{\\pi} \\int_0^\\pi \\sin (\\nu\\theta-z\\sin\\theta) \\,d\\theta", "\\mathbf{J}_{\\nu}", "J_{\\nu}", "\\nu" ],
  "isPartOf" : [ "\\mathbf{E}_\\nu(z)=\\frac{1}{\\pi} \\int_0^\\pi \\sin (\\nu\\theta-z\\sin\\theta) \\,d\\theta" ],
  "definiens" : [ ]
}

Specify your own input