@@ -33,14 +33,17 @@ ChainRulesCore.@scalar_rule(
3333)
3434ChainRulesCore. @scalar_rule (dawson (x), 1 - (2 * x * Ω))
3535ChainRulesCore. @scalar_rule (digamma (x), trigamma (x))
36- ChainRulesCore. @scalar_rule (erf (x), (2 / sqrt (π)) * exp (- x^ 2 ))
37- ChainRulesCore. @scalar_rule (erfc (x), - (2 / sqrt (π)) * exp (- x^ 2 ))
38- ChainRulesCore. @scalar_rule (logerfc (x), - (2 / sqrt (π)) * exp (- x^ 2 - Ω))
39- ChainRulesCore. @scalar_rule (erfcinv (x), - (sqrt (π) / 2 ) * exp (Ω^ 2 ))
40- ChainRulesCore. @scalar_rule (erfcx (x), (2 * x * Ω) - (2 / sqrt (π)))
41- ChainRulesCore. @scalar_rule (logerfcx (x), 2 * x - (2 / sqrt (π)) * exp (- Ω))
42- ChainRulesCore. @scalar_rule (erfi (x), (2 / sqrt (π)) * exp (x^ 2 ))
43- ChainRulesCore. @scalar_rule (erfinv (x), (sqrt (π) / 2 ) * exp (Ω^ 2 ))
36+
37+ # TODO : use `invsqrtπ` if it is added to IrrationalConstants
38+ ChainRulesCore. @scalar_rule (erf (x), (2 * exp (- x^ 2 )) / sqrtπ)
39+ ChainRulesCore. @scalar_rule (erf (x, y), (- (2 * exp (- x^ 2 )) / sqrtπ, (2 * exp (- y^ 2 )) / sqrtπ))
40+ ChainRulesCore. @scalar_rule (erfc (x), - (2 * exp (- x^ 2 )) / sqrtπ)
41+ ChainRulesCore. @scalar_rule (logerfc (x), - (2 * exp (- x^ 2 - Ω)) / sqrtπ)
42+ ChainRulesCore. @scalar_rule (erfcinv (x), - (sqrtπ * (exp (Ω^ 2 ) / 2 )))
43+ ChainRulesCore. @scalar_rule (erfcx (x), 2 * x * Ω - 2 / sqrtπ)
44+ ChainRulesCore. @scalar_rule (logerfcx (x), 2 * (x - exp (- Ω) / sqrtπ))
45+ ChainRulesCore. @scalar_rule (erfi (x), (2 * exp (x^ 2 )) / sqrtπ)
46+ ChainRulesCore. @scalar_rule (erfinv (x), sqrtπ * (exp (Ω^ 2 ) / 2 ))
4447
4548ChainRulesCore. @scalar_rule (gamma (x), Ω * digamma (x))
4649ChainRulesCore. @scalar_rule (
@@ -70,8 +73,7 @@ ChainRulesCore.@scalar_rule(
7073)
7174ChainRulesCore. @scalar_rule (trigamma (x), polygamma (2 , x))
7275
73- # binary
74- ChainRulesCore. @scalar_rule (erf (x, y), (- (2 / sqrt (π)) * exp (- x^ 2 ), (2 / sqrt (π)) * exp (- y^ 2 )))
76+ # Bessel functions
7577ChainRulesCore. @scalar_rule (
7678 besselj (ν, x),
7779 (
@@ -135,6 +137,7 @@ ChainRulesCore.@scalar_rule(
135137 (hankelh2x (ν - 1 , x) - hankelh2x (ν + 1 , x)) / 2 + im * Ω,
136138 ),
137139)
140+
138141ChainRulesCore. @scalar_rule (
139142 polygamma (m, x),
140143 (
@@ -188,5 +191,5 @@ ChainRulesCore.@scalar_rule(
188191 )
189192)
190193ChainRulesCore. @scalar_rule (expinti (x), exp (x) / x)
191- ChainRulesCore. @scalar_rule (sinint (x), sinc (x / π ))
194+ ChainRulesCore. @scalar_rule (sinint (x), sinc (invπ * x ))
192195ChainRulesCore. @scalar_rule (cosint (x), cos (x) / x)
0 commit comments