Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/thiele.jl
Original file line number Diff line number Diff line change
Expand Up @@ -563,12 +563,15 @@ function approximate(::Type{Thiele},
z_test = copy(collect(z))
deleteat!(y_test, idx_min)
deleteat!(z_test, idx_min)
r_test = similar(y_test)
r_test = similar(y_test, promote_type(S, T))

history = [IterationRecord(r, NaN, missing)]
n = 1 # iteration counter
while length(z) > 0
evaluate!(r_test, r, z_test)
@inbounds for i in eachindex(r_test) # array evaluation skips the underflow check
isnan(r_test[i]) && (r_test[i] = r(z_test[i]))
end
r_test .-= y_test
err_max, idx_max = findmax(abs(e) for e in r_test)
history[n].error = err_max
Expand Down
1 change: 1 addition & 0 deletions test/discrete.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
f = x -> cis(x); @test pass(f, approx(f), pts, atol=6e-13)
f = z -> tan(π*z); @test pass(f, approx(f), pts, rtol=2e-13)
f = z -> tanh(100z); @test pass(f, approx(f), pts, rtol=2e-13)
f = z -> abs(z + 1.05); @test pass(f, approx(f), pts, rtol=1e-10)
end

@testset "Discrete interval, low accuracy" begin
Expand Down
Loading