Skip to content

Add max, min, and abs.#11

Merged
jrevels merged 2 commits intoJuliaDiff:masterfrom
willtebbutt:more-diffrules
Mar 14, 2018
Merged

Add max, min, and abs.#11
jrevels merged 2 commits intoJuliaDiff:masterfrom
willtebbutt:more-diffrules

Conversation

@willtebbutt
Copy link
Member

What the title says.

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) )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. Will make the change.

@willtebbutt
Copy link
Member Author

@jrevels requested changes made. Is there anything else you would like to happen prior to merging?

@jrevels
Copy link
Member

jrevels commented Mar 14, 2018

Nope, sorry for the delay. Thanks!

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