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

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

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

Confidence: 0.44235989214356

Mathematica

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

Information

Sub Equations

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

Free variables

  • Subscript[b, 1]
  • Subscript[b, 2]
  • a
  • c
  • 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[1](a , b[1], b[2]; c ; x , y) = sum((a[r]*b[1][r]*b[2][r]*c - a[r])/(c + r - 1[r]*c[2*r]*factorial(r))*(x)^(r)* (y)^(r)* hypergeom([a + r , b[1]+ r], [c + 2*r], x)*hypergeom([a + r , b[2]+ r], [c + 2*r], y), r = 0..infinity)

Information

Sub Equations

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

Free variables

  • a
  • b[1]
  • b[2]
  • c
  • 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_9882f39d77d9d2877a654e90028107f2",
  "formula" : "F_1(a,b_1,b_2;c;x,y) = \\sum_{r=0}^\\infty \\frac{(a)_r (b_1)_r (b_2)_r (c-a)_r} {(c+r-1)_r (c)_{2r} r!} x^r y^r {}_2F_{1}\\left(a+r,b_1+r;c+2r;x\\right){}_2F_{1}\\left(a+r,b_2+r;c+2r;y\\right)~",
  "semanticFormula" : "F_1(a , b_1 , b_2 ; c ; x , y) = \\sum_{r=0}^\\infty \\frac{(a)_r (b_1)_r (b_2)_r (c-a)_r} {(c+r-1)_r (c)_{2r} r!} x^r y^r \\genhyperF{2}{1}@{a + r , b_1 + r}{c + 2 r}{x} \\genhyperF{2}{1}@{a + r , b_2 + r}{c + 2 r}{y}",
  "confidence" : 0.44235989214355975,
  "translations" : {
    "Mathematica" : {
      "translation" : "Subscript[F, 1][a , Subscript[b, 1], Subscript[b, 2]; c ; x , y] == Sum[Divide[Subscript[a, r]*Subscript[Subscript[b, 1], r]*Subscript[Subscript[b, 2], r]*Subscript[c - a, r],Subscript[c + r - 1, r]*Subscript[c, 2*r]*(r)!]*(x)^(r)* (y)^(r)* HypergeometricPFQ[{a + r , Subscript[b, 1]+ r}, {c + 2*r}, x]*HypergeometricPFQ[{a + r , Subscript[b, 2]+ r}, {c + 2*r}, y], {r, 0, Infinity}, GenerateConditions->None]",
      "translationInformation" : {
        "subEquations" : [ "Subscript[F, 1][a , Subscript[b, 1], Subscript[b, 2]; c ; x , y] = Sum[Divide[Subscript[a, r]*Subscript[Subscript[b, 1], r]*Subscript[Subscript[b, 2], r]*Subscript[c - a, r],Subscript[c + r - 1, r]*Subscript[c, 2*r]*(r)!]*(x)^(r)* (y)^(r)* HypergeometricPFQ[{a + r , Subscript[b, 1]+ r}, {c + 2*r}, x]*HypergeometricPFQ[{a + r , Subscript[b, 2]+ r}, {c + 2*r}, y], {r, 0, Infinity}, GenerateConditions->None]" ],
        "freeVariables" : [ "Subscript[b, 1]", "Subscript[b, 2]", "a", "c", "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[1](a , b[1], b[2]; c ; x , y) = sum((a[r]*b[1][r]*b[2][r]*c - a[r])/(c + r - 1[r]*c[2*r]*factorial(r))*(x)^(r)* (y)^(r)* hypergeom([a + r , b[1]+ r], [c + 2*r], x)*hypergeom([a + r , b[2]+ r], [c + 2*r], y), r = 0..infinity)",
      "translationInformation" : {
        "subEquations" : [ "F[1](a , b[1], b[2]; c ; x , y) = sum((a[r]*b[1][r]*b[2][r]*c - a[r])/(c + r - 1[r]*c[2*r]*factorial(r))*(x)^(r)* (y)^(r)* hypergeom([a + r , b[1]+ r], [c + 2*r], x)*hypergeom([a + r , b[2]+ r], [c + 2*r], y), r = 0..infinity)" ],
        "freeVariables" : [ "a", "b[1]", "b[2]", "c", "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_1(a,b_1,b_2;c;x,y) = \\sum_{r=0}^\\infty \\frac{(a)_r (b_1)_r (b_2)_r (c-a)_r} {(c+r-1)_r (c)_{2r} r!} \\,x^r y^r {}_2F_{1}\\left(a+r,b_1+r;c+2r;x\\right){}_2F_{1}\\left(a+r,b_2+r;c+2r;y\\right)", "F", "x" ],
  "isPartOf" : [ "F_1(a,b_1,b_2;c;x,y) = \\sum_{r=0}^\\infty \\frac{(a)_r (b_1)_r (b_2)_r (c-a)_r} {(c+r-1)_r (c)_{2r} r!} \\,x^r y^r {}_2F_{1}\\left(a+r,b_1+r;c+2r;x\\right){}_2F_{1}\\left(a+r,b_2+r;c+2r;y\\right)" ],
  "definiens" : [ ]
}

Specify your own input