Arithmetic expressions are a compact notation for combining arithmetic operations that go together. An arithmetic expression results in a numeric result.
The operations that can be combined are the binary arithmetic operations and unary arithmetic operations.
^
+
and -
*
, /
, mod
+
and -
An expression is evaluated depth-first with the left branch chosen before the right.
All expressions are converted to a sequence of single operations before a computer can evaluate them.
Equivalent evaluations are evaluations that cause the same result within the maximum allowed loss of precision.
Each operation in an expression can cause loss of precsision. The field of mathematics that contains the theory for this is the Calculus of Errors.
The loss of precision in an arithmetic expression is the precision lost when the expression is evaluated depth-first with the left branch chosen before the right. Each operation looses precision accoring to the Calculus of Erros.
Two values A
and B
have approximations a
and b
with errors Δa
and Δb
.
Operation | Absolute Error Bounds |
---|---|
a + b | Δa + Δb |
a - b | Δa + Δb |
a * b | Δa*abs(b) + Δb*abs(a) |
a / b | (Δa*abs(b) + Δb*abs(a))/b^2 |
a ^ b | Δa*abs(b*a^(n-1)) |
Error bounds, both absolute and relative, for all arithmetic operations available in the Progsbase system are available in the literature of the Calculus of Errors.
For more information about error bounds, check out the literature of the calculus of erros.
For more information about T-Tables and T-Forms, see T-Tables.
The T-Table of
-x^2 + 3*x - 2
is
Expression | Operation |
---|---|
-x^2 + 3*x - 2 | |
-t1 + 3*x - 2 | t1 = x ^ 2 |
t2 + 3*x - 2 | t2 = -t1 |
t2 + t3 - 2 | t3 = 3 * x |
t4 - 2 | t4 = t2 + t3 |
t5 | t5 = t4 - 2 |
The T-Table of
(-x)^2
is
Expression | Operation |
---|---|
(-x)^2 | |
t1^2 | t1 = -x |
t2 | t2 = t1 ^ 2 |
We would be more than happy to help you. Our opening hours are 9–15 (CET).
📞 (+47) 93 68 22 77
Nils Bays vei 50, 0876 Oslo, Norway