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 P_n^{(\alpha, \beta)} (-z) = (-1)^n P_n^{(\beta, \alpha)} (z);}

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

Semantic latex: \JacobipolyP{\alpha}{\beta}{n}@{- z} =(- 1)^n \JacobipolyP{\beta}{\alpha}{n}@{z}

Confidence: 0.89530287320794

Mathematica

Translation: JacobiP[n, \[Alpha], \[Beta], - z] == (- 1)^(n)* JacobiP[n, \[Beta], \[Alpha], z]

Information

Sub Equations

  • JacobiP[n, \[Alpha], \[Beta], - z] = (- 1)^(n)* JacobiP[n, \[Beta], \[Alpha], z]

Free variables

  • \[Alpha]
  • \[Beta]
  • n
  • z

Symbol info

  • Jacobi polynomial; Example: \JacobipolyP{\alpha}{\beta}{n}@{x}

Will be translated to: JacobiP[$2, $0, $1, $3] Relevant links to definitions: DLMF: http://dlmf.nist.gov/18.3#T1.t1.r2 Mathematica: https://reference.wolfram.com/language/ref/JacobiP.html?q=JacobiP

  • Could be the second Feigenbaum constant.

But this system doesn't know how to translate it as a constant. It was translated as a general letter.

Tests

Symbolic

Test expression: (JacobiP[n, \[Alpha], \[Beta], - z])-((- 1)^(n)* JacobiP[n, \[Beta], \[Alpha], z])

ERROR:

{
    "result": "ERROR",
    "testTitle": "Simple",
    "testExpression": null,
    "resultExpression": null,
    "wasAborted": false,
    "conditionallySuccessful": false
}
Numeric

SymPy

Translation: jacobi(n, Symbol('alpha'), Symbol('beta'), - z) == (- 1)**(n)* jacobi(n, Symbol('beta'), Symbol('alpha'), z)

Information

Sub Equations

  • jacobi(n, Symbol('alpha'), Symbol('beta'), - z) = (- 1)**(n)* jacobi(n, Symbol('beta'), Symbol('alpha'), z)

Free variables

  • Symbol('alpha')
  • Symbol('beta')
  • n
  • z

Symbol info

  • Jacobi polynomial; Example: \JacobipolyP{\alpha}{\beta}{n}@{x}

Will be translated to: jacobi($2, $0, $1, $3) Relevant links to definitions: DLMF: http://dlmf.nist.gov/18.3#T1.t1.r2 SymPy: https://docs.sympy.org/latest/modules/functions/special.html#jacobi-polynomials

  • Could be the second Feigenbaum constant.

But this system doesn't know how to translate it as a constant. It was translated as a general letter.

Tests

Symbolic
Numeric

Maple

Translation: JacobiP(n, alpha, beta, - z) = (- 1)^(n)* JacobiP(n, beta, alpha, z)

Information

Sub Equations

  • JacobiP(n, alpha, beta, - z) = (- 1)^(n)* JacobiP(n, beta, alpha, z)

Free variables

  • alpha
  • beta
  • n
  • z

Symbol info

  • Jacobi polynomial; Example: \JacobipolyP{\alpha}{\beta}{n}@{x}

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

  • Could be the second Feigenbaum constant.

But this system doesn't know how to translate it as a constant. It was translated as a general letter.

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • symmetry relation
  • polynomial
  • other terminal value

Complete translation information:

{
  "id" : "FORMULA_324997ff1bef2ad1ea296179286ee476",
  "formula" : "P_n^{(\\alpha, \\beta)} (-z) = (-1)^n P_n^{(\\beta, \\alpha)} (z)",
  "semanticFormula" : "\\JacobipolyP{\\alpha}{\\beta}{n}@{- z} =(- 1)^n \\JacobipolyP{\\beta}{\\alpha}{n}@{z}",
  "confidence" : 0.8953028732079359,
  "translations" : {
    "Mathematica" : {
      "translation" : "JacobiP[n, \\[Alpha], \\[Beta], - z] == (- 1)^(n)* JacobiP[n, \\[Beta], \\[Alpha], z]",
      "translationInformation" : {
        "subEquations" : [ "JacobiP[n, \\[Alpha], \\[Beta], - z] = (- 1)^(n)* JacobiP[n, \\[Beta], \\[Alpha], z]" ],
        "freeVariables" : [ "\\[Alpha]", "\\[Beta]", "n", "z" ],
        "tokenTranslations" : {
          "\\JacobipolyP" : "Jacobi polynomial; Example: \\JacobipolyP{\\alpha}{\\beta}{n}@{x}\nWill be translated to: JacobiP[$2, $0, $1, $3]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/18.3#T1.t1.r2\nMathematica:  https://reference.wolfram.com/language/ref/JacobiP.html?q=JacobiP",
          "\\alpha" : "Could be the second Feigenbaum constant.\nBut this system doesn't know how to translate it as a constant. It was translated as a general letter.\n"
        }
      },
      "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" : "JacobiP[n, \\[Alpha], \\[Beta], - z]",
          "rhs" : "(- 1)^(n)* JacobiP[n, \\[Beta], \\[Alpha], z]",
          "testExpression" : "(JacobiP[n, \\[Alpha], \\[Beta], - z])-((- 1)^(n)* JacobiP[n, \\[Beta], \\[Alpha], z])",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        } ]
      }
    },
    "SymPy" : {
      "translation" : "jacobi(n, Symbol('alpha'), Symbol('beta'), - z) == (- 1)**(n)* jacobi(n, Symbol('beta'), Symbol('alpha'), z)",
      "translationInformation" : {
        "subEquations" : [ "jacobi(n, Symbol('alpha'), Symbol('beta'), - z) = (- 1)**(n)* jacobi(n, Symbol('beta'), Symbol('alpha'), z)" ],
        "freeVariables" : [ "Symbol('alpha')", "Symbol('beta')", "n", "z" ],
        "tokenTranslations" : {
          "\\JacobipolyP" : "Jacobi polynomial; Example: \\JacobipolyP{\\alpha}{\\beta}{n}@{x}\nWill be translated to: jacobi($2, $0, $1, $3)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/18.3#T1.t1.r2\nSymPy: https://docs.sympy.org/latest/modules/functions/special.html#jacobi-polynomials",
          "\\alpha" : "Could be the second Feigenbaum constant.\nBut this system doesn't know how to translate it as a constant. It was translated as a general letter.\n"
        }
      }
    },
    "Maple" : {
      "translation" : "JacobiP(n, alpha, beta, - z) = (- 1)^(n)* JacobiP(n, beta, alpha, z)",
      "translationInformation" : {
        "subEquations" : [ "JacobiP(n, alpha, beta, - z) = (- 1)^(n)* JacobiP(n, beta, alpha, z)" ],
        "freeVariables" : [ "alpha", "beta", "n", "z" ],
        "tokenTranslations" : {
          "\\JacobipolyP" : "Jacobi polynomial; Example: \\JacobipolyP{\\alpha}{\\beta}{n}@{x}\nWill be translated to: JacobiP($2, $0, $1, $3)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/18.3#T1.t1.r2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=JacobiP",
          "\\alpha" : "Could be the second Feigenbaum constant.\nBut this system doesn't know how to translate it as a constant. It was translated as a general letter.\n"
        }
      }
    }
  },
  "positions" : [ {
    "section" : 6,
    "sentence" : 0,
    "word" : 6
  } ],
  "includes" : [ "P_{n}^{(\\alpha, \\beta)}(x)", "n", "P_{n}^{(\\alpha, \\beta)}", "\\alpha,\\beta", "z" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "symmetry relation",
    "score" : 0.722
  }, {
    "definition" : "polynomial",
    "score" : 0.6859086196238077
  }, {
    "definition" : "other terminal value",
    "score" : 0.6460746792928004
  } ]
}

Specify your own input