Skip to content

Commit 5b18dea

Browse files
committed
Merge pull request #71 from yuyichao/0.4-dev
Fix deprecation warning and other extra white space
2 parents 360624d + cdac37b commit 5b18dea

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/differentiate.jl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
21
export differentiate
32

43
#################################################################
54
#
65
# differentiate()
76
# based on John's differentiate and this code, I think by Miles Lubin:
87
# https://github.com/IainNZ/NLTester/blob/master/julia/nlp.jl#L74
9-
#
8+
#
109
#################################################################
1110

1211
differentiate(ex::SymbolicVariable, wrt::SymbolicVariable) = (ex == wrt) ? 1 : 0
@@ -33,7 +32,7 @@ function differentiate(::SymbolParameter{:^}, args, wrt)
3332
elseif yp == 0
3433
return :( $y * $xp * ($x ^ ($y - 1)) )
3534
else
36-
return :( $x ^ $y * ($xp * $y / $x + $yp * log($x)) )
35+
return :( $x ^ $y * ($xp * $y / $x + $yp * log($x)) )
3736
end
3837
end
3938

@@ -215,12 +214,12 @@ for (funsym, exp) in symbolic_derivative_1arg_list
215214
end
216215

217216
derivative_rules_bessel = [
218-
( :besselj, :( * (besselj(nu - 1, x) - besselj(nu + 1, x)) / 2 ))
219-
( :besseli, :( * (besseli(nu - 1, x) + besseli(nu + 1, x)) / 2 ))
220-
( :bessely, :( * (bessely(nu - 1, x) - bessely(nu + 1, x)) / 2 ))
217+
( :besselj, :( (besselj(nu - 1, x) - besselj(nu + 1, x)) / 2 ))
218+
( :besseli, :( (besseli(nu - 1, x) + besseli(nu + 1, x)) / 2 ))
219+
( :bessely, :( (bessely(nu - 1, x) - bessely(nu + 1, x)) / 2 ))
221220
( :besselk, :( -1 * (besselk(nu - 1, x) + besselk(nu + 1, x)) / 2 ))
222-
( :hankelh1, :( * (hankelh1(nu - 1, x) - hankelh1(nu + 1, x)) / 2 ))
223-
( :hankelh2, :( * (hankelh2(nu - 1, x) - hankelh2(nu + 1, x)) / 2 ))
221+
( :hankelh1, :( (hankelh1(nu - 1, x) - hankelh1(nu + 1, x)) / 2 ))
222+
( :hankelh2, :( (hankelh2(nu - 1, x) - hankelh2(nu + 1, x)) / 2 ))
224223
]
225224

226225

@@ -258,7 +257,7 @@ end
258257

259258
## Differentiate for piecewise functions defined using ifelse
260259
function differentiate(::SymbolParameter{:ifelse}, args, wrt)
261-
:(ifelse($(args[1]), $(differentiate(args[2],wrt)),$(differentiate(args[3],wrt))))
260+
:(ifelse($(args[1]), $(differentiate(args[2],wrt)),$(differentiate(args[3],wrt))))
262261
end
263262

264263
function differentiate(ex::Expr, targets::Vector{Symbol})

0 commit comments

Comments
 (0)