JuliaDiff / DiffRules.jl

A simple shared suite of common derivative definitions
Other
74 stars 38 forks source link

Derivative of exponential integral #99

Closed ashiklom closed 1 year ago

ashiklom commented 1 year ago

General form:

$$ \frac{d}{dx} E\nu(x) = -E{\nu - 1}(x) $$

Note that:

$$ E_0(x) = \frac{e^{-x}}{x} $$

Therefore, derivative of SpecialFunctions.expint(x) ($E_1(x)$) is:

$$ \frac{d}{dx} E_1(x) = -E_0(x) = -\frac{e^{-x}}{x} $$

Source: Wikipedia

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02 :tada:

Comparison is base (fee3857) 97.86% compared to head (fed2f7d) 97.88%.

Additional details and impacted files ```diff @@ 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 ``` | [Impacted Files](https://app.codecov.io/gh/JuliaDiff/DiffRules.jl/pull/99?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaDiff) | Coverage Δ | | |---|---|---| | [src/rules.jl](https://app.codecov.io/gh/JuliaDiff/DiffRules.jl/pull/99?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=JuliaDiff#diff-c3JjL3J1bGVzLmps) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

devmotion commented 1 year ago

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?

ashiklom commented 1 year ago

Good catch! Looks like this starts to work (or at least, all the tests pass) starting in SpecialFunctions v1.1. Bumped compatibility accordingly.