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 xp_n(x)=p_{n+1}(x)+i(A_n+C_n)p_{n}(x)-A_{n-1}C_n p_{n-1}(x),}

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

Semantic latex: xp_n(x) = p_{n+1}(x) + \iunit(A_n + C_n) p_{n}(x) - A_{n-1} C_n p_{n-1}(x)

Confidence: 0

Mathematica

Translation: Subscript[xp, n][x] == Subscript[p, n + 1][x]+ I*(Subscript[A, n]+ Subscript[C, n])*Subscript[p, n][x]- Subscript[A, n - 1]*Subscript[C, n]*Subscript[p, n - 1][x]

Information

Sub Equations

  • Subscript[xp, n][x] = Subscript[p, n + 1][x]+ I*(Subscript[A, n]+ Subscript[C, n])*Subscript[p, n][x]- Subscript[A, n - 1]*Subscript[C, n]*Subscript[p, n - 1][x]

Free variables

  • Subscript[A, n - 1]
  • Subscript[A, n]
  • Subscript[C, n]
  • n
  • x

Symbol info

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Imaginary unit was translated to: I

Tests

Symbolic
Numeric

SymPy

Translation: Symbol('{xp}_{n}')(x) == Symbol('{p}_{n + 1}')(x)+ I*(Symbol('{A}_{n}')+ Symbol('{C}_{n}'))*Symbol('{p}_{n}')(x)- Symbol('{A}_{n - 1}')*Symbol('{C}_{n}')*Symbol('{p}_{n - 1}')(x)

Information

Sub Equations

  • Symbol('{xp}_{n}')(x) = Symbol('{p}_{n + 1}')(x)+ I*(Symbol('{A}_{n}')+ Symbol('{C}_{n}'))*Symbol('{p}_{n}')(x)- Symbol('{A}_{n - 1}')*Symbol('{C}_{n}')*Symbol('{p}_{n - 1}')(x)

Free variables

  • Symbol('{A}_{n - 1}')
  • Symbol('{A}_{n}')
  • Symbol('{C}_{n}')
  • n
  • x

Symbol info

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Imaginary unit was translated to: I

Tests

Symbolic
Numeric

Maple

Translation: xp[n](x) = p[n + 1](x)+ I*(A[n]+ C[n])*p[n](x)- A[n - 1]*C[n]*p[n - 1](x)

Information

Sub Equations

  • xp[n](x) = p[n + 1](x)+ I*(A[n]+ C[n])*p[n](x)- A[n - 1]*C[n]*p[n - 1](x)

Free variables

  • A[n - 1]
  • A[n]
  • C[n]
  • n
  • x

Symbol info

  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
  • Imaginary unit was translated to: I

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • recurrence relation
  • sequence of continuous Hahn polynomial

Complete translation information:

{
  "id" : "FORMULA_166b4811dcc6c823927e177830b44819",
  "formula" : "xp_n(x)=p_{n+1}(x)+i(A_n+C_n)p_{n}(x)-A_{n-1}C_n p_{n-1}(x)",
  "semanticFormula" : "xp_n(x) = p_{n+1}(x) + \\iunit(A_n + C_n) p_{n}(x) - A_{n-1} C_n p_{n-1}(x)",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "Subscript[xp, n][x] == Subscript[p, n + 1][x]+ I*(Subscript[A, n]+ Subscript[C, n])*Subscript[p, n][x]- Subscript[A, n - 1]*Subscript[C, n]*Subscript[p, n - 1][x]",
      "translationInformation" : {
        "subEquations" : [ "Subscript[xp, n][x] = Subscript[p, n + 1][x]+ I*(Subscript[A, n]+ Subscript[C, n])*Subscript[p, n][x]- Subscript[A, n - 1]*Subscript[C, n]*Subscript[p, n - 1][x]" ],
        "freeVariables" : [ "Subscript[A, n - 1]", "Subscript[A, n]", "Subscript[C, n]", "n", "x" ],
        "tokenTranslations" : {
          "p" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "xp" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\iunit" : "Imaginary unit was translated to: I"
        }
      },
      "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" : "Symbol('{xp}_{n}')(x) == Symbol('{p}_{n + 1}')(x)+ I*(Symbol('{A}_{n}')+ Symbol('{C}_{n}'))*Symbol('{p}_{n}')(x)- Symbol('{A}_{n - 1}')*Symbol('{C}_{n}')*Symbol('{p}_{n - 1}')(x)",
      "translationInformation" : {
        "subEquations" : [ "Symbol('{xp}_{n}')(x) = Symbol('{p}_{n + 1}')(x)+ I*(Symbol('{A}_{n}')+ Symbol('{C}_{n}'))*Symbol('{p}_{n}')(x)- Symbol('{A}_{n - 1}')*Symbol('{C}_{n}')*Symbol('{p}_{n - 1}')(x)" ],
        "freeVariables" : [ "Symbol('{A}_{n - 1}')", "Symbol('{A}_{n}')", "Symbol('{C}_{n}')", "n", "x" ],
        "tokenTranslations" : {
          "p" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "xp" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\iunit" : "Imaginary unit was translated to: I"
        }
      },
      "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" : "xp[n](x) = p[n + 1](x)+ I*(A[n]+ C[n])*p[n](x)- A[n - 1]*C[n]*p[n - 1](x)",
      "translationInformation" : {
        "subEquations" : [ "xp[n](x) = p[n + 1](x)+ I*(A[n]+ C[n])*p[n](x)- A[n - 1]*C[n]*p[n - 1](x)" ],
        "freeVariables" : [ "A[n - 1]", "A[n]", "C[n]", "n", "x" ],
        "tokenTranslations" : {
          "p" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "xp" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "\\iunit" : "Imaginary unit was translated to: I"
        }
      },
      "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" : [ {
    "section" : 2,
    "sentence" : 0,
    "word" : 10
  } ],
  "includes" : [ "F_{n}" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "recurrence relation",
    "score" : 0.722
  }, {
    "definition" : "sequence of continuous Hahn polynomial",
    "score" : 0.6859086196238077
  } ]
}

Specify your own input