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 z\mathbf{E}_{\nu-1}(z)+z\mathbf{E}_{\nu+1}(z)=2\nu\mathbf{E}_\nu(z)-\frac{2(1-\cos\pi\nu)}{\pi}}

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

Semantic latex: z \WeberE{\nu-1}@{z} + z \WeberE{\nu+1}@{z} = 2 \nu \WeberE{\nu}@{z} - \frac{2(1 - \cos \cpi \nu)}{\cpi}

Confidence: 0.87629473436744

Mathematica

Translation: z*WeberE[\[Nu]- 1, z]+ z*WeberE[\[Nu]+ 1, z] == 2*\[Nu]*WeberE[\[Nu], z]-Divide[2*(1 - Cos[Pi]*\[Nu]),Pi]

Information

Sub Equations

  • z*WeberE[\[Nu]- 1, z]+ z*WeberE[\[Nu]+ 1, z] = 2*\[Nu]*WeberE[\[Nu], z]-Divide[2*(1 - Cos[Pi]*\[Nu]),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 Mathematica: https://reference.wolfram.com/language/ref/WeberE.html

  • 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

  • Pi was translated to: Pi

Tests

Symbolic

Test expression: (z*WeberE[\[Nu]- 1, z]+ z*WeberE[\[Nu]+ 1, z])-(2*\[Nu]*WeberE[\[Nu], z]-Divide[2*(1 - Cos[Pi]*\[Nu]),Pi])

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: z*WeberE(nu - 1, z)+ z*WeberE(nu + 1, z) = 2*nu*WeberE(nu, z)-(2*(1 - cos(Pi)*nu))/(Pi)

Information

Sub Equations

  • z*WeberE(nu - 1, z)+ z*WeberE(nu + 1, z) = 2*nu*WeberE(nu, z)-(2*(1 - cos(Pi)*nu))/(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

  • 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

  • Pi was translated to: Pi

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • inhomogeneous form of recurrence relation
  • Weber function
  • Anger function

Complete translation information:

{
  "id" : "FORMULA_8a261214ed88171f69105f81baa1a6c2",
  "formula" : "z\\mathbf{E}_{\\nu-1}(z)+z\\mathbf{E}_{\\nu+1}(z)=2\\nu\\mathbf{E}_\\nu(z)-\\frac{2(1-\\cos\\pi\\nu)}{\\pi}",
  "semanticFormula" : "z \\WeberE{\\nu-1}@{z} + z \\WeberE{\\nu+1}@{z} = 2 \\nu \\WeberE{\\nu}@{z} - \\frac{2(1 - \\cos \\cpi \\nu)}{\\cpi}",
  "confidence" : 0.8762947343674413,
  "translations" : {
    "Mathematica" : {
      "translation" : "z*WeberE[\\[Nu]- 1, z]+ z*WeberE[\\[Nu]+ 1, z] == 2*\\[Nu]*WeberE[\\[Nu], z]-Divide[2*(1 - Cos[Pi]*\\[Nu]),Pi]",
      "translationInformation" : {
        "subEquations" : [ "z*WeberE[\\[Nu]- 1, z]+ z*WeberE[\\[Nu]+ 1, z] = 2*\\[Nu]*WeberE[\\[Nu], z]-Divide[2*(1 - Cos[Pi]*\\[Nu]),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\nMathematica:  https://reference.wolfram.com/language/ref/WeberE.html",
          "\\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",
          "\\cpi" : "Pi was translated to: Pi"
        }
      },
      "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" : "z*WeberE[\\[Nu]- 1, z]+ z*WeberE[\\[Nu]+ 1, z]",
          "rhs" : "2*\\[Nu]*WeberE[\\[Nu], z]-Divide[2*(1 - Cos[Pi]*\\[Nu]),Pi]",
          "testExpression" : "(z*WeberE[\\[Nu]- 1, z]+ z*WeberE[\\[Nu]+ 1, z])-(2*\\[Nu]*WeberE[\\[Nu], z]-Divide[2*(1 - Cos[Pi]*\\[Nu]),Pi])",
          "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" : "z*WeberE(nu - 1, z)+ z*WeberE(nu + 1, z) = 2*nu*WeberE(nu, z)-(2*(1 - cos(Pi)*nu))/(Pi)",
      "translationInformation" : {
        "subEquations" : [ "z*WeberE(nu - 1, z)+ z*WeberE(nu + 1, z) = 2*nu*WeberE(nu, z)-(2*(1 - cos(Pi)*nu))/(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",
          "\\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",
          "\\cpi" : "Pi was translated to: Pi"
        }
      }
    }
  },
  "positions" : [ {
    "section" : 4,
    "sentence" : 0,
    "word" : 22
  } ],
  "includes" : [ "J_{\\nu}", "\\mathbf{J}_{\\nu}", "\\nu" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "inhomogeneous form of recurrence relation",
    "score" : 0.8869384888466118
  }, {
    "definition" : "Weber function",
    "score" : 0.6288842031023242
  }, {
    "definition" : "Anger function",
    "score" : 0.5329047619047619
  } ]
}

Specify your own input