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 S_{\mu,\nu}(z) = s_{\mu,\nu}(z) + 2^{\mu-1} \Gamma\left(\frac{\mu + \nu + 1}{2}\right) \Gamma\left(\frac{\mu - \nu + 1}{2}\right) \left(\sin \left[(\mu - \nu)\frac{\pi}{2}\right] J_\nu(z) - \cos \left[(\mu - \nu)\frac{\pi}{2}\right] Y_\nu(z)\right).}

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

Semantic latex: \LommelS{\mu}{\nu}@{z} = \Lommels{\mu}{\nu}@{z} + 2^{\mu-1} \Gamma(\frac{\mu + \nu + 1}{2}) \Gamma(\frac{\mu - \nu + 1}{2})(\sin [(\mu - \nu) \frac{\cpi}{2}] \BesselJ{\nu}@{z} - \cos [(\mu - \nu) \frac{\cpi}{2}] \BesselY{\nu}@{z})

Confidence: 0.66574815190614

Mathematica

Translation:

Information

Symbol info

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

Tests

Symbolic
Numeric

SymPy

Translation:

Information

Symbol info

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

Tests

Symbolic
Numeric

Maple

Translation: LommelS2(mu, nu, z) = LommelS1(mu, nu, z)+ (2)^(mu - 1)* Gamma((mu + nu + 1)/(2))* Gamma((mu - nu + 1)/(2))*(sin((mu - nu)*(Pi)/(2))*BesselJ(nu, z)- cos((mu - nu)*(Pi)/(2))*BesselY(nu, z))

Information

Sub Equations

  • LommelS2(mu, nu, z) = LommelS1(mu, nu, z)+ (2)^(mu - 1)* Gamma((mu + nu + 1)/(2))* Gamma((mu - nu + 1)/(2))*(sin((mu - nu)*(Pi)/(2))*BesselJ(nu, z)- cos((mu - nu)*(Pi)/(2))*BesselY(nu, z))

Free variables

  • Gamma
  • mu
  • nu
  • z

Symbol info

  • 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

  • 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

  • Bessel function second kind; Example: \BesselY{v}@{z}

Will be translated to: BesselY($0, $1) Branch Cuts: (-\infty, 0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/10.2#E3 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Bessel

  • Pi was translated to: Pi
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Lommel S; Example: \LommelS{\mu}{\nu}@{z}

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

  • Lommel s; Example: \Lommels{\mu}{\nu}@{z}

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

  • Bessel function first kind; Example: \BesselJ{v}@{z}

Will be translated to: BesselJ($0, $1) Branch Cuts: if v \notin \Integers: (-\infty, 0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/10.2#E2 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Bessel

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Is part of

Complete translation information:

{
  "id" : "FORMULA_734b5b78e01f5709242507d69dd083ba",
  "formula" : "S_{\\mu,\\nu}(z) = s_{\\mu,\\nu}(z) + 2^{\\mu-1} \\Gamma\\left(\\frac{\\mu + \\nu + 1}{2}\\right) \\Gamma\\left(\\frac{\\mu - \\nu + 1}{2}\\right)\n\\left(\\sin \\left[(\\mu - \\nu)\\frac{\\pi}{2}\\right] J_\\nu(z) - \\cos \\left[(\\mu - \\nu)\\frac{\\pi}{2}\\right] Y_\\nu(z)\\right)",
  "semanticFormula" : "\\LommelS{\\mu}{\\nu}@{z} = \\Lommels{\\mu}{\\nu}@{z} + 2^{\\mu-1} \\Gamma(\\frac{\\mu + \\nu + 1}{2}) \\Gamma(\\frac{\\mu - \\nu + 1}{2})(\\sin [(\\mu - \\nu) \\frac{\\cpi}{2}] \\BesselJ{\\nu}@{z} - \\cos [(\\mu - \\nu) \\frac{\\cpi}{2}] \\BesselY{\\nu}@{z})",
  "confidence" : 0.6657481519061363,
  "translations" : {
    "Mathematica" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> Mathematica) No translation possible for given token: Cannot extract information from feature set: \\LommelS [\\LommelS]"
        }
      }
    },
    "SymPy" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \\LommelS [\\LommelS]"
        }
      }
    },
    "Maple" : {
      "translation" : "LommelS2(mu, nu, z) = LommelS1(mu, nu, z)+ (2)^(mu - 1)* Gamma((mu + nu + 1)/(2))* Gamma((mu - nu + 1)/(2))*(sin((mu - nu)*(Pi)/(2))*BesselJ(nu, z)- cos((mu - nu)*(Pi)/(2))*BesselY(nu, z))",
      "translationInformation" : {
        "subEquations" : [ "LommelS2(mu, nu, z) = LommelS1(mu, nu, z)+ (2)^(mu - 1)* Gamma((mu + nu + 1)/(2))* Gamma((mu - nu + 1)/(2))*(sin((mu - nu)*(Pi)/(2))*BesselJ(nu, z)- cos((mu - nu)*(Pi)/(2))*BesselY(nu, z))" ],
        "freeVariables" : [ "Gamma", "mu", "nu", "z" ],
        "tokenTranslations" : {
          "\\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",
          "\\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",
          "\\BesselY" : "Bessel function second kind; Example: \\BesselY{v}@{z}\nWill be translated to: BesselY($0, $1)\nBranch Cuts: (-\\infty, 0]\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/10.2#E3\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Bessel",
          "\\cpi" : "Pi was translated to: Pi",
          "\\Gamma" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\LommelS" : "Lommel S; Example: \\LommelS{\\mu}{\\nu}@{z}\nWill be translated to: LommelS2($0, $1, $2)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/11.9#E5\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=LommelS2",
          "\\Lommels" : "Lommel s; Example: \\Lommels{\\mu}{\\nu}@{z}\nWill be translated to: LommelS1($0, $1, $2)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/11.9#E3\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=LommelS1",
          "\\BesselJ" : "Bessel function first kind; Example: \\BesselJ{v}@{z}\nWill be translated to: BesselJ($0, $1)\nBranch Cuts: if v \\notin \\Integers: (-\\infty, 0]\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/10.2#E2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Bessel"
        }
      }
    }
  },
  "positions" : [ ],
  "includes" : [ "J_{\\nu}(z)", "s_{\\mu,\\nu}(z)", "Y_{\\nu}(z)", "S_{\\mu,\\nu}(z)", "S_{\\mu,\\nu}(z) = s_{\\mu,\\nu}(z) + 2^{\\mu-1} \\Gamma\\left(\\frac{\\mu + \\nu + 1}{2}\\right) \\Gamma\\left(\\frac{\\mu - \\nu + 1}{2}\\right)\\left(\\sin \\left[(\\mu - \\nu)\\frac{\\pi}{2}\\right] J_\\nu(z) - \\cos \\left[(\\mu - \\nu)\\frac{\\pi}{2}\\right] Y_\\nu(z)\\right)" ],
  "isPartOf" : [ "S_{\\mu,\\nu}(z) = s_{\\mu,\\nu}(z) + 2^{\\mu-1} \\Gamma\\left(\\frac{\\mu + \\nu + 1}{2}\\right) \\Gamma\\left(\\frac{\\mu - \\nu + 1}{2}\\right)\\left(\\sin \\left[(\\mu - \\nu)\\frac{\\pi}{2}\\right] J_\\nu(z) - \\cos \\left[(\\mu - \\nu)\\frac{\\pi}{2}\\right] Y_\\nu(z)\\right)" ],
  "definiens" : [ ]
}

Specify your own input