Skip to content

Commit

Permalink
test_7: adaptive_simpsons_rule, reducing epsilon to 1e-8
Browse files Browse the repository at this point in the history
  • Loading branch information
fusion809 committed Jul 26, 2020
1 parent a8fc33d commit bcf7ec9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/test_7.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ sol_7 = log(sqrt(2)*exp(1)/(sqrt(exp(2)+1)))+1/2*(exp(-2)-1)+1/3*(1-exp(-3));
printstyled("Integrating (x^3+1)/(x^4 (x+1)(x^2+1)) from 1 to e and comparing the result to the analytical solution of log(sqrt(2)*exp(1)/(sqrt(exp(2)+1)))+1/2*(exp(-2)-1)+1/3*(1-exp(-3))\n"; color = :red)
@testset "partfrac" begin
printstyled("Running: adaptive_simpsons_rule with ε=1e-7\n"; color = :magenta)
@time @test adaptive_simpsons_rule(partfrac, 1, exp(1), 1e-7) sol_7
# epsilon = 1e-7, despite leading to an absolute and relative error < 1e-7
# leads to the test failing
@time @test adaptive_simpsons_rule(partfrac, 1, exp(1), 1e-8) sol_7
printstyled("Running: chebyshev_quadrature with k=1\n"; color = :magenta)
@time @test chebyshev_quadrature(partfrac, 8517, 1, 1, exp(1)) sol_7
printstyled("Running: chebyshev_quadrature with k=2\n"; color = :magenta)
Expand Down

0 comments on commit bcf7ec9

Please sign in to comment.