diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbca8a0..5a29b32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,8 @@ jobs: fail-fast: false matrix: version: - - '1.0' + - '1.3' + - '1.6' - '1' - 'nightly' os: diff --git a/Project.toml b/Project.toml index c962cf8..49d8e90 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "DiffRules" uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" -version = "1.6.0" +version = "1.7.0" [deps] LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688" @@ -12,7 +12,7 @@ SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" LogExpFunctions = "0.3.2" NaNMath = "0.3" SpecialFunctions = "0.8, 0.9, 0.10, 1.0, 2" -julia = "1" +julia = "1.3" [extras] Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" diff --git a/src/rules.jl b/src/rules.jl index d70b71e..c6f8e48 100644 --- a/src/rules.jl +++ b/src/rules.jl @@ -83,11 +83,7 @@ _abs_deriv(x) = signbit(x) ? -one(x) : one(x) @define_diffrule Base.:\(x, y) = :( -($y / $x / $x) ), :( one($y) / ($x) ) @define_diffrule Base.:^(x, y) = :( $y * ($x^($y - 1)) ), :( ($x isa Real && $x<=0) ? Base.oftype(float($x), NaN) : ($x^$y)*log($x) ) -if VERSION < v"0.7-" - @define_diffrule Base.atan2(x, y) = :( $y / ($x^2 + $y^2) ), :( -$x / ($x^2 + $y^2) ) -else - @define_diffrule Base.atan(x, y) = :( $y / ($x^2 + $y^2) ), :( -$x / ($x^2 + $y^2) ) -end +@define_diffrule Base.atan(x, y) = :( $y / ($x^2 + $y^2) ), :( -$x / ($x^2 + $y^2) ) @define_diffrule Base.hypot(x, y) = :( $x / hypot($x, $y) ), :( $y / hypot($x, $y) ) @define_diffrule Base.log(b, x) = :( log($x) * inv(-log($b)^2 * $b) ), :( inv($x) / log($b) )