# [Tex/LaTex] Converting mathematical TeX expressions

conversionequationsoutputprogramming

Is there a (hopefully simple) way to convert a mathematical TeX expression, such as \frac{\cos(x^2) - x}{x^2 + 1}, to expressions which you would use in a programming language? The outcome of the example should be (cos(x^2) - x)/(x^2 + 1).

It also works with cos corrected to \cos