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 \cos(\theta) = (m_2 - m_3)/(l_2 + l_3 + 1)}

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

Semantic latex: \cos(\theta) = (m_2 - m_3)/(l_2 + l_3 + 1)

Confidence: 0

Mathematica

Translation: Cos[(\[Theta]) ] == (Subscript[m, 2]- Subscript[m, 3])/(Subscript[l, 2]+ Subscript[l, 3]+ 1)

Information

Sub Equations

  • Cos[(\[Theta]) ] = (Subscript[m, 2]- Subscript[m, 3])/(Subscript[l, 2]+ Subscript[l, 3]+ 1)

Free variables

  • Subscript[l, 2]
  • Subscript[l, 3]
  • Subscript[m, 2]
  • Subscript[m, 3]
  • \[Theta]

Symbol info

  • Cosine; Example: \cos@@{z}

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

Tests

Symbolic
Numeric

SymPy

Translation: cos((Symbol('theta')) ) == (Symbol('{m}_{2}')- Symbol('{m}_{3}'))/(Symbol('{l}_{2}')+ Symbol('{l}_{3}')+ 1)

Information

Sub Equations

  • cos((Symbol('theta')) ) = (Symbol('{m}_{2}')- Symbol('{m}_{3}'))/(Symbol('{l}_{2}')+ Symbol('{l}_{3}')+ 1)

Free variables

  • Symbol('theta')
  • Symbol('{l}_{2}')
  • Symbol('{l}_{3}')
  • Symbol('{m}_{2}')
  • Symbol('{m}_{3}')

Symbol info

  • Cosine; Example: \cos@@{z}

Will be translated to: cos($0) Relevant links to definitions: DLMF: http://dlmf.nist.gov/4.14#E2 SymPy: https://docs.sympy.org/latest/modules/functions/elementary.html#cos

Tests

Symbolic
Numeric

Maple

Translation: cos((theta) ) = (m[2]- m[3])/(l[2]+ l[3]+ 1)

Information

Sub Equations

  • cos((theta) ) = (m[2]- m[3])/(l[2]+ l[3]+ 1)

Free variables

  • l[2]
  • l[3]
  • m[2]
  • m[3]
  • theta

Symbol info

  • Cosine; Example: \cos@@{z}

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

Tests

Symbolic
Numeric

Dependency Graph Information

Includes

Description

  • better approximation
  • Regge symmetry

Complete translation information:

{
  "id" : "FORMULA_1b16f31c90217c067bc20ca5baae1546",
  "formula" : "\\cos(\\theta) = (m_2 - m_3)/(l_2 + l_3 + 1)",
  "semanticFormula" : "\\cos(\\theta) = (m_2 - m_3)/(l_2 + l_3 + 1)",
  "confidence" : 0.0,
  "translations" : {
    "Mathematica" : {
      "translation" : "Cos[(\\[Theta]) ] == (Subscript[m, 2]- Subscript[m, 3])/(Subscript[l, 2]+ Subscript[l, 3]+ 1)",
      "translationInformation" : {
        "subEquations" : [ "Cos[(\\[Theta]) ] = (Subscript[m, 2]- Subscript[m, 3])/(Subscript[l, 2]+ Subscript[l, 3]+ 1)" ],
        "freeVariables" : [ "Subscript[l, 2]", "Subscript[l, 3]", "Subscript[m, 2]", "Subscript[m, 3]", "\\[Theta]" ],
        "tokenTranslations" : {
          "\\cos" : "Cosine; Example: \\cos@@{z}\nWill be translated to: Cos[$0]\nRelevant links to definitions:\nDLMF:         http://dlmf.nist.gov/4.14#E2\nMathematica:  https://reference.wolfram.com/language/ref/Cos.html"
        }
      },
      "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" : "cos((Symbol('theta')) ) == (Symbol('{m}_{2}')- Symbol('{m}_{3}'))/(Symbol('{l}_{2}')+ Symbol('{l}_{3}')+ 1)",
      "translationInformation" : {
        "subEquations" : [ "cos((Symbol('theta')) ) = (Symbol('{m}_{2}')- Symbol('{m}_{3}'))/(Symbol('{l}_{2}')+ Symbol('{l}_{3}')+ 1)" ],
        "freeVariables" : [ "Symbol('theta')", "Symbol('{l}_{2}')", "Symbol('{l}_{3}')", "Symbol('{m}_{2}')", "Symbol('{m}_{3}')" ],
        "tokenTranslations" : {
          "\\cos" : "Cosine; Example: \\cos@@{z}\nWill be translated to: cos($0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/4.14#E2\nSymPy: https://docs.sympy.org/latest/modules/functions/elementary.html#cos"
        }
      },
      "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" : "cos((theta) ) = (m[2]- m[3])/(l[2]+ l[3]+ 1)",
      "translationInformation" : {
        "subEquations" : [ "cos((theta) ) = (m[2]- m[3])/(l[2]+ l[3]+ 1)" ],
        "freeVariables" : [ "l[2]", "l[3]", "m[2]", "m[3]", "theta" ],
        "tokenTranslations" : {
          "\\cos" : "Cosine; Example: \\cos@@{z}\nWill be translated to: cos($0)\nRelevant links to definitions:\nDLMF:  http://dlmf.nist.gov/4.14#E2\nMaple: https://www.maplesoft.com/support/help/maple/view.aspx?path=cos"
        }
      },
      "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" : 9,
    "sentence" : 1,
    "word" : 14
  } ],
  "includes" : [ "m_{3}", "l_3", "m_{2}", "m", "l_2" ],
  "isPartOf" : [ ],
  "definiens" : [ {
    "definition" : "better approximation",
    "score" : 0.6859086196238077
  }, {
    "definition" : "Regge symmetry",
    "score" : 0.5988174995334326
  } ]
}

Specify your own input