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 F_2(a,b_1,b_2;c_1,c_2;x,y) = \sum_{r=0}^\infty \frac{(a)_r (b_1)_r (b_2)_r} {(c_1)_r (c_2)_r r!} \,x^r y^r {}_2F_{1}\left(a+r,b_1+r;c_1+r;x\right){}_2F_{1}\left(a+r,b_2+r;c_2+r;y\right)~.}

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

Semantic latex: F_2(a , b_1 , b_2 ; c_1 , c_2 ; x , y) = \sum_{r=0}^\infty \frac{(a)_r (b_1)_r (b_2)_r} {(c_1)_r (c_2)_r r!} x^r y^r \genhyperF{2}{1}@{a + r , b_1 + r}{c_1 + r}{x} \genhyperF{2}{1}@{a + r , b_2 + r}{c_2 + r}{y}

Confidence: 0.44235989214356

Mathematica

Translation: Subscript[F, 2][a , Subscript[b, 1], Subscript[b, 2]; Subscript[c, 1], Subscript[c, 2]; x , y] == Sum[Divide[Subscript[a, r]*Subscript[Subscript[b, 1], r]*Subscript[Subscript[b, 2], r],Subscript[Subscript[c, 1], r]*Subscript[Subscript[c, 2], r]*(r)!]*(x)^(r)* (y)^(r)* HypergeometricPFQ[{a + r , Subscript[b, 1]+ r}, {Subscript[c, 1]+ r}, x]*HypergeometricPFQ[{a + r , Subscript[b, 2]+ r}, {Subscript[c, 2]+ r}, y], {r, 0, Infinity}, GenerateConditions->None]

Information

Sub Equations

  • Subscript[F, 2][a , Subscript[b, 1], Subscript[b, 2]; Subscript[c, 1], Subscript[c, 2]; x , y] = Sum[Divide[Subscript[a, r]*Subscript[Subscript[b, 1], r]*Subscript[Subscript[b, 2], r],Subscript[Subscript[c, 1], r]*Subscript[Subscript[c, 2], r]*(r)!]*(x)^(r)* (y)^(r)* HypergeometricPFQ[{a + r , Subscript[b, 1]+ r}, {Subscript[c, 1]+ r}, x]*HypergeometricPFQ[{a + r , Subscript[b, 2]+ r}, {Subscript[c, 2]+ r}, y], {r, 0, Infinity}, GenerateConditions->None]

Free variables

  • Subscript[b, 1]
  • Subscript[b, 2]
  • Subscript[c, 1]
  • Subscript[c, 2]
  • a
  • x
  • y

Symbol info

  • Generalized hypergeometric function; Example: \genhyperF{p}{q}@@@{a_1,...,a_p}{b_1,...,b_q}{z}

Will be translated to: HypergeometricPFQ[{$2}, {$3}, $4] Relevant links to definitions: DLMF: http://dlmf.nist.gov/16.2#E1 Mathematica: https://reference.wolfram.com/language/ref/HypergeometricPFQ.html

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

Tests

Symbolic
Numeric

SymPy

Translation:

Information

Symbol info

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

Tests

Symbolic
Numeric

Maple

Translation: F[2](a , b[1], b[2]; c[1], c[2]; x , y) = sum((a[r]*b[1][r]*b[2][r])/(c[1][r]*c[2][r]*factorial(r))*(x)^(r)* (y)^(r)* hypergeom([a + r , b[1]+ r], [c[1]+ r], x)*hypergeom([a + r , b[2]+ r], [c[2]+ r], y), r = 0..infinity)

Information

Sub Equations

  • F[2](a , b[1], b[2]; c[1], c[2]; x , y) = sum((a[r]*b[1][r]*b[2][r])/(c[1][r]*c[2][r]*factorial(r))*(x)^(r)* (y)^(r)* hypergeom([a + r , b[1]+ r], [c[1]+ r], x)*hypergeom([a + r , b[2]+ r], [c[2]+ r], y), r = 0..infinity)

Free variables

  • a
  • b[1]
  • b[2]
  • c[1]
  • c[2]
  • x
  • y

Symbol info

  • Generalized hypergeometric function; Example: \genhyperF{p}{q}@@@{a_1,...,a_p}{b_1,...,b_q}{z}

Will be translated to: hypergeom([$2], [$3], $4) Relevant links to definitions: DLMF: http://dlmf.nist.gov/16.2#E1 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=hypergeom

  • 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_55b5058ee38754aa0a5680f97615c428",
  "formula" : "F_2(a,b_1,b_2;c_1,c_2;x,y) = \\sum_{r=0}^\\infty \\frac{(a)_r (b_1)_r (b_2)_r} {(c_1)_r (c_2)_r r!} x^r y^r {}_2F_{1}\\left(a+r,b_1+r;c_1+r;x\\right){}_2F_{1}\\left(a+r,b_2+r;c_2+r;y\\right)~",
  "semanticFormula" : "F_2(a , b_1 , b_2 ; c_1 , c_2 ; x , y) = \\sum_{r=0}^\\infty \\frac{(a)_r (b_1)_r (b_2)_r} {(c_1)_r (c_2)_r r!} x^r y^r \\genhyperF{2}{1}@{a + r , b_1 + r}{c_1 + r}{x} \\genhyperF{2}{1}@{a + r , b_2 + r}{c_2 + r}{y}",
  "confidence" : 0.44235989214355975,
  "translations" : {
    "Mathematica" : {
      "translation" : "Subscript[F, 2][a , Subscript[b, 1], Subscript[b, 2]; Subscript[c, 1], Subscript[c, 2]; x , y] == Sum[Divide[Subscript[a, r]*Subscript[Subscript[b, 1], r]*Subscript[Subscript[b, 2], r],Subscript[Subscript[c, 1], r]*Subscript[Subscript[c, 2], r]*(r)!]*(x)^(r)* (y)^(r)* HypergeometricPFQ[{a + r , Subscript[b, 1]+ r}, {Subscript[c, 1]+ r}, x]*HypergeometricPFQ[{a + r , Subscript[b, 2]+ r}, {Subscript[c, 2]+ r}, y], {r, 0, Infinity}, GenerateConditions->None]",
      "translationInformation" : {
        "subEquations" : [ "Subscript[F, 2][a , Subscript[b, 1], Subscript[b, 2]; Subscript[c, 1], Subscript[c, 2]; x , y] = Sum[Divide[Subscript[a, r]*Subscript[Subscript[b, 1], r]*Subscript[Subscript[b, 2], r],Subscript[Subscript[c, 1], r]*Subscript[Subscript[c, 2], r]*(r)!]*(x)^(r)* (y)^(r)* HypergeometricPFQ[{a + r , Subscript[b, 1]+ r}, {Subscript[c, 1]+ r}, x]*HypergeometricPFQ[{a + r , Subscript[b, 2]+ r}, {Subscript[c, 2]+ r}, y], {r, 0, Infinity}, GenerateConditions->None]" ],
        "freeVariables" : [ "Subscript[b, 1]", "Subscript[b, 2]", "Subscript[c, 1]", "Subscript[c, 2]", "a", "x", "y" ],
        "tokenTranslations" : {
          "\\genhyperF" : "Generalized hypergeometric function; Example: \\genhyperF{p}{q}@@@{a_1,...,a_p}{b_1,...,b_q}{z}\nWill be translated to: HypergeometricPFQ[{$2}, {$3}, $4]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/16.2#E1\nMathematica:  https://reference.wolfram.com/language/ref/HypergeometricPFQ.html",
          "F" : "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" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    },
    "SymPy" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \\genhyperF [\\genhyperF]"
        }
      },
      "numericResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "wasAborted" : false,
        "crashed" : false,
        "testCalculationsGroups" : [ ]
      },
      "symbolicResults" : {
        "overallResult" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    },
    "Maple" : {
      "translation" : "F[2](a , b[1], b[2]; c[1], c[2]; x , y) = sum((a[r]*b[1][r]*b[2][r])/(c[1][r]*c[2][r]*factorial(r))*(x)^(r)* (y)^(r)* hypergeom([a + r , b[1]+ r], [c[1]+ r], x)*hypergeom([a + r , b[2]+ r], [c[2]+ r], y), r = 0..infinity)",
      "translationInformation" : {
        "subEquations" : [ "F[2](a , b[1], b[2]; c[1], c[2]; x , y) = sum((a[r]*b[1][r]*b[2][r])/(c[1][r]*c[2][r]*factorial(r))*(x)^(r)* (y)^(r)* hypergeom([a + r , b[1]+ r], [c[1]+ r], x)*hypergeom([a + r , b[2]+ r], [c[2]+ r], y), r = 0..infinity)" ],
        "freeVariables" : [ "a", "b[1]", "b[2]", "c[1]", "c[2]", "x", "y" ],
        "tokenTranslations" : {
          "\\genhyperF" : "Generalized hypergeometric function; Example: \\genhyperF{p}{q}@@@{a_1,...,a_p}{b_1,...,b_q}{z}\nWill be translated to: hypergeom([$2], [$3], $4)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/16.2#E1\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=hypergeom",
          "F" : "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" : "SKIPPED",
        "numberOfTests" : 0,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 0,
        "crashed" : false,
        "testCalculationsGroup" : [ ]
      }
    }
  },
  "positions" : [ ],
  "includes" : [ "y", "F_{1}", "_{2}F_{1}", "F_{2}", "F_2(a,b_1,b_2;c_1,c_2;x,y) = \\sum_{r=0}^\\infty \\frac{(a)_r (b_1)_r (b_2)_r} {(c_1)_r (c_2)_r r!} \\,x^r y^r {}_2F_{1}\\left(a+r,b_1+r;c_1+r;x\\right){}_2F_{1}\\left(a+r,b_2+r;c_2+r;y\\right)", "F", "x" ],
  "isPartOf" : [ "F_2(a,b_1,b_2;c_1,c_2;x,y) = \\sum_{r=0}^\\infty \\frac{(a)_r (b_1)_r (b_2)_r} {(c_1)_r (c_2)_r r!} \\,x^r y^r {}_2F_{1}\\left(a+r,b_1+r;c_1+r;x\\right){}_2F_{1}\\left(a+r,b_2+r;c_2+r;y\\right)" ],
  "definiens" : [ ]
}

Specify your own input