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 D_+(x) = F(x) = \frac{\sqrt{\pi}}{2} \operatorname{Im}[ w(x) ]}

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

Semantic latex: D_+(x) = F(x) = \frac{\sqrt{\cpi}}{2} \imagpart@@{[w(x)]}

Confidence: 0.61221509839463

Mathematica

Translation: Subscript[D, +][x] == F[x] == Divide[Sqrt[Pi],2]*Im[w[x]]

Information

Sub Equations

  • Subscript[D, +][x] = F[x]
  • F[x] = Divide[Sqrt[Pi],2]*Im[w[x]]

Free variables

  • x

Symbol info

  • Imaginary part of a complex num; Example: \imagpart@@{z}

Will be translated to: Im[$0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.9#E2 Mathematica: https://reference.wolfram.com/language/ref/Im.html

  • Pi was translated to: Pi
  • 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).
  • 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: \imagpart [\imagpart]

Tests

Symbolic
Numeric

Maple

Translation: D[+](x) = F(x) = (sqrt(Pi))/(2)*Im(w(x))

Information

Sub Equations

  • D[+](x) = F(x)
  • F(x) = (sqrt(Pi))/(2)*Im(w(x))

Free variables

  • x

Symbol info

  • Imaginary part of a complex num; Example: \imagpart@@{z}

Will be translated to: Im($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/1.9#E2 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Im

  • Pi was translated to: Pi
  • 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).
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • entire complex plane
  • Dawson function
  • term
  • erfi
  • Faddeeva function

Complete translation information:

{
  "id" : "FORMULA_fd275547ee92555872fe674fd38ec826",
  "formula" : "D_+(x) = F(x) = \\frac{\\sqrt{\\pi}}{2} \\operatorname{Im}[ w(x) ]",
  "semanticFormula" : "D_+(x) = F(x) = \\frac{\\sqrt{\\cpi}}{2} \\imagpart@@{[w(x)]}",
  "confidence" : 0.6122150983946287,
  "translations" : {
    "Mathematica" : {
      "translation" : "Subscript[D, +][x] == F[x] == Divide[Sqrt[Pi],2]*Im[w[x]]",
      "translationInformation" : {
        "subEquations" : [ "Subscript[D, +][x] = F[x]", "F[x] = Divide[Sqrt[Pi],2]*Im[w[x]]" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "\\imagpart" : "Imaginary part of a complex num; Example: \\imagpart@@{z}\nWill be translated to: Im[$0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/1.9#E2\nMathematica:  https://reference.wolfram.com/language/ref/Im.html",
          "\\cpi" : "Pi was translated to: Pi",
          "D" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "F" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "w" : "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: \\imagpart [\\imagpart]"
        }
      },
      "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" : "D[+](x) = F(x) = (sqrt(Pi))/(2)*Im(w(x))",
      "translationInformation" : {
        "subEquations" : [ "D[+](x) = F(x)", "F(x) = (sqrt(Pi))/(2)*Im(w(x))" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "\\imagpart" : "Imaginary part of a complex num; Example: \\imagpart@@{z}\nWill be translated to: Im($0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/1.9#E2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Im",
          "\\cpi" : "Pi was translated to: Pi",
          "D" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "F" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary).",
          "w" : "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" : [ {
    "section" : 1,
    "sentence" : 4,
    "word" : 28
  } ],
  "includes" : [ "w(z)", "F(x)", "x", "F(y)" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "entire complex plane",
    "score" : 0.6460746792928004
  }, {
    "definition" : "Dawson function",
    "score" : 0.5500952380952381
  }, {
    "definition" : "term",
    "score" : 0.5500952380952381
  }, {
    "definition" : "erfi",
    "score" : 0.5049074255814494
  }, {
    "definition" : "Faddeeva function",
    "score" : 0.46655930748162855
  } ]
}

Specify your own input