When applied to a function f(x) = constant, the method getVariables
would not find any, as the search is performed on the function's
definition.
Thus, when using the "Fill with formula" tool in Statistics, if the
formula to fill V1 is "V1=f(V2)", the formula will be considered
constant and applied to all values in V1. However, if V1 is longer than
V2, the program will attempt to read undefined values of V2.
With this change, the formula will only be applied to lines in V1 for
which there is a corresponding line in V2.
The method getVariables would not correctly remove the parameter from
the list of variables.
e.g. In the expression "box+y×int(z,x,0,1)", when trying to remove x
from the list of variables, the letter x would be removed from the name
"box" instead.
With deepReduce(), when a simplifiaction was interrupted, expression could
contain Undefined children, which would trigger the assert in
removeUnit(). With reduce(), if a simplification is interrupted, the
entire expression becomes Undefined, which is handled by removeUnits().
Units derived from kelvin (mK, cK, ...) were handled like Celsius and
Fahrenheit, causing a bug where multiplications such as 2*pi*_cK to
simplify as undef.
Because of the limitations of the floating-point representation, e^x is
null for x <= 710, causing the nextRoot functions to find roots for it.
To prevent this, we looking for places where a function changes sign, we
actually require the function to take two non-null values of different
signs.
This method is used to remove extraneous empty sapce in the middle of
the window for functions that are discontinuous between their points of
interest.
To find the optimal range with a specified ratio, we compute the values
of the function on a default range, then center the Y axis to display
the maximum number of points of the function.
Unreal's derivate method returns true, to signify that it is unchanged
by the derivation operation. This implementation mostly exists for
documentation, as an Unreal derivand will be handled by the
defaultShallowReduce method.
The general formula for deriving a power makes use of the logarithm,
which often disappears at simplification. However, replacing the symbol
before simplifying can lead to applying an invalid argument to the
logarithm, making the whole expression invalid.
e.g. diff(1/x,x,-2)
If x is replaced by -2 before reducing the power derivative, ln(-2)
will reduce to Unreal, as will the rest of the expression.
The classic differentiation forumals for trigonometric functions assume
a variable in radians. A multiplicative constant must be added when
another unit is used.
Change-Id: Iec428acd7d93e415fddb184300437ae09d1d997c
The logarithm function is undefined for negative numbers, but its
derivative, the inverse function, is defined everywhere. We thus need to
virtually limit the domain of definition of the derivative.
Functions with a single point of inerest used to be drawn on a tiny
interval around this point.
Now, an orthonormal window is built around the point of interest, giving
a much nicer view.
Change-Id: I7793797aead2695532ddea44d93d62bb7ef870f4
When looking for extrema in a function, we need to discard results where
the function growth rate is smaller than the precision of the float type
itself : these results are likely to be too noisy, and can cause false
positives.
e.g. : The sqrt(x^2+1)-x function
Change-Id: I6e2c002d7308b41a4c226d274cbb5d9efe4ea7db