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{Li}(x)-\pi(x) = O(\sqrt{x}\log x)}

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

Semantic latex: \operatorname{Li}(x) - \cpi(x) = O(\sqrt{x} \log x)

Confidence: 0

Mathematica

Translation: Li[x]- Pi*(x) == O[Sqrt[x]*Log[x]]

Information

Sub Equations

  • Li[x]- Pi*(x) = O[Sqrt[x]*Log[x]]

Free variables

  • x

Symbol info

  • Pi was translated to: Pi
  • Logarithm; Example: \log@@{z}

Will be translated to: Log[$0] Constraints: z != 0 Branch Cuts: (-\infty, 0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.2#E2 Mathematica: https://reference.wolfram.com/language/ref/Log.html

  • Was interpreted as a function call because of a leading \operatorname.
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic

Test expression: (Li[x]- Pi*(x))-(O*(Sqrt[x]*Log[x]))

ERROR:

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

SymPy

Translation: Li(x)- pi*(x) == O(sqrt(x)*log(x))

Information

Sub Equations

  • Li(x)- pi*(x) = O(sqrt(x)*log(x))

Free variables

  • x

Symbol info

  • Pi was translated to: pi
  • Logarithm; Example: \log@@{z}

Will be translated to: log($0) Constraints: z != 0 Branch Cuts: (-\infty, 0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.2#E2 SymPy: https://docs.sympy.org/latest/modules/functions/elementary.html#log

  • Was interpreted as a function call because of a leading \operatorname.
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic
Numeric

Maple

Translation: Li(x)- Pi*(x) = O(sqrt(x)*log(x))

Information

Sub Equations

  • Li(x)- Pi*(x) = O(sqrt(x)*log(x))

Free variables

  • x

Symbol info

  • Pi was translated to: Pi
  • Logarithm; Example: \log@@{z}

Will be translated to: log($0) Constraints: z != 0 Branch Cuts: (-\infty, 0] Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.2#E2 Maple: https://www.maplesoft.com/support/help/maple/view.aspx?path=log

  • Was interpreted as a function call because of a leading \operatorname.
  • Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • Riemann hypothesis

Complete translation information:

{
  "id" : "FORMULA_6b793e4d0f471b93f67b784fad45bec9",
  "formula" : "\\operatorname{Li}(x)-\\pi(x) = O(\\sqrt{x}\\log x)",
  "semanticFormula" : "\\operatorname{Li}(x) - \\cpi(x) = O(\\sqrt{x} \\log x)",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "Li[x]- Pi*(x) == O[Sqrt[x]*Log[x]]",
      "translationInformation" : {
        "subEquations" : [ "Li[x]- Pi*(x) = O[Sqrt[x]*Log[x]]" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "\\cpi" : "Pi was translated to: Pi",
          "\\log" : "Logarithm; Example: \\log@@{z}\nWill be translated to: Log[$0]\nConstraints: z != 0\nBranch Cuts: (-\\infty, 0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/4.2#E2\nMathematica:  https://reference.wolfram.com/language/ref/Log.html",
          "Li" : "Was interpreted as a function call because of a leading \\operatorname.",
          "O" : "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" : "ERROR",
        "numberOfTests" : 1,
        "numberOfFailedTests" : 0,
        "numberOfSuccessfulTests" : 0,
        "numberOfSkippedTests" : 0,
        "numberOfErrorTests" : 1,
        "crashed" : false,
        "testCalculationsGroup" : [ {
          "lhs" : "Li[x]- Pi*(x)",
          "rhs" : "O*(Sqrt[x]*Log[x])",
          "testExpression" : "(Li[x]- Pi*(x))-(O*(Sqrt[x]*Log[x]))",
          "testCalculations" : [ {
            "result" : "ERROR",
            "testTitle" : "Simple",
            "testExpression" : null,
            "resultExpression" : null,
            "wasAborted" : false,
            "conditionallySuccessful" : false
          } ]
        } ]
      }
    },
    "SymPy" : {
      "translation" : "Li(x)- pi*(x) == O(sqrt(x)*log(x))",
      "translationInformation" : {
        "subEquations" : [ "Li(x)- pi*(x) = O(sqrt(x)*log(x))" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "\\cpi" : "Pi was translated to: pi",
          "\\log" : "Logarithm; Example: \\log@@{z}\nWill be translated to: log($0)\nConstraints: z != 0\nBranch Cuts: (-\\infty, 0]\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/4.2#E2\nSymPy: https://docs.sympy.org/latest/modules/functions/elementary.html#log",
          "Li" : "Was interpreted as a function call because of a leading \\operatorname.",
          "O" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
        }
      }
    },
    "Maple" : {
      "translation" : "Li(x)- Pi*(x) = O(sqrt(x)*log(x))",
      "translationInformation" : {
        "subEquations" : [ "Li(x)- Pi*(x) = O(sqrt(x)*log(x))" ],
        "freeVariables" : [ "x" ],
        "tokenTranslations" : {
          "\\cpi" : "Pi was translated to: Pi",
          "\\log" : "Logarithm; Example: \\log@@{z}\nWill be translated to: log($0)\nConstraints: z != 0\nBranch Cuts: (-\\infty, 0]\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/4.2#E2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=log",
          "Li" : "Was interpreted as a function call because of a leading \\operatorname.",
          "O" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
        }
      }
    }
  },
  "positions" : [ {
    "section" : 6,
    "sentence" : 2,
    "word" : 11
  } ],
  "includes" : [ "\\pi(x)", "x)", "x", "O" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "Riemann hypothesis",
    "score" : 0.6460746792928004
  } ]
}

Specify your own input