Examples of expressions:
An expression can be constant or nonconstant depending
on whether it contains any identifiers which are not built-in constants,
functions, procedures or internal variables for procedures.
Examples of constant expressions:
Each constant expression has one and same value under any circumstances.
The nonconstant expressions are those which are not constant. They must necessarily contain unknowns. Usually, their value differs depending on the value of the unknown.
Examples of nonconstant expressions:
A nonconstant expression may still have one and same value regardless of the values of the unknowns, e.g.
Expressions may contain:
|
|
|
| identifier expected | Illegal sequence of symbols |
| expression expected | Illegal sequence of symbols |
| operator expected | Illegal sequence of symbols |
| too many ')' | Mismatch of the number of opening and closing brackets |
| too few ')' | Mismatch of the number of opening and closing brackets |
| illegal syntax | General syntax error |
| too many arguments | Wrong number of function arguments |
| too few arguments | Wrong number of function arguments |
| must be function | The parameter name coincides with that of a built-in function |
| must be procedure | The parameter name coincides with that of a built-in procedure |
| unknown function | The function is not a built-in one |
| unknown symbol | Illegal symbol in expression |
| invalid procedure syntax | Procedure syntax incorrect |
| invalid number format | Number entered incorrectly |
|
|
|
|
| NaN (not a number) | Intolerable argument of some library function | ln(-1) |
| Significant digits loss in func | Loss of significant digits in a library function func | sin(1e+50) |
| Illegal n-th argument x in func | Intolerable n-th argument x in the built-in function func | Y(0, -1), Leg(-1, 1, 0.5),
Sn(-2, 2) |
The precedence order is the usual one: raising to a power has the highest priority and is followed by division and multiplication. All the rest is evaluated left to right. However, the user is encouraged to use brackets wherever appropriate to avoid confusion.
Example: a / b * c is understood as (a /
b ) * c. If you wish to have a / (b * c), either
use brackets or write a / b / c (which, in its turn, is
not interpreted as a / (b / c)).
A logical expression is evaluated as 1 if it is true and as 0 if it is false.
The user is encouraged to always use brackets to ensure correct precedence and correct priority with respect to arithmetical operators. In general, arithmetical operators are assigned higher priority than the logical ones.
Examples:
ProcedureName (lowerLimit, upperLimit; variableName, expression)
Note the semicolon after the limits.
Here variableName must be a single identifier, lowerLimit, upperLimit and expression are all expressions. If the expression does not contain identifier variableName, its value will not change during iteration.
There are four built-in procedures: Int (integration), Sum (summation), Root (equation root search) and Opt (optimization, i.e. minimum point search).
For example,
Int (0,1; x, exp(sin(x)))
means integral from 0 to 1 of esin(x)dx; if the upperLimit is less than the lower limit, they are swapped and the sign of the result is changed to the opposite.
Sum (1, 100; i, 2^(-i))
means summation with respect to i from 1 to 100 of 1/2i. The limits don't have to be integers, i is first assigned the lower limit value and then incremented by 1; if the upperLimit is less than the lower limit, they are swapped.
Root (-PI/2, PI/2; t, cos (t)+sin (t))
means the root on [-p/2, p/2] of the equation cos(t)+sin(t)=0. Obviously, say, Root and sqrt (square root) are different things, although
Root (0, 10; x, x^2-78) = sqrt (78).
The equation for which the root is sought
may be written in two different ways: either
as expression1 = expression2 or as expression1 - expression2. In other words, if the equality sign is
omitted, the right hand side is supposed
to be equal to 0.Alternatively, it is possible to say that
the single equality sign is equivalent to
a minus.
Finally,
Opt (0, 4; z, exp(z)-z-1)
means the point at which the function ez-z-1
attains its minimum on [0,4].
Note that the equation solver and optimization can succeed only if the expression is a continuous function.
The Root procedure tries to find at least some root of the equation. If the given interval contains several roots, it is hard to predict which of them would be found. Sometimes, it is not possible to find a root numerically at all although it is clear that a root exists. So do not expect miracles. It is unlikely that the root of a function behaving like x2 can be found by any nonspecific method, unless your interval possesses additional symmetry properties.
For a continuous function, the optimization procedure is guaranteed
to find at least some local extremum. There is however no guarantee that
this extremum will be global for the given interval.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for x>0; for negative noninteger x the definition is extended according to the formula
x any number except 0, -1, -2, ...
a any number except 0, -1, -2, ...
x any number except 0, -1, -2, ...
Integral cosines
where g is the Euler constant, x > 0.
x any nonzero number.
x - modulus square, 0<= x <= 1.
f - amplitude, x - modulus square, 0<=x<=1.
Bessel functions J(n,z) and Y(n,z)
Bessel (cylindric) functionsJ(n,z) and Y(n,z) may be defined as solutions of the equation
Bessel function J(n,z) is the solution of the Bessel equation which is zero at z=0 (for n>0, J(0, 0)=1 ) and has the following behavior at positive infinity:
It admits the following integral representation:
n-integer index, z-argument.
Bessel function Y(n,z) is the solution of the Bessel equation which is singular at z=0 and has the following behavior at positive infinity:
It admits the following integral representation:
n-integer index, z>0-argument
(Modified) Bessel functions I(n,z) and K(n,z)
The modified Bessel functions I(n,z) and K(n,z) may be defined as solutions of the equation
Bessel function I(n,z) is the solution of the modified Bessel equation which is zero at z=0 (for n>0, I(0, 0) = 1 ) and has the following behavior at positive infinity:
It admits the following integral representation:
n-integer index, z-argument
Bessel function K(n,z) (McDonald function) is the solution of the modified Bessel equation which is singular at z=0 and has the following behavior at positive infinity:
It admits the following integral representation:
n-integer index, z>0-argument.
Legendre functions may be defined as solutions of the equation
When m = 0 one non-degenerate solution is the Legendre polynomial:
When m > 0 the solution is given by the formula:
m, n - non-negative integers, m < n, |x| < 1.
Degenerate hypergeometric function F(a,b,z)
is the solution of the equation
which has the following series representation:
a,b,z real, b cannot be a negative integer.
Let u be defined by the implicit formula
Then Jacobi elliptic functions are defined as
u - argument, 0 <= x <= 1, - modulus square.
The following four equations also define the functions uniquely:
Cumulative normal distribution
where m is the mean and s>0 is the deviation.
Cumulative standard normal distribution
Cumulative binormal distribution
for |r| < 1 (r is the correlation of x and y, |r|<= 1 ) and