Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Seth Axen <[email protected]>
  • Loading branch information
devmotion and sethaxen authored Oct 4, 2021
1 parent 30a020f commit a9f9f52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/chainrules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function ChainRulesCore.frule((_, Δν, Δx), ::typeof(besselix), ν::Number, x:
ΔΩ = if Δx isa Real
muladd(muladd(-sign(real(x)), Ω, a), Δx, ∂Ω_∂ν * Δν)
else
muladd(a, Δx, muladd(-sign(real(x)) * Ω, real(Δx), ∂Ω_∂ν * Δν))
muladd(a, Δx, muladd(-sign(real(x)) * real(Δx), Ω, ∂Ω_∂ν * Δν))
end

return Ω, ΔΩ
Expand All @@ -232,7 +232,7 @@ function ChainRulesCore.frule((_, Δν, Δx), ::typeof(besseljx), ν::Number, x:
ΔΩ = if Δx isa Real
muladd(a, Δx, ∂Ω_∂ν * Δν)
else
muladd(a, Δx, muladd(-sign(imag(x)) * Ω, imag(Δx), ∂Ω_∂ν * Δν))
muladd(a, Δx, muladd(-sign(imag(x)) * imag(Δx), Ω, ∂Ω_∂ν * Δν))
end

return Ω, ΔΩ
Expand Down Expand Up @@ -263,7 +263,7 @@ function ChainRulesCore.frule((_, Δν, Δx), ::typeof(besselyx), ν::Number, x:
ΔΩ = if Δx isa Real
muladd(a, Δx, ∂Ω_∂ν * Δν)
else
muladd(a, Δx, muladd(-sign(imag(x)) * Ω, imag(Δx), ∂Ω_∂ν * Δν))
muladd(a, Δx, muladd(-sign(imag(x)) * imag(Δx), Ω, ∂Ω_∂ν * Δν))
end

return Ω, ΔΩ
Expand Down

0 comments on commit a9f9f52

Please sign in to comment.