JuliaMath / QuadGK.jl

adaptive 1d numerical Gauss–Kronrod integration in Julia
MIT License
272 stars 37 forks source link

MethodError: no method matching kronrod(::Type{ForwardDiff.Dual{ForwardDiff.Tag{typeof(test), Float64}, Float64, 1}}, ::Int64) #122

Open ZhangFengshun opened 3 weeks ago

ZhangFengshun commented 3 weeks ago

image

stevengj commented 3 weeks ago

See https://github.com/JuliaMath/QuadGK.jl/issues/13#issuecomment-1430408697

A workaround is probably to define:

QuadGK.cachedrule(::Type{<:ForwardDiff{<:Any, T}}, n::Integer) where {T<:Number} =
    QuadGK._cachedrule(typeof(float(real(one(T)))), Int(n))