@@ -41,46 +41,46 @@ program root_tests
41
41
42
42
integer ,parameter :: number_of_methods = 20 ! ! number of methods to test
43
43
character (len= 100 ),dimension (number_of_methods),parameter :: methods = [ &
44
- ' anderson_bjorck_king ' , &
45
- ' zhang ' , &
46
- ' barycentric ' , &
47
- ' regula_falsi ' , &
48
- ' ridders ' , &
49
- ' bdqrf ' , &
50
- ' blendtf ' , &
51
- ' bisection ' , &
52
- ' itp ' , &
53
- ' illinois ' , &
54
- ' rbp ' , &
55
- ' modab ' , &
56
- ' pegasus ' , &
57
- ' toms748 ' , &
58
- ' brent ' , &
59
- ' brentq ' , &
60
- ' anderson_bjorck ' , &
61
- ' muller ' , &
62
- ' brenth ' , &
63
- ' chandrupatla ' ] ! ! method names - the order here is roughly the order of worst to best (see the root report output file).
44
+ ' barycentric ' , &
45
+ ' anderson_bjorck_king ' , &
46
+ ' zhang ' , &
47
+ ' bisection ' , &
48
+ ' regula_falsi ' , &
49
+ ' illinois ' , &
50
+ ' ridders ' , &
51
+ ' blendtf ' , &
52
+ ' bdqrf ' , &
53
+ ' rbp ' , &
54
+ ' itp ' , &
55
+ ' modab ' , &
56
+ ' pegasus ' , &
57
+ ' muller ' , &
58
+ ' chandrupatla ' , &
59
+ ' anderson_bjorck ' , &
60
+ ' brent ' , &
61
+ ' toms748 ' , &
62
+ ' brentq ' , &
63
+ ' brenth ' ] ! ! method names - the order here is roughly the order of worst to best (see the root report output file).
64
64
65
65
integer ,dimension (number_of_methods) :: number_of_wins, ivec, number_of_failures, ivec2
66
66
67
67
select case (wp)
68
68
case (real32)
69
69
atol = 1.0e-5_wp
70
70
rtol = 1.0e-5_wp
71
- ftol = 1.0e-5_wp
71
+ ftol = 0.0_wp
72
72
tol_for_check = 1.0e-4_wp
73
73
kind_str = ' real32'
74
74
case (real64)
75
75
atol = 1.0e-15_wp
76
76
rtol = 1.0e-13_wp
77
- ftol = 1.0e-15_wp
77
+ ftol = 0.0_wp
78
78
tol_for_check = 1.0e-7_wp
79
79
kind_str = ' real64'
80
80
case (real128)
81
81
atol = 1.0e-25_wp
82
82
rtol = 1.0e-23_wp
83
- ftol = 1.0e-25_wp
83
+ ftol = 0.0_wp
84
84
tol_for_check = 1.0e-16_wp
85
85
kind_str = ' real128'
86
86
case default
@@ -513,6 +513,8 @@ subroutine problems(x, ax, bx, fx, xroot, cases, num_of_problems, latex, bounds,
513
513
f = - 2.0_wp * f
514
514
end if
515
515
if (present (latex)) latex = ' -2 \sum_{i=1}^{20} ((2i - 5)^2)/(x - i^2)^3'
516
+
517
+ ! .... 13 & 14 don't actually converge to the right root with real64 since the func value is lower than the tol on the bound....
516
518
case (12 )
517
519
a = - 9.0_wp
518
520
b = 31.0_wp
@@ -534,6 +536,7 @@ subroutine problems(x, ax, bx, fx, xroot, cases, num_of_problems, latex, bounds,
534
536
if (present (x)) f = - 200.0_wp * x* exp (- 3.0_wp * x)
535
537
if (present (latex)) latex = ' -200 x \mathrm{e}^{-3 x}'
536
538
if (present (bounds)) bounds = ' -9,31'
539
+
537
540
case (15 )
538
541
a = 0.0_wp
539
542
b = 5.0_wp
@@ -1746,7 +1749,7 @@ subroutine problems(x, ax, bx, fx, xroot, cases, num_of_problems, latex, bounds,
1746
1749
error stop ' invalid case'
1747
1750
end select
1748
1751
1749
- if (present (num_of_problems)) num_of_problems = 144
1752
+ if (present (num_of_problems)) num_of_problems = 145
1750
1753
1751
1754
! outputs:
1752
1755
if (present (ax)) ax = a
0 commit comments