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 \operatorname{Si}(ix) = i\operatorname{Shi}(x).}

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

Semantic latex: \sinint@{\iunit x} = \iunit \operatorname{Shi}(x)

Confidence: 0.88116631009685

Mathematica

Translation: SinIntegral[I*x] == I*Shi[x]

Information

Sub Equations

  • SinIntegral[I*x] = I*Shi[x]

Free variables

  • x

Symbol info

  • Was interpreted as a function call because of a leading \operatorname.
  • Imaginary unit was translated to: I
  • Sine integral; Example: \sinint@{z}

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

Tests

Symbolic

Test expression: (SinIntegral[I*x])-(I*Shi[x])

ERROR:

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

SymPy

Translation:

Information

Symbol info

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

Tests

Symbolic
Numeric

Maple

Translation: Si(I*x) = I*Shi(x)

Information

Sub Equations

  • Si(I*x) = I*Shi(x)

Free variables

  • x

Symbol info

  • Was interpreted as a function call because of a leading \operatorname.
  • Imaginary unit was translated to: I
  • Sine integral; Example: \sinint@{z}

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

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • ordinary sine

Complete translation information:

{
  "id" : "FORMULA_0feb8031b89a9707b164163ec50265f0",
  "formula" : "\\operatorname{Si}(ix) = i\\operatorname{Shi}(x)",
  "semanticFormula" : "\\sinint@{\\iunit x} = \\iunit \\operatorname{Shi}(x)",
  "confidence" : 0.8811663100968549,
  "translations" : {
    "Mathematica" : {
      "translation" : "SinIntegral[I*x] == I*Shi[x]",
      "translationInformation" : {
        "subEquations" : [ "SinIntegral[I*x] = I*Shi[x]" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "Shi" : "Was interpreted as a function call because of a leading \\operatorname.",
          "\\iunit" : "Imaginary unit was translated to: I",
          "\\sinint" : "Sine integral; Example: \\sinint@{z}\nWill be translated to: SinIntegral[$0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/6.2#E9\nMathematica:  https://reference.wolfram.com/language/ref/SinIntegral.html"
        }
      },
      "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" : "SinIntegral[I*x]",
          "rhs" : "I*Shi[x]",
          "testExpression" : "(SinIntegral[I*x])-(I*Shi[x])",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        } ]
      }
    },
    "SymPy" : {
      "translation" : "",
      "translationInformation" : {
        "tokenTranslations" : {
          "Error" : "(LaTeX -> SymPy) No translation possible for given token: Cannot extract information from feature set: \\sinint [\\sinint]"
        }
      }
    },
    "Maple" : {
      "translation" : "Si(I*x) = I*Shi(x)",
      "translationInformation" : {
        "subEquations" : [ "Si(I*x) = I*Shi(x)" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "Shi" : "Was interpreted as a function call because of a leading \\operatorname.",
          "\\iunit" : "Imaginary unit was translated to: I",
          "\\sinint" : "Sine integral; Example: \\sinint@{z}\nWill be translated to: Si($0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/6.2#E9\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=Si"
        }
      }
    }
  },
  "positions" : [ {
    "section" : 3,
    "sentence" : 1,
    "word" : 9
  } ],
  "includes" : [ "Si", "Si(x)", "x" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "ordinary sine",
    "score" : 0.6859086196238077
  } ]
}

Specify your own input