Add max, min, and abs.#11
Merged
jrevels merged 2 commits intoJuliaDiff:masterfrom Mar 14, 2018
willtebbutt:more-diffrules
Merged
Add max, min, and abs.#11jrevels merged 2 commits intoJuliaDiff:masterfrom willtebbutt:more-diffrules
jrevels merged 2 commits intoJuliaDiff:masterfrom
willtebbutt:more-diffrules
Conversation
jrevels
reviewed
Mar 4, 2018
src/rules.jl
Outdated
| @define_diffrule Base.lgamma(x) = :( digamma($x) ) | ||
| @define_diffrule Base.Math.JuliaLibm.log1p(x) = :( inv($x + 1) ) | ||
| @define_diffrule Base.transpose(x) = :( 1 ) | ||
| @define_diffrule Base.abs(x) = :( $x > 0 ? one($x) : -one($x) ) |
Member
There was a problem hiding this comment.
Should we use signbit instead here (since, e.g. !(-0.0 < 0.0))? At least, this is what ForwardDiff's manual definition currently uses, though IIRC that decision was made fairly arbitrarily at the time...
Member
Author
There was a problem hiding this comment.
That makes sense. Will make the change.
Member
Author
|
@jrevels requested changes made. Is there anything else you would like to happen prior to merging? |
Member
|
Nope, sorry for the delay. Thanks! |
This was referenced Mar 26, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What the title says.