Open
Description
The following MWE demonstrates a case where expand_derivatives
returns a floating point constant instead of a rational:
julia> using Symbolics
julia> @variables a x
2-element Vector{Num}:
a
x
julia> ex = exp(a*x)/(2a)
exp(a*x) / (2a)
julia> D = Differential(x)
Differential(x)
julia> expand_derivatives(D(D(ex)))
0.5a*exp(a*x)
Note that expanding the derivative of the manual input of the result of the inner derivative correctly uses an rational:
julia> expand_derivatives(D(ex))
exp(a*x) / 2
julia> expand_derivatives(D(exp(a*x)/2))
(1//2)*a*exp(a*x)
This is likely because the manual input gets automatically changed to
Tested with Symbolics v6.22.1
and v6.10.0
.
Metadata
Metadata
Assignees
Labels
No labels