@@ -14,9 +14,9 @@ ForwardDiff.Dual{T,V}(x::ExactReal) where {T,V} = convert(Dual{T,V}, x)
14
14
15
15
Base. convert (:: Type{Dual{T,V,N}} , x:: ExactReal ) where {T,V,N} = Dual {T} (V (x), zero (Partials{N,V}))
16
16
17
- Base. promote_rule (:: Type{Dual{T, V, N}} , :: Type{Interval{S}} ) where {T, V, N, S<: Union{AbstractFloat, Rational} } =
17
+ Base. promote_rule (:: Type{Dual{T, V, N}} , :: Type{Interval{S}} ) where {T, V, N, S<: IntervalArithmetic.NumTypes } =
18
18
Dual{T,Interval{IntervalArithmetic. promote_numtype (V, S)},N}
19
- Base. promote_rule (:: Type{Interval{S}} , :: Type{Dual{T, V, N}} ) where {S<: Union{AbstractFloat, Rational} , T, V, N} =
19
+ Base. promote_rule (:: Type{Interval{S}} , :: Type{Dual{T, V, N}} ) where {S<: IntervalArithmetic.NumTypes , T, V, N} =
20
20
Dual{T,Interval{IntervalArithmetic. promote_numtype (V, S)},N}
21
21
Base. promote_rule (:: Type{ExactReal{S}} , :: Type{Dual{T, V, N}} ) where {S<: Real , T, V, N} =
22
22
Dual{T,ExactReal{IntervalArithmetic. promote_numtype (V, S)},N}
@@ -98,7 +98,7 @@ function (constant::Constant)(::Dual{T, Interval{S}}) where {T, S}
98
98
return Dual {T} (interval (S, constant. value), interval (S, 0.0 ))
99
99
end
100
100
101
- function (piecewise:: Piecewise )(dual:: Dual{T, <:Interval} ) where {T}
101
+ function (piecewise:: Piecewise )(dual:: Dual{T,<:Interval} ) where {T}
102
102
X = value (dual)
103
103
input_domain = Domain (X)
104
104
if ! overlap_domain (input_domain, piecewise)
@@ -135,6 +135,8 @@ function (piecewise::Piecewise)(dual::Dual{T, <:Interval}) where {T}
135
135
return Dual {T} (primal, tuple (partial... ))
136
136
end
137
137
138
+ #
139
+
138
140
ForwardDiff. DiffRules. _abs_deriv (x:: Dual{T,<:Interval} ) where {T} =
139
141
Dual {T} (ForwardDiff. DiffRules. _abs_deriv (value (x)), zero (partials (x)))
140
142
0 commit comments