Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix x^y for the case when x is zero. #414

Merged
merged 1 commit into from Oct 24, 2019

Conversation

andreasnoack
Copy link
Member

@andreasnoack andreasnoack commented Oct 14, 2019

Currently, the derivative in the exponent is wrong then the base is zero, i.e. it gives

julia> (x -> ForwardDiff.derivative(y -> x^y,  0.5))(0.0)
NaN

even though the limit is well defined. With this PR, it becomes

julia> (x -> ForwardDiff.derivative(y -> x^y,  0.5))(0.0)
0.0

@andreasnoack
Copy link
Member Author

andreasnoack commented Oct 15, 2019

Hm. I can't reproduce the Windows error. Tried both Julia 1.0 and 1.2 and tests pass in my VirtualBox.

@KristofferC
Copy link
Collaborator

KristofferC commented Oct 16, 2019

Yeah, it has happened for quite a long time.

@andreasnoack
Copy link
Member Author

Bump

src/dual.jl Outdated Show resolved Hide resolved
@andreasnoack
Copy link
Member Author

I'd appreciate a release with this fix.

@KristofferC
Copy link
Collaborator

Yeah but someone needs to add a Project file.

@andreasnoack
Copy link
Member Author

I see. I can do that.

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.

None yet

3 participants