Skip to content

Conversation

saschatimme
Copy link
Contributor

This adds logic to simplify constant in order to get rid of silly things like

julia> Differential(x)(Differential(x)((x-2)^2)) |> expand_derivatives |> simplified_expr
(x-2) ^ ((2-1)-1) * 2

Now this just returns

julia> Differential(x)(Differential(x)((x-2)^2)) |> expand_derivatives |> simplified_expr
2

Also the third derivative would have errored, but now correctly returns 0.

I know that this will be replaced by smarter rewrite rules at some point but for now I thinks it's not bad to have this.

@codecov
Copy link

codecov bot commented Jul 29, 2019

Codecov Report

Merging #159 into master will increase coverage by 0.14%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #159      +/-   ##
==========================================
+ Coverage   92.69%   92.84%   +0.14%     
==========================================
  Files          12       12              
  Lines         452      461       +9     
==========================================
+ Hits          419      428       +9     
  Misses         33       33
Impacted Files Coverage Δ
src/simplify.jl 93.87% <100%> (+1.37%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 42aafd5...02c5397. Read the comment docs.

@ChrisRackauckas ChrisRackauckas merged commit dab9126 into SciML:master Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants