Derivative of exponential integral#99
Conversation
General form:
$$ \frac{d}{dx} E_\nu(x) = -E_{\nu - 1}(x) $$
Special case:
$$ \frac{d}{dx} E_0(x) = -\frac{e^{-x}}{x} $$
Source: https://en.wikipedia.org/wiki/Exponential_integral#Derivatives
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #99 +/- ##
==========================================
+ Coverage 97.86% 97.88% +0.02%
==========================================
Files 3 3
Lines 187 189 +2
==========================================
+ Hits 183 185 +2
Misses 4 4
☔ View full report in Codecov by Sentry. |
|
Looks mainly good (it also matches the rules we added to SpecialFunctions, e.g., https://github.com/JuliaMath/SpecialFunctions.jl/blob/ae35d10713a470b852e53e0c79f20252b5572fa9/ext/SpecialFunctionsChainRulesCoreExt.jl#L183). I am pretty sure though that it requires us to update the SpecialFunctions compat entry since IIRC these functions require a relatively recent release of SpecialFunctions. Can you check this? |
Exponential integral (`expint`) was only introduced in 1.0... https://github.com/JuliaMath/SpecialFunctions.jl/releases/tag/v1.0.0 ...but with spurious domain errors, which were fixed in 1.1 (at least fixed-enough that this package's tests pass.) https://github.com/JuliaMath/SpecialFunctions.jl/releases/tag/v1.1.0
|
Good catch! Looks like this starts to work (or at least, all the tests pass) starting in SpecialFunctions v1.1. Bumped compatibility accordingly. |
Now that JuliaDiff/DiffRules.jl#99 has been merged, no longer need the custom implementation. Also, native symbolic ForwardDiff implementation based on DiffRules is faster!
General form:
Note that:
Therefore, derivative of$E_1(x)$ ) is:
SpecialFunctions.expint(x)(Source: Wikipedia