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

Define SpecialFunctions.gamma_inc for ForwardDiff.Dual #587

Merged
merged 4 commits into from
Aug 4, 2022

Conversation

devmotion
Copy link
Member

This PR adds a definition of SpecialFunctions.gamma_inc(::Real, ::Dual, ::Integer).

Similar to logabsgamma (added in #585) this function returns a tuple and hence is not handled by DiffRules.

As in the CR definitions in SpecialFunctions, only the derivatives with respect to the second argument are defined since derivatives wrt to the first argument are given in terms of (regularized) hypergeometric functions and hence would require additional dependencies (see JuliaMath/SpecialFunctions.jl#317). The third argument indicates the desired accuracy, and hence the function is not differentiable wrt to the third argument anyway.

@codecov-commenter
Copy link

codecov-commenter commented May 22, 2022

Codecov Report

Merging #587 (4bfeda9) into master (78c73af) will decrease coverage by 0.14%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #587      +/-   ##
==========================================
- Coverage   86.63%   86.49%   -0.15%     
==========================================
  Files           9        9              
  Lines         898      896       -2     
==========================================
- Hits          778      775       -3     
- Misses        120      121       +1     
Impacted Files Coverage Δ
src/dual.jl 79.05% <100.00%> (-0.41%) ⬇️
src/partials.jl 84.21% <0.00%> (-0.14%) ⬇️
src/gradient.jl 98.87% <0.00%> (-0.03%) ⬇️
src/jacobian.jl 99.31% <0.00%> (-0.01%) ⬇️
src/prelude.jl 37.50% <0.00%> (+1.13%) ⬆️

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 78c73af...4bfeda9. Read the comment docs.

@andreasnoack
Copy link
Member

Any idea why this one is failing on nightly?

@devmotion devmotion closed this Aug 4, 2022
@devmotion devmotion reopened this Aug 4, 2022
@devmotion
Copy link
Member Author

No, I'll have a look when I'm back from vacation next week.

@devmotion
Copy link
Member Author

I reran the tests and it seems they pass now. Maybe some recent change in Julia nightly or SpecialFunctions fixed the test errors.

@devmotion devmotion merged commit 61a7c5b into master Aug 4, 2022
@devmotion devmotion deleted the dw/gamma_inc branch August 4, 2022 22:12
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.

3 participants