eval

Modified: 2009/10/30 09:43 by omorr - Categorized as: English
eval('expression') - Converts analytic expression to the numeric notation.

SMath uses its symbolic engine and most of the function can be obtained in either analytic or numeric notation. Those functions can be evaluated by either symbolic "→" or numeric equal to "=" operators. If the numeric "=" is used, the result is presented in floating point notation, but first the expression is calculated symbolicaly. Sometimes this might be very time consuming and the speed of calculation can be reduced drastically. If we need just numerical values, eval function could be used in order to avoid symbolic calculation, and the calculation speed could be increased significantly.

EXAMPLE:

See the example which uses eval (see the calculation time).

eval1

If you point the particular expression, you will also see the result of symbolic calculation (in the form of tooltip). Compare the symbolic (tooltip) and numeric notation (obtained with "=")

Now, compare the calculation time for the same example without eval. Moreover, pointing on the expression will give the tooltip that the expression is to large to be visualised.

eval2

Finally, to clarify this we will simplify the above calculation and we could see how the symbolic calculation could be very complicated.

eval3

ScrewTurn Wiki version 2.0.37. Some of the icons created by FamFamFam.