-
Notifications
You must be signed in to change notification settings - Fork 3
Alterations
An alteration allows the user to define calculation options through the different steps of an operation.
There are two types of alterations, modifiers and cancellers.
The IO modification system formats the different inputs (before a calculation) and outputs (after a calculation) provided.
The library provides the following modifiers (by default) :
- Significant digits amount (output)
After performing binary operations (+-*/^), the result may have too many significant digits. This alteration will round the result if that is the case. The value of the maximum allowed digits can be changed at runtime.
- Angles unit conversion: degrees-radians-gradients (input)
By default, the trigonometric operations are performed assuming the angles are given in radians. If chosen, the effect will convert (if possible) the angle value found to radians.
The canceling system, as its name suggests, checks whether an input (before a calculation) cannot (or does not need) to be calculated. It might be extremely helpful if some results do not need to be expanded or reduced the most. For instance, it can choose whether the division 5/3
must be performed, or if it should remain in its actual state since it is an irreducible fraction.
The library provides the following cancellers (by default) :
- Numeric exponents expansion limit
It decides what the maximal exponent is before canceling the pow calculation. If set to 3 for instance,
(x+y)^3
will be expanded asx^3 + 3x^2y + 3xy^2 + y^3
, whereas(x+y)^4
will remain(x+y)^4
- Calculation cache
To avoid repeating the same calculation several times, the cache stores the result of any operation concerning one or more expressions. In case the same calculation has already been performed (which is checked before computing any result), the cache will be able to provide the correct result faster, which will increase performances.