Michael Abbott

Results 1143 comments of Michael Abbott

Note also that these behave differently at small `n`: ```julia julia> g(i) = 4 / i; julia> f_1st(rounds) = sum(g, (-2 * rounds + 1):4:(2 * rounds)); julia> f_2nd(n) =...

> `Base.Fix1(value,T)` fixes it for me. This seems completely safe, a PR would be great.

The answer here is changed by https://github.com/JuliaDiff/ForwardDiff.jl/pull/481: ```julia julia> derivative(t -> x + t * dx - x, 0) # was zero above 1-element SparseArrays.SparseVector{Float64, Int64} with 1 stored entry:...

I am not sure there's a good reason. Somewhere there was an issue complaining about this kind of behaviour, and my memory is that most were horrified that values could...

Some other ways to make StepRangeLen with Dual, one of which makes a TwicePrecision{Dual}: ```julia julia> (1:4) * Dual(1,2) |> typeof # UnitRange, not tested StepRangeLen{Dual{Nothing, Int64, 1}, Dual{Nothing, Int64,...

Failure on 1.6 seems to be this, arguably a bug in Base, but can it be worked around here? ```julia julia> using ForwardDiff: Dual julia> range(1, step = Dual(1,1), length...

What is `test_func`? Guessing from the stack trace, I think the MWE is this: ```julia julia> (Dual(1, 0.2) + 0im) ^ Dual(3, 0.1) ERROR: InexactError: Int(Int64, Dual{Nothing}(3.0,0.1)) Stacktrace: [1] Int64...

Ok. One guess might be that earlier operations made the dual part zero, or the real part non-integer? But I don't know. I don't think ForwardDiff has changed much. Edit:...

First, perhaps a cleaner version of the complaint is this: ```julia julia> using ForwardDiff: Dual julia> function f_3(x; lb = 0.0, ub = 1.0) (lb = ub && return 0.5*ub*ub...

I don't disagree with these bullet points, but overloading `==` without `hash` seems a bit dodgy, and since these are numbers they probably ought to think about `NaN`. Whenever I...