I'm trying to implement an equation into a programming language which doesn't have functions for integrals. However as it's many years since I've had any math exercise I'm having some trouble understanding how I can simplify the following equation.
$$\mathrm{erf}(x) = \frac{1}{\sqrt{\pi}} \int_{-x}^x e^{-t^2} dt.$$
As an example would it be correct to refactor the equation as follows?
$$\frac{1}{\sqrt{\pi}} \cdot \left(x \cdot e^{-x^2}+(-x) \cdot e^{x^2}\right)$$
Please forgive me if I'm completely off target! As I said, it's been quite a few years since I've had integrals.