From 74a42f98eac486c9dcb2df3710fd2bf0ff0d5c4f Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 18 May 2015 18:23:47 +0100 Subject: [PATCH] Fix various typos. Change Schroeder to Schroder. --- doc/math.qbk | 2 +- doc/roots/elliptic_table_100_gcc_X64_SSE2.qbk | 2 +- doc/roots/elliptic_table_100_msvc_X64_AVX.qbk | 2 +- doc/roots/elliptic_table_100_msvc_X86_AVX.qbk | 2 +- .../elliptic_table_100_msvc_X86_SSE2.qbk | 2 +- doc/roots/root_comparison.qbk | 20 ++-- doc/roots/root_comparison_tables_gcc.qbk | 2 +- doc/roots/root_comparison_tables_gcc_075.qbk | 2 +- doc/roots/root_comparison_tables_msvc.qbk | 2 +- doc/roots/root_comparison_tables_msvc_075.qbk | 2 +- doc/roots/root_finding_examples.qbk | 6 +- doc/roots/root_n_comparison_tables.qbk | 2 +- doc/roots/roots.qbk | 23 ++--- doc/roots/roots_overview.qbk | 2 +- .../roots_table_100_gcc_SEE_SEE2_X64.qbk | 6 +- doc/roots/roots_table_100_gcc_X64_SSE2.qbk | 6 +- doc/roots/roots_table_100_msvc.qbk | 6 +- doc/roots/roots_table_100_msvc_AVX.qbk | 6 +- doc/roots/roots_table_100_msvc_X64_AVX.qbk | 6 +- doc/roots/roots_table_100_msvc_X86.qbk | 6 +- doc/roots/roots_table_100_msvc_X86_SSE2.qbk | 6 +- doc/roots/roots_table_75_gcc_SEE_SEE2_X64.qbk | 6 +- doc/roots/roots_table_75_gcc_X64_SSE2.qbk | 6 +- doc/roots/roots_table_75_msvc.qbk | 6 +- doc/roots/roots_table_75_msvc_AVX.qbk | 6 +- doc/roots/roots_table_75_msvc_X86.qbk | 6 +- doc/roots/roots_table_75_msvc_X86_SSE2.qbk | 6 +- example/root_elliptic_finding.cpp | 18 ++-- example/root_finding_algorithms.cpp | 12 +-- example/root_finding_example.cpp | 5 +- example/root_finding_fifth.cpp | 2 +- example/root_finding_start_locations.cpp | 16 ++-- example/root_n_finding_algorithms.cpp | 16 ++-- include/boost/math/tools/roots.hpp | 30 ++++-- include_private/boost/math/tools/test.hpp | 92 +------------------ test/compile_test/tools_roots_inc_test.cpp | 2 +- test/test_root_finding_concepts.cpp | 12 +-- test/test_root_iterations.cpp | 8 +- test/test_roots.cpp | 10 +- 39 files changed, 152 insertions(+), 220 deletions(-) diff --git a/doc/math.qbk b/doc/math.qbk index 1660f5d7e..3035c9c2c 100644 --- a/doc/math.qbk +++ b/doc/math.qbk @@ -110,7 +110,7 @@ and use the function's name as the link text.] [def __brent_minima_example [link math_toolkit.roots.brent_minima.example Brent's method example]] [def __newton[link math_toolkit.roots.roots_deriv.newton Newton-Raphson iteration]], [def __halley [link math_toolkit.roots.roots_deriv.halley Halley]] -[def __schroeder [link math_toolkit.roots.roots_deriv.schroeder Schroeder]] +[def __schroder [link math_toolkit.roots.roots_deriv.schroder Schr'''ö'''der]] [def __brent_minima_example [link math_toolkit.roots.brent_minima.example Brent minima finding example]] [def __bisection [link math_toolkit.roots.roots_noderiv.bisect bisection]] [def __bisect [link math_toolkit.roots.roots_noderiv.bisect bisect]] diff --git a/doc/roots/elliptic_table_100_gcc_X64_SSE2.qbk b/doc/roots/elliptic_table_100_gcc_X64_SSE2.qbk index ad97a8748..4087704f4 100644 --- a/doc/roots/elliptic_table_100_gcc_X64_SSE2.qbk +++ b/doc/roots/elliptic_table_100_gcc_X64_SSE2.qbk @@ -16,5 +16,5 @@ Compiled in optimise mode., _X64_SSE2] [[TOMS748 ][ 5][ 328][1.31][ -1][ ][ 8][ 875][1.51][ 0][ ][ 8][ 1109][1.69][ 4][ ][ 11][479687][1.49][ -3][ ]] [[Newton ][ 3][ 328][1.31][ -1][ ][ 4][ 671][1.16][ 1][ ][ 4][ 781][1.19][ 1][ ][ 5][387500][1.20][ 0][ ]] [[Halley ][ 2][ 250][[role blue 1.00]][ 0][ ][ 3][ 578][[role blue 1.00]][ 1][ ][ 3][ 656][[role blue 1.00]][ 7][ ][ 4][321875][[role blue 1.00]][ 0][ ]] -[[Schroeder][ 3][ 375][1.50][ -1][ ][ 4][ 734][1.27][ 0][ ][ 4][ 828][1.26][ 3][ ][ 5][414062][1.29][ -2][ ]] +[[Schr'''ö'''der][ 3][ 375][1.50][ -1][ ][ 4][ 734][1.27][ 0][ ][ 4][ 828][1.26][ 3][ ][ 5][414062][1.29][ -2][ ]] ] [/end of table root] diff --git a/doc/roots/elliptic_table_100_msvc_X64_AVX.qbk b/doc/roots/elliptic_table_100_msvc_X64_AVX.qbk index fb66a7640..99991322e 100644 --- a/doc/roots/elliptic_table_100_msvc_X64_AVX.qbk +++ b/doc/roots/elliptic_table_100_msvc_X64_AVX.qbk @@ -16,5 +16,5 @@ Compiled in optimise mode., _X64_AVX] [[TOMS748 ][ 5][ 500][1.33][ -1][ ][ 9][ 1046][1.72][ 1][ ][ 9][ 1062][1.70][ 1][ ][ 11][698437][1.54][ -3][ ]] [[Newton ][ 3][ 484][1.29][ -1][ ][ 4][ 734][1.21][ 1][ ][ 4][ 687][1.10][ 1][ ][ 5][545312][1.20][ 0][ ]] [[Halley ][ 2][ 375][[role blue 1.00]][ 0][ ][ 3][ 609][[role blue 1.00]][ 3][ ][ 3][ 625][[role blue 1.00]][ 3][ ][ 4][453125][[role blue 1.00]][ 0][ ]] -[[Schroeder][ 3][ 546][1.46][ -1][ ][ 6][ 1109][1.82][ 1][ ][ 6][ 1187][1.90][ 1][ ][ 5][564062][1.24][ -2][ ]] +[[Schr'''ö'''der][ 3][ 546][1.46][ -1][ ][ 6][ 1109][1.82][ 1][ ][ 6][ 1187][1.90][ 1][ ][ 5][564062][1.24][ -2][ ]] ] [/end of table root] diff --git a/doc/roots/elliptic_table_100_msvc_X86_AVX.qbk b/doc/roots/elliptic_table_100_msvc_X86_AVX.qbk index 29981666d..18efcd253 100644 --- a/doc/roots/elliptic_table_100_msvc_X86_AVX.qbk +++ b/doc/roots/elliptic_table_100_msvc_X86_AVX.qbk @@ -16,5 +16,5 @@ Compiled in optimise mode., _X86_AVX] [[TOMS748 ][ 5][ 2187][1.56][ -1][ ][ 9][ 4062][1.86][ 1][ ][ 9][ 4062][1.86][ 1][ ][ 9][11104687][1.30][2027466061][ ]] [[Newton ][ 3][ 2031][1.44][ -1][ ][ 4][ 2812][1.29][ 0][ ][ 4][ 2812][1.29][ 0][ ][ 5][10615625][1.24][2027466058][ ]] [[Halley ][ 2][ 1406][[role blue 1.00]][ 0][ ][ 3][ 2187][[role blue 1.00]][ 1][ ][ 3][ 2187][[role blue 1.00]][ 1][ ][ 4][8567187][[role blue 1.00]][2027466060][ ]] -[[Schroeder][ 3][ 2187][1.56][ -1][ ][ 4][ 2656][1.21][ 0][ ][ 4][ 2812][1.29][ 0][ ][ 5][10703125][1.25][2027466061][ ]] +[[Schr'''ö'''der][ 3][ 2187][1.56][ -1][ ][ 4][ 2656][1.21][ 0][ ][ 4][ 2812][1.29][ 0][ ][ 5][10703125][1.25][2027466061][ ]] ] [/end of table root] diff --git a/doc/roots/elliptic_table_100_msvc_X86_SSE2.qbk b/doc/roots/elliptic_table_100_msvc_X86_SSE2.qbk index 9cfb5fad7..6663e92a2 100644 --- a/doc/roots/elliptic_table_100_msvc_X86_SSE2.qbk +++ b/doc/roots/elliptic_table_100_msvc_X86_SSE2.qbk @@ -16,5 +16,5 @@ Compiled in optimise mode., _X86_SSE2] [[TOMS748 ][ 5][ 515][1.43][ -1][ ][ 9][ 968][1.82][ 1][ ][ 9][ 968][1.82][ 1][ ][ 11][871875][1.53][ -3][ ]] [[Newton ][ 3][ 453][1.26][ -1][ ][ 4][ 640][1.21][ 1][ ][ 4][ 640][1.21][ 1][ ][ 5][685937][1.20][ 0][ ]] [[Halley ][ 2][ 359][[role blue 1.00]][ 0][ ][ 3][ 531][[role blue 1.00]][ 3][ ][ 3][ 531][[role blue 1.00]][ 3][ ][ 4][570312][[role blue 1.00]][ 0][ ]] -[[Schroeder][ 3][ 484][1.35][ -1][ ][ 6][ 1000][1.88][ 1][ ][ 6][ 984][1.85][ 1][ ][ 5][742187][1.30][ -2][ ]] +[[Schr'''ö'''der][ 3][ 484][1.35][ -1][ ][ 6][ 1000][1.88][ 1][ ][ 6][ 984][1.85][ 1][ ][ 5][742187][1.30][ -2][ ]] ] [/end of table root] diff --git a/doc/roots/root_comparison.qbk b/doc/roots/root_comparison.qbk index 46377890d..1827fc41d 100644 --- a/doc/roots/root_comparison.qbk +++ b/doc/roots/root_comparison.qbk @@ -41,9 +41,9 @@ The requested precision was set as follows: [table [[Function][Precision Requested]] [[TOMS748][numeric_limits::digits - 2]] -[[Newton][[lfloor]numeric_limits::digits * 0.6[rfloor]]] -[[Halley][[lfloor]numeric_limits::digits * 0.4[rfloor]]] -[[Schroeder][[lfloor]numeric_limits::digits * 0.4[rfloor]]] +[[Newton][floor(numeric_limits::digits * 0.6)]] +[[Halley][floor(numeric_limits::digits * 0.4)]] +[[Schr'''ö'''der][floor(numeric_limits::digits * 0.4)]] ] * The C++ Standard cube root function [@http://en.cppreference.com/w/cpp/numeric/math/cbrt std::cbrt] @@ -123,9 +123,9 @@ close to full accuracy without resorting to unnecessary iterations). [table [[Function][Precision Requested]] [[TOMS748][numeric_limits::digits - 2]] -[[Newton][[lfloor]numeric_limits::digits * 0.6[rfloor]]] -[[Halley][[lfloor]numeric_limits::digits * 0.4[rfloor]]] -[[Schroeder][[lfloor]numeric_limits::digits * 0.4[rfloor]]] +[[Newton][floor(numeric_limits::digits * 0.6)]] +[[Halley][floor(numeric_limits::digits * 0.4)]] +[[Schr'''ö'''der][floor(numeric_limits::digits * 0.4)]] ] Tests used Microsoft Visual Studio 2013 (Update 1) and GCC 4.9.1 using source code [@../../example/root_n_finding_algorithms.cpp root_n_finding_algorithms.cpp]. @@ -166,7 +166,7 @@ __TOMS748 is considerable in number of iterations, but little in execution time. we are finding the root for is trivial to evaluate, so runtimetimes are dominated by the time taken by the boilerplate code in each method. -* The extra cost of evaluating the second derivatives (__halley or __schroeder) is usually too much for any net benefit: +* The extra cost of evaluating the second derivatives (__halley or __schroder) is usually too much for any net benefit: as with the cube root, these functors are so cheap to evaluate that the runtime is largely dominated by the complexity of the root finding method. @@ -217,9 +217,9 @@ close to full accuracy without resorting to unnecessary iterations). [table [[Function][Precision Requested]] [[TOMS748][numeric_limits::digits - 2]] -[[Newton][[lfloor]numeric_limits::digits * 0.6[rfloor]]] -[[Halley][[lfloor]numeric_limits::digits * 0.4[rfloor]]] -[[Schroeder][[lfloor]numeric_limits::digits * 0.4[rfloor]]] +[[Newton][floor(numeric_limits::digits * 0.6)]] +[[Halley][floor(numeric_limits::digits * 0.4)]] +[[Schr'''ö'''der][floor(numeric_limits::digits * 0.4)]] ] Tests used Microsoft Visual Studio 2013 (Update 1) and GCC 4.9.1 using source code [@../../example/root_elliptic_finding.cpp root_elliptic_finding.cpp]. diff --git a/doc/roots/root_comparison_tables_gcc.qbk b/doc/roots/root_comparison_tables_gcc.qbk index 80e330f7a..f73bd6b9d 100644 --- a/doc/roots/root_comparison_tables_gcc.qbk +++ b/doc/roots/root_comparison_tables_gcc.qbk @@ -15,5 +15,5 @@ http://www.boost.org/LICENSE_1_0.txt). [[TOMS748 ][ 8][187500][4.0][ -1][ ][ 11][406250][[role red 8.7]][ 2][ ][ 10][609375][[role red 13.]][ -1][ ][ 7][44531250][[role red 14.]][ -2][ ]] [[Newton ][ 5][93750][2.0][ 0][ ][ 6][109375][2.3][ 0][ ][ 6][171875][3.7][ 0][ ][ 2][3140625][[role blue 1.0]][ -1][ ]] [[Halley ][ 3][93750][2.0][ 0][ ][ 4][125000][2.7][ 0][ ][ 4][218750][[role red 4.7]][ 0][ ][ 2][7171875][2.3][ 0][ ]] -[[Schroeder][ 4][109375][2.3][ 0][ ][ 5][171875][3.7][ 0][ ][ 5][281250][[role red 6.0]][ 0][ ][ 2][8703125][2.8][ 0][ ]] +[[Schr'''ö'''der][ 4][109375][2.3][ 0][ ][ 5][171875][3.7][ 0][ ][ 5][281250][[role red 6.0]][ 0][ ][ 2][8703125][2.8][ 0][ ]] ] [/end of table cbrt_4] diff --git a/doc/roots/root_comparison_tables_gcc_075.qbk b/doc/roots/root_comparison_tables_gcc_075.qbk index 34dfffa34..9b1f99b39 100644 --- a/doc/roots/root_comparison_tables_gcc_075.qbk +++ b/doc/roots/root_comparison_tables_gcc_075.qbk @@ -23,5 +23,5 @@ http://www.boost.org/LICENSE_1_0.txt). [[TOMS748 ][ 8][1343750][7.2][ -1][ ][ 11][2140625][5.5][ 2][ ][ 10][4796875][12.][ -1][ ][ 7][300296875][12.][ -2][ ]] [[Newton ][ 6][562500][3.0][ 0][ ][ 7][578125][1.5][ 0][ ][ 7][1703125][4.2][ 0][ ][ 9][71203125][2.8][ -1][ ]] [[Halley ][ 4][765625][4.1][ 0][ ][ 4][703125][1.8][ 0][ ][ 5][1750000][4.3][ -1][ ][ 5][95140625][3.7][ 0][ ]] -[[Schroeder][ 5][875000][4.7][ 0][ ][ 5][828125][2.1][ 0][ ][ 6][2046875][5.0][ 0][ ][ 7][122906250][4.8][ 0][ ]] +[[Schr'''ö'''der][ 5][875000][4.7][ 0][ ][ 5][828125][2.1][ 0][ ][ 6][2046875][5.0][ 0][ ][ 7][122906250][4.8][ 0][ ]] ] [/end of table cbrt_4] diff --git a/doc/roots/root_comparison_tables_msvc.qbk b/doc/roots/root_comparison_tables_msvc.qbk index 6dbd79c9d..d6e504959 100644 --- a/doc/roots/root_comparison_tables_msvc.qbk +++ b/doc/roots/root_comparison_tables_msvc.qbk @@ -15,5 +15,5 @@ http://www.boost.org/LICENSE_1_0.txt). [[TOMS748 ][ 8][234375][[role red 5.0]][ -1][ ][ 11][437500][[role red 9.3]][ 2][ ][ 11][437500][[role red 9.3]][ 2][ ][ 7][66218750][[role red 15.]][ -2][ ]] [[Newton ][ 5][109375][2.3][ 0][ ][ 6][125000][2.7][ 0][ ][ 6][140625][3.0][ 0][ ][ 2][4531250][[role blue 1.0]][ 0][ ]] [[Halley ][ 3][125000][2.7][ 0][ ][ 4][156250][3.3][ 0][ ][ 4][156250][3.3][ 0][ ][ 2][10625000][2.3][ 0][ ]] -[[Schroeder][ 4][140625][3.0][ 0][ ][ 5][187500][4.0][ 0][ ][ 5][203125][[role red 4.3]][ 0][ ][ 2][13109375][2.9][ 0][ ]] +[[Schr'''ö'''der][ 4][140625][3.0][ 0][ ][ 5][187500][4.0][ 0][ ][ 5][203125][[role red 4.3]][ 0][ ][ 2][13109375][2.9][ 0][ ]] ] [/end of table cbrt_4] diff --git a/doc/roots/root_comparison_tables_msvc_075.qbk b/doc/roots/root_comparison_tables_msvc_075.qbk index 07bf8b998..55ae94947 100644 --- a/doc/roots/root_comparison_tables_msvc_075.qbk +++ b/doc/roots/root_comparison_tables_msvc_075.qbk @@ -23,5 +23,5 @@ http://www.boost.org/LICENSE_1_0.txt). [[TOMS748 ][ 8][812500][4.0][ -1][ ][ 11][1031250][5.5][ 2][ ][ 11][1093750][5.8][ 2][ ][ 7][126125000][14.][ -2][ ]] [[Newton ][ 6][968750][4.8][ 0][ ][ 7][968750][5.2][ 0][ ][ 7][1015625][5.4][ 0][ ][ 9][30421875][3.5][ -1][ ]] [[Halley ][ 4][984375][4.8][ 0][ ][ 4][1046875][5.6][ 0][ ][ 4][1078125][5.8][ 0][ ][ 5][47453125][5.4][ 0][ ]] -[[Schroeder][ 5][968750][4.8][ 0][ ][ 5][1031250][5.5][ 0][ ][ 5][1000000][5.3][ 0][ ][ 7][59140625][6.7][ 0][ ]] +[[Schr'''ö'''der][ 5][968750][4.8][ 0][ ][ 5][1031250][5.5][ 0][ ][ 5][1000000][5.3][ 0][ ][ 7][59140625][6.7][ 0][ ]] ] [/end of table cbrt_4] diff --git a/doc/roots/root_finding_examples.qbk b/doc/roots/root_finding_examples.qbk index 380734b72..df4b490de 100644 --- a/doc/roots/root_finding_examples.qbk +++ b/doc/roots/root_finding_examples.qbk @@ -180,7 +180,7 @@ and yet, even so, not one of the test cases had a single bit wrong. What's more, the maximum number of iterations was now just 4. Just to complete the picture, we could have called -[link math_toolkit.roots.roots_deriv.schroeder `schroeder_iterate`] in the last +[link math_toolkit.roots.roots_deriv.schroder `schroder_iterate`] in the last example: and in fact it makes no difference to the accuracy or number of iterations in this particular case. However, the relative performance of these two methods may vary depending upon the nature of ['f(x)], and the accuracy to which the initial @@ -513,7 +513,7 @@ various root finding algorithms fair. We'll start with the cubed root, and usin [[bracket_and_solve_root][12][8][8][10][11][11][11][11][11][11][7][13]] [[newton_iterate][12][7][7][5][5][4][4][5][5][6][7][9]] [[halley_iterate][7][4][4][3][3][3][3][3][3][4][4][6]] -[[schroeder_iterate][11][6][6][4][3][3][3][3][4][5][5][8]] +[[schroder_iterate][11][6][6][4][3][3][3][3][4][5][5][8]] ] As you can see `bracket_and_solve_root` is relatively insensitive to starting location - as long as you don't start many orders of magnitude away from the root it will @@ -527,7 +527,7 @@ The next table shows the number of iterations required to find the second radius [[bracket_and_solve_root][11][5][5][8][8][7][7][8][9][8][6][10]] [[newton_iterate][4][4][4][3][3][3][3][3][3][4][4][4]] [[halley_iterate][4][3][3][3][3][2][2][3][3][3][3][3]] -[[schroeder_iterate][4][3][3][3][3][2][2][3][3][3][3][3]] +[[schroder_iterate][4][3][3][3][3][2][2][3][3][3][3][3]] ] Interestingly this function is much more resistant to a poor initial guess when using derivatives. diff --git a/doc/roots/root_n_comparison_tables.qbk b/doc/roots/root_n_comparison_tables.qbk index a09e813d4..0ea51b346 100644 --- a/doc/roots/root_n_comparison_tables.qbk +++ b/doc/roots/root_n_comparison_tables.qbk @@ -26,5 +26,5 @@ Fraction of maximum possible bits of accuracy required is 0.75 [[TOMS748 ][ 8][ 781][5.01][ -1][ ][ 11][ 1093][7.01][ 2][ ][ 11][ 1093][7.01][ 2][ ]] [[Newton ][ 6][ 1093][7.01][ 0][ ][ 7][ 1093][7.01][ 0][ ][ 7][ 937][6.01][ 0][ ]] [[Halley ][ 4][ 1093][7.01][ 0][ ][ 4][ 937][6.01][ 0][ ][ 4][ 937][6.01][ 0][ ]] -[[Schroeder][ 5][ 1093][7.01][ 0][ ][ 5][ 1093][7.01][ 0][ ][ 5][ 1093][7.01][ 0][ ]] +[[Schr'''ö'''der][ 5][ 1093][7.01][ 0][ ][ 5][ 1093][7.01][ 0][ ][ 5][ 1093][7.01][ 0][ ]] ] [/end of table cbrt_4] diff --git a/doc/roots/roots.qbk b/doc/roots/roots.qbk index f17fce1e2..b5a2432ac 100644 --- a/doc/roots/roots.qbk +++ b/doc/roots/roots.qbk @@ -1,4 +1,4 @@ -[section:roots_deriv Root Finding With Derivatives: Newton-Raphson, Halley & Schroeder] +[section:roots_deriv Root Finding With Derivatives: Newton-Raphson, Halley & Schr'''ö'''der] [h4 Synopsis] @@ -22,12 +22,12 @@ template T halley_iterate(F f, T guess, T min, T max, int digits, boost::uintmax_t& max_iter); - // Schroeder + // Schr'''ö'''der template - T schroeder_iterate(F f, T guess, T min, T max, int digits); + T schroder_iterate(F f, T guess, T min, T max, int digits); template - T schroeder_iterate(F f, T guess, T min, T max, int digits, boost::uintmax_t& max_iter); + T schroder_iterate(F f, T guess, T min, T max, int digits, boost::uintmax_t& max_iter); }}} // namespaces boost::math::tools. @@ -37,8 +37,8 @@ These functions all perform iterative root-finding [*using derivatives]: * `newton_raphson_iterate` performs second-order __newton. -* `halley_iterate` and `schroeder_iterate` perform third-order -__halley and __schroeder iteration. +* `halley_iterate` and `schroder_iterate` perform third-order +__halley and __schroder iteration. The functions all take the same parameters: @@ -52,7 +52,7 @@ For second-order iterative method ([@http://en.wikipedia.org/wiki/Newton_Raphson For the third-order methods ([@http://en.wikipedia.org/wiki/Halley%27s_method Halley] and -Schroeder) +Schr'''ö'''der) the `tuple` should have [*three] elements containing the evaluation of the function and its first and second derivatives.]] [[T guess] [The initial starting value. A good guess is crucial to quick convergence!]] @@ -97,7 +97,7 @@ remember that for second and third order methods the number of correct digits in the result is increasing quite substantially with each iteration, ['digits] should be set by experiment so that the final iteration just takes the next value into the zone where ['f(x)] becomes inaccurate. -A good starting point for ['digits] would be 0.6*D for Newton and 0.4*D for Halley or Shoeder +A good starting point for ['digits] would be 0.6*D for Newton and 0.4*D for Halley or Shr'''ö'''der iteration, where D is ['std::numeric_limits::digits]. * If you need some diagnostic output to see what is going on, you can `#define BOOST_MATH_INSTRUMENT` before the `#include `, @@ -136,7 +136,7 @@ Out of bounds steps revert to bisection of the current bounds. Under ideal conditions, the number of correct digits trebles with each iteration. -[h4:schroeder Schr'''ö'''der's Method] +[h4:schroder Schr'''ö'''der's Method] Given an initial guess x0 the subsequent values are computed using: @@ -151,10 +151,11 @@ Out of bounds steps revert to __bisection_wikipedia of the current bounds. Under ideal conditions, the number of correct digits trebles with each iteration. -This is Scr'''ö'''der's general result (equation 18 from [@http://drum.lib.umd.edu/handle/1903/577 Stewart, G. W. +This is Schr'''ö'''der's general result (equation 18 from [@http://drum.lib.umd.edu/handle/1903/577 Stewart, G. W. "On Infinitely Many Algorithms for Solving Equations." English translation of Schr'''ö'''der's original paper. College Park, MD: University of Maryland, Institute for Advanced Computer Studies, Department of Computer Science, 1993].) -It guarantees at least quadratic convergence (the same as Newton's method), and is known to work well in the presence of multiple roots: + +This method guarantees at least quadratic convergence (the same as Newton's method), and is known to work well in the presence of multiple roots: something that neither Newton nor Halley can do. [h4 Examples] diff --git a/doc/roots/roots_overview.qbk b/doc/roots/roots_overview.qbk index ae431abf6..5f1490d66 100644 --- a/doc/roots/roots_overview.qbk +++ b/doc/roots/roots_overview.qbk @@ -5,7 +5,7 @@ Some __root_finding_without_derivatives methods are __bisection, __bracket_solve, including use of __root_finding_TOMS748. For __root_finding_with_derivatives the methods of -__newton, __halley, and __schroeder are implemented. +__newton, __halley, and __schroder are implemented. For locating minima of a function, a __brent_minima_example is provided. diff --git a/doc/roots/roots_table_100_gcc_SEE_SEE2_X64.qbk b/doc/roots/roots_table_100_gcc_SEE_SEE2_X64.qbk index ed9ff5275..317b2155b 100644 --- a/doc/roots/roots_table_100_gcc_SEE_SEE2_X64.qbk +++ b/doc/roots/roots_table_100_gcc_SEE_SEE2_X64.qbk @@ -17,7 +17,7 @@ Fraction of full accuracy 1 [[TOMS748 ][ 7][ 296][2.72][ 0][ ][ 11][ 500][3.57][ 1][ ][ 9][ 1593][4.25][ 0][ ][ 12][74953][7.01][ 0][ ]] [[Newton ][ 3][ 109][1.00][ 0][ ][ 5][ 140][1.00][ -1][ ][ 4][ 375][1.00][ 0][ ][ 6][10687][1.00][ 0][ ]] [[Halley ][ 2][ 109][1.00][ 0][ ][ 4][ 171][1.22][ 0][ ][ 3][ 453][1.21][ 0][ ][ 4][17578][1.64][ 0][ ]] -[[Schroeder][ 6][ 203][1.86][ 0][ ][ 8][ 250][1.79][ -1][ ][ 7][ 609][1.62][ 0][ ][ 8][33546][3.14][ 0][ ]] +[[Schr'''ö'''der][ 6][ 203][1.86][ 0][ ][ 8][ 250][1.79][ -1][ ][ 7][ 609][1.62][ 0][ ][ 8][33546][3.14][ 0][ ]] ] [/end of table root] [table:root_7 7th root(28) for float, double, long double and cpp_bin_float_50 types. [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -25,7 +25,7 @@ Fraction of full accuracy 1 [[TOMS748 ][ 12][ 500][3.21][ 1][ ][ 15][ 687][4.40][ 2][ ][ 13][ 2390][5.11][ 0][ ][ 14][99765][5.95][ 0][ ]] [[Newton ][ 6][ 156][1.00][ 0][ ][ 7][ 156][1.00][ 0][ ][ 6][ 468][1.00][ 0][ ][ 8][16765][1.00][ 0][ ]] [[Halley ][ 5][ 187][1.20][ 0][ ][ 6][ 218][1.40][ 0][ ][ 5][ 796][1.70][ 0][ ][ 6][29250][1.74][ 0][ ]] -[[Schroeder][ 6][ 203][1.30][ 0][ ][ 6][ 234][1.50][ 0][ ][ 6][ 531][1.13][ 0][ ][ 7][30687][1.83][ 0][ ]] +[[Schr'''ö'''der][ 6][ 203][1.30][ 0][ ][ 6][ 234][1.50][ 0][ ][ 6][ 531][1.13][ 0][ ][ 7][30687][1.83][ 0][ ]] ] [/end of table root] [table:root_11 11th root(28) for float, double, long double and cpp_bin_float_50 types. [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -33,5 +33,5 @@ Fraction of full accuracy 1 [[TOMS748 ][ 12][ 593][3.47][ -2][ ][ 14][ 734][3.93][ 2][ ][ 14][ 2750][5.18][ 1][ ][ 17][155921][7.06][ 2][ ]] [[Newton ][ 7][ 171][1.00][ 0][ ][ 8][ 187][1.00][ 0][ ][ 8][ 531][1.00][ 0][ ][ 10][22093][1.00][ 0][ ]] [[Halley ][ 5][ 187][1.09][ 0][ ][ 6][ 234][1.25][ 0][ ][ 6][ 703][1.32][ 0][ ][ 7][36375][1.65][ 0][ ]] -[[Schroeder][ 7][ 234][1.37][ 0][ ][ 7][ 250][1.34][ 0][ ][ 8][ 625][1.18][ 0][ ][ 8][37843][1.71][ 0][ ]] +[[Schr'''ö'''der][ 7][ 234][1.37][ 0][ ][ 7][ 250][1.34][ 0][ ][ 8][ 625][1.18][ 0][ ][ 8][37843][1.71][ 0][ ]] ] [/end of table root] diff --git a/doc/roots/roots_table_100_gcc_X64_SSE2.qbk b/doc/roots/roots_table_100_gcc_X64_SSE2.qbk index 02eac52f2..f8ee069c7 100644 --- a/doc/roots/roots_table_100_gcc_X64_SSE2.qbk +++ b/doc/roots/roots_table_100_gcc_X64_SSE2.qbk @@ -17,7 +17,7 @@ Fraction of full accuracy 1 [[TOMS748 ][ 7][ 193][2.14][ 0][ ][ 11][ 432][3.86][ 1][ ][ 9][ 579][3.83][ 0][ ][ 12][59062][[role red 7.56]][ 0][ ]] [[Newton ][ 3][ 90][[role blue 1.00]][ 0][ ][ 4][ 112][[role blue 1.00]][ -1][ ][ 5][ 151][[role blue 1.00]][ 0][ ][ 6][ 7812][[role blue 1.00]][ 0][ ]] [[Halley ][ 2][ 98][1.09][ 0][ ][ 3][ 135][1.21][ 0][ ][ 3][ 201][1.33][ 0][ ][ 4][13750][1.76][ 0][ ]] -[[Schroeder][ 2][ 112][1.24][ 0][ ][ 3][ 142][1.27][ -1][ ][ 3][ 206][1.36][ 0][ ][ 4][17031][2.18][ 0][ ]] +[[Schr'''ö'''der][ 2][ 112][1.24][ 0][ ][ 3][ 142][1.27][ -1][ ][ 3][ 206][1.36][ 0][ ][ 4][17031][2.18][ 0][ ]] ] [/end of table root] [table:root_7 7th root(28) for float, double, long double and cpp_bin_float_50 types, using _X64_SSE2 [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -25,7 +25,7 @@ Fraction of full accuracy 1 [[TOMS748 ][ 12][ 351][1.97][ 1][ ][ 15][ 621][3.18][ 2][ ][ 13][ 906][3.61][ 0][ ][ 14][75468][[role red 7.10]][ 0][ ]] [[Newton ][ 5][ 178][[role blue 1.00]][ 0][ ][ 6][ 195][[role blue 1.00]][ 0][ ][ 7][ 251][[role blue 1.00]][ 0][ ][ 8][10625][[role blue 1.00]][ 0][ ]] [[Halley ][ 4][ 196][1.10][ 0][ ][ 5][ 242][1.24][ 0][ ][ 5][ 345][1.37][ 0][ ][ 6][21093][1.99][ 0][ ]] -[[Schroeder][ 5][ 225][1.26][ 0][ ][ 6][ 270][1.38][ 0][ ][ 6][ 384][1.53][ 0][ ][ 7][29062][2.74][ 0][ ]] +[[Schr'''ö'''der][ 5][ 225][1.26][ 0][ ][ 6][ 270][1.38][ 0][ ][ 6][ 384][1.53][ 0][ ][ 7][29062][2.74][ 0][ ]] ] [/end of table root] [table:root_11 11th root(28) for float, double, long double and cpp_bin_float_50 types, using _X64_SSE2 [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -33,5 +33,5 @@ Fraction of full accuracy 1 [[TOMS748 ][ 12][ 429][2.22][ -2][ ][ 14][ 679][3.02][ 2][ ][ 14][ 1098][3.94][ 1][ ][ 17][114531][[role red 8.83]][ 2][ ]] [[Newton ][ 6][ 193][[role blue 1.00]][ 0][ ][ 7][ 225][[role blue 1.00]][ 0][ ][ 7][ 279][[role blue 1.00]][ 0][ ][ 9][12968][[role blue 1.00]][ 0][ ]] [[Halley ][ 4][ 196][[role blue 1.02]][ -1][ ][ 5][ 248][1.10][ 0][ ][ 5][ 348][1.25][ 0][ ][ 6][21718][1.67][ 0][ ]] -[[Schroeder][ 6][ 254][1.32][ 0][ ][ 7][ 323][1.44][ 0][ ][ 7][ 453][1.62][ 0][ ][ 8][35625][2.75][ 0][ ]] +[[Schr'''ö'''der][ 6][ 254][1.32][ 0][ ][ 7][ 323][1.44][ 0][ ][ 7][ 453][1.62][ 0][ ][ 8][35625][2.75][ 0][ ]] ] [/end of table root] diff --git a/doc/roots/roots_table_100_msvc.qbk b/doc/roots/roots_table_100_msvc.qbk index 81babafac..240c464d6 100644 --- a/doc/roots/roots_table_100_msvc.qbk +++ b/doc/roots/roots_table_100_msvc.qbk @@ -17,7 +17,7 @@ Fraction of full accuracy 1 [[TOMS748 ][ 7][ 750][[role blue 1.00]][ 0][ ][ 11][ 1015][1.08][ 1][ ][ 11][ 1000][1.03][ 1][ ][ 12][145687][[role red 6.07]][ 0][ ]] [[Newton ][ 3][ 890][1.19][ 0][ ][ 5][ 937][[role blue 1.00]][ -1][ ][ 5][ 968][[role blue 1.00]][ -1][ ][ 6][24000][[role blue 1.00]][ 0][ ]] [[Halley ][ 2][ 921][1.23][ 0][ ][ 4][ 953][[role blue 1.02]][ 0][ ][ 4][ 968][[role blue 1.00]][ 0][ ][ 4][41468][1.73][ 0][ ]] -[[Schroeder][ 6][ 984][1.31][ 0][ ][ 8][ 1062][1.13][ -1][ ][ 8][ 1046][1.08][ -1][ ][ 8][72062][3.00][ 0][ ]] +[[Schr'''ö'''der][ 6][ 984][1.31][ 0][ ][ 8][ 1062][1.13][ -1][ ][ 8][ 1046][1.08][ -1][ ][ 8][72062][3.00][ 0][ ]] ] [/end of table root] [table:root_7 7th root(28) for float, double, long double and cpp_bin_float_50 types [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -25,7 +25,7 @@ Fraction of full accuracy 1 [[TOMS748 ][ 12][ 1015][1.07][ 1][ ][ 15][ 1218][1.22][ 2][ ][ 15][ 1218][1.24][ 2][ ][ 14][191937][[role red 5.43]][ 0][ ]] [[Newton ][ 6][ 953][[role blue 1.00]][ 0][ ][ 7][ 1000][[role blue 1.00]][ 0][ ][ 7][ 984][[role blue 1.00]][ 0][ ][ 8][35359][[role blue 1.00]][ 0][ ]] [[Halley ][ 5][ 984][1.03][ 0][ ][ 6][ 1031][1.03][ 0][ ][ 6][ 1015][1.03][ 0][ ][ 6][66968][1.89][ 0][ ]] -[[Schroeder][ 6][ 984][1.03][ 0][ ][ 6][ 1000][[role blue 1.00]][ 0][ ][ 6][ 1000][[role blue 1.02]][ 0][ ][ 7][67437][1.91][ 0][ ]] +[[Schr'''ö'''der][ 6][ 984][1.03][ 0][ ][ 6][ 1000][[role blue 1.00]][ 0][ ][ 6][ 1000][[role blue 1.02]][ 0][ ][ 7][67437][1.91][ 0][ ]] ] [/end of table root] [table:root_11 11th root(28) for float, double, long double and cpp_bin_float_50 types [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -33,5 +33,5 @@ Fraction of full accuracy 1 [[TOMS748 ][ 12][ 1078][1.11][ -2][ ][ 14][ 1312][1.33][ 2][ ][ 14][ 1296][1.28][ 2][ ][ 17][294640][[role red 6.24]][ 2][ ]] [[Newton ][ 7][ 968][[role blue 1.00]][ 0][ ][ 8][ 984][[role blue 1.00]][ 0][ ][ 8][ 1015][[role blue 1.00]][ 0][ ][ 10][47187][[role blue 1.00]][ 0][ ]] [[Halley ][ 5][ 1000][1.03][ 0][ ][ 6][ 1046][1.06][ 0][ ][ 6][ 1109][1.09][ 0][ ][ 7][79187][1.68][ 0][ ]] -[[Schroeder][ 7][ 1062][1.10][ 0][ ][ 7][ 1062][1.08][ 0][ ][ 7][ 1062][1.05][ 0][ ][ 8][78406][1.66][ 0][ ]] +[[Schr'''ö'''der][ 7][ 1062][1.10][ 0][ ][ 7][ 1062][1.08][ 0][ ][ 7][ 1062][1.05][ 0][ ][ 8][78406][1.66][ 0][ ]] ] [/end of table root] diff --git a/doc/roots/roots_table_100_msvc_AVX.qbk b/doc/roots/roots_table_100_msvc_AVX.qbk index 79ebeb384..22a4c7d8a 100644 --- a/doc/roots/roots_table_100_msvc_AVX.qbk +++ b/doc/roots/roots_table_100_msvc_AVX.qbk @@ -17,7 +17,7 @@ Fraction of full accuracy 1 [[TOMS748 ][ 7][ 734][[role green 1.0000]1.00][ 0][ ][ 11][ 1015][1.06511.07][ 1][ ][ 11][ 1031][1.08181.08][ 1][ ][ 12][145968][[role red 5.8941]5.89][ 0][ ]] [[Newton ][ 3][ 906][1.23431.23][ 0][ ][ 5][ 953][[role green 1.0000]1.00][ -1][ ][ 5][ 953][[role green 1.0000]1.00][ -1][ ][ 6][24765][[role green 1.0000]1.00][ 0][ ]] [[Halley ][ 2][ 921][1.25481.25][ 0][ ][ 4][ 1015][1.06511.07][ 0][ ][ 4][ 1000][1.04931.05][ 0][ ][ 4][42156][1.70221.70][ 0][ ]] -[[Schroeder][ 6][ 1000][1.36241.36][ 0][ ][ 8][ 1062][1.11441.11][ -1][ ][ 8][ 1062][1.11441.11][ -1][ ][ 8][72500][2.92752.93][ 0][ ]] +[[Schr'''ö'''der][ 6][ 1000][1.36241.36][ 0][ ][ 8][ 1062][1.11441.11][ -1][ ][ 8][ 1062][1.11441.11][ -1][ ][ 8][72500][2.92752.93][ 0][ ]] ] [/end of table root] [table:root_7 7th root(28) for float, double, long double and cpp_bin_float_50 types, using _AVX [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -25,7 +25,7 @@ Fraction of full accuracy 1 [[TOMS748 ][ 12][ 984][1.03251.03][ 1][ ][ 15][ 1234][1.25411.25][ 2][ ][ 15][ 1218][1.23781.24][ 2][ ][ 14][191484][[role red 5.3353]5.34][ 0][ ]] [[Newton ][ 6][ 953][[role green 1.0000]1.00][ 0][ ][ 7][ 984][[role green 1.0000]1.00][ 0][ ][ 7][ 984][[role green 1.0000]1.00][ 0][ ][ 8][35890][[role green 1.0000]1.00][ 0][ ]] [[Halley ][ 5][ 1000][1.04931.05][ 0][ ][ 6][ 1046][1.06301.06][ 0][ ][ 6][ 1046][1.06301.06][ 0][ ][ 6][66859][1.86291.86][ 0][ ]] -[[Schroeder][ 6][ 1015][1.06511.07][ 0][ ][ 6][ 1015][1.03151.03][ 0][ ][ 6][ 1000][[role green 1.0163]1.02][ 0][ ][ 7][68375][1.90511.91][ 0][ ]] +[[Schr'''ö'''der][ 6][ 1015][1.06511.07][ 0][ ][ 6][ 1015][1.03151.03][ 0][ ][ 6][ 1000][[role green 1.0163]1.02][ 0][ ][ 7][68375][1.90511.91][ 0][ ]] ] [/end of table root] [table:root_11 11th root(28) for float, double, long double and cpp_bin_float_50 types, using _AVX [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -33,5 +33,5 @@ Fraction of full accuracy 1 [[TOMS748 ][ 12][ 1078][1.09551.10][ -2][ ][ 14][ 1265][1.22701.23][ 2][ ][ 14][ 1265][1.22701.23][ 2][ ][ 17][288593][[role red 6.3844]6.38][ 2][ ]] [[Newton ][ 7][ 984][[role green 1.0000]1.00][ 0][ ][ 8][ 1031][[role green 1.0000]1.00][ 0][ ][ 8][ 1031][[role green 1.0000]1.00][ 0][ ][ 10][45203][[role green 1.0000]1.00][ 0][ ]] [[Halley ][ 5][ 1015][1.03151.03][ 0][ ][ 6][ 1078][1.04561.05][ 0][ ][ 6][ 1062][1.03011.03][ 0][ ][ 7][77625][1.71731.72][ 0][ ]] -[[Schroeder][ 7][ 1031][1.04781.05][ 0][ ][ 7][ 1046][[role green 1.0145]1.01][ 0][ ][ 7][ 1031][[role green 1.0000]1.00][ 0][ ][ 8][77718][1.71931.72][ 0][ ]] +[[Schr'''ö'''der][ 7][ 1031][1.04781.05][ 0][ ][ 7][ 1046][[role green 1.0145]1.01][ 0][ ][ 7][ 1031][[role green 1.0000]1.00][ 0][ ][ 8][77718][1.71931.72][ 0][ ]] ] [/end of table root] diff --git a/doc/roots/roots_table_100_msvc_X64_AVX.qbk b/doc/roots/roots_table_100_msvc_X64_AVX.qbk index 38943f4e2..398bf5393 100644 --- a/doc/roots/roots_table_100_msvc_X64_AVX.qbk +++ b/doc/roots/roots_table_100_msvc_X64_AVX.qbk @@ -17,7 +17,7 @@ Fraction of full accuracy 1 [[TOMS748 ][ 7][ 239][1.50][ 0][ ][ 11][ 451][2.53][ 1][ ][ 11][ 439][2.49][ 1][ ][ 12][90312][[role red 7.51]][ 0][ ]] [[Newton ][ 3][ 159][[role blue 1.00]][ 0][ ][ 4][ 178][[role blue 1.00]][ -1][ ][ 4][ 176][[role blue 1.00]][ -1][ ][ 6][12031][[role blue 1.00]][ 0][ ]] [[Halley ][ 2][ 168][1.06][ 0][ ][ 3][ 203][1.14][ 0][ ][ 3][ 198][1.13][ 0][ ][ 4][20937][1.74][ 0][ ]] -[[Schroeder][ 2][ 173][1.09][ 0][ ][ 3][ 206][1.16][ -1][ ][ 3][ 203][1.15][ -1][ ][ 4][26250][2.18][ 0][ ]] +[[Schr'''ö'''der][ 2][ 173][1.09][ 0][ ][ 3][ 206][1.16][ -1][ ][ 3][ 203][1.15][ -1][ ][ 4][26250][2.18][ 0][ ]] ] [/end of table root] [table:root_7 7th root(28) for float, double, long double and cpp_bin_float_50 types, using _X64_AVX [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -25,7 +25,7 @@ Fraction of full accuracy 1 [[TOMS748 ][ 12][ 385][2.19][ 1][ ][ 15][ 635][3.13][ 2][ ][ 15][ 621][3.17][ 2][ ][ 14][114843][[role red 6.81]][ 0][ ]] [[Newton ][ 5][ 176][[role blue 1.00]][ 0][ ][ 6][ 203][[role blue 1.00]][ 0][ ][ 6][ 196][[role blue 1.00]][ 0][ ][ 8][16875][[role blue 1.00]][ 0][ ]] [[Halley ][ 4][ 209][1.19][ 0][ ][ 5][ 254][1.25][ 0][ ][ 5][ 246][1.26][ 0][ ][ 6][32343][1.92][ 0][ ]] -[[Schroeder][ 5][ 223][1.27][ 0][ ][ 6][ 273][1.34][ 0][ ][ 6][ 275][1.40][ 0][ ][ 7][45156][2.68][ 0][ ]] +[[Schr'''ö'''der][ 5][ 223][1.27][ 0][ ][ 6][ 273][1.34][ 0][ ][ 6][ 275][1.40][ 0][ ][ 7][45156][2.68][ 0][ ]] ] [/end of table root] [table:root_11 11th root(28) for float, double, long double and cpp_bin_float_50 types, using _X64_AVX [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -33,5 +33,5 @@ Fraction of full accuracy 1 [[TOMS748 ][ 12][ 467][2.42][ -2][ ][ 14][ 648][3.06][ 2][ ][ 14][ 640][2.99][ 2][ ][ 17][170000][[role red 8.85]][ 2][ ]] [[Newton ][ 6][ 193][[role blue 1.00]][ 0][ ][ 7][ 212][[role blue 1.00]][ 0][ ][ 7][ 214][[role blue 1.00]][ 0][ ][ 9][19218][[role blue 1.00]][ 0][ ]] [[Halley ][ 4][ 209][1.08][ -1][ ][ 5][ 256][1.21][ 0][ ][ 5][ 250][1.17][ 0][ ][ 6][32656][1.70][ 0][ ]] -[[Schroeder][ 6][ 248][1.28][ 0][ ][ 7][ 306][1.44][ 0][ ][ 7][ 298][1.39][ 0][ ][ 8][53437][2.78][ 0][ ]] +[[Schr'''ö'''der][ 6][ 248][1.28][ 0][ ][ 7][ 306][1.44][ 0][ ][ 7][ 298][1.39][ 0][ ][ 8][53437][2.78][ 0][ ]] ] [/end of table root] diff --git a/doc/roots/roots_table_100_msvc_X86.qbk b/doc/roots/roots_table_100_msvc_X86.qbk index 42932a405..7a4a3bde3 100644 --- a/doc/roots/roots_table_100_msvc_X86.qbk +++ b/doc/roots/roots_table_100_msvc_X86.qbk @@ -17,7 +17,7 @@ Fraction of full accuracy 1 [[TOMS748 ][ 8][ 1109][1.08][ -2][ ][ 11][ 1265][1.29][ 1][ ][ 11][ 1203][1.22][ 1][ ][ 12][145453][[role red 5.95]][ 0][ ]] [[Newton ][ 4][ 1031][[role blue 1.00]][ 0][ ][ 5][ 984][[role blue 1.00]][ -1][ ][ 5][ 984][[role blue 1.00]][ -1][ ][ 6][24453][[role blue 1.00]][ 0][ ]] [[Halley ][ 3][ 1046][[role blue 1.01]][ 0][ ][ 4][ 1046][1.06][ 0][ ][ 4][ 1046][1.06][ 0][ ][ 4][40921][1.67][ 0][ ]] -[[Schroeder][ 7][ 1250][1.21][ 0][ ][ 8][ 1078][1.10][ -1][ ][ 8][ 1078][1.10][ -1][ ][ 8][70750][2.89][ 0][ ]] +[[Schr'''ö'''der][ 7][ 1250][1.21][ 0][ ][ 8][ 1078][1.10][ -1][ ][ 8][ 1078][1.10][ -1][ ][ 8][70750][2.89][ 0][ ]] ] [/end of table root] [table:root_7 7th root(28) for float, double, long double and cpp_bin_float_50 types, using _X86 [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -25,7 +25,7 @@ Fraction of full accuracy 1 [[TOMS748 ][ 12][ 1562][1.39][ 1][ ][ 15][ 1484][1.51][ 2][ ][ 15][ 1437][1.46][ 2][ ][ 14][188640][[role red 5.29]][ 0][ ]] [[Newton ][ 6][ 1125][[role blue 1.00]][ 0][ ][ 7][ 984][[role blue 1.00]][ 0][ ][ 7][ 984][[role blue 1.00]][ 0][ ][ 8][35640][[role blue 1.00]][ 0][ ]] [[Halley ][ 5][ 1156][[role blue 1.03]][ 0][ ][ 6][ 1125][1.14][ 0][ ][ 6][ 1109][1.13][ 0][ ][ 6][65218][1.83][ 0][ ]] -[[Schroeder][ 6][ 1187][1.06][ 0][ ][ 6][ 1031][[role blue 1.05]][ 0][ ][ 6][ 1015][[role blue 1.03]][ 0][ ][ 7][66828][1.88][ 0][ ]] +[[Schr'''ö'''der][ 6][ 1187][1.06][ 0][ ][ 6][ 1031][[role blue 1.05]][ 0][ ][ 6][ 1015][[role blue 1.03]][ 0][ ][ 7][66828][1.88][ 0][ ]] ] [/end of table root] [table:root_11 11th root(28) for float, double, long double and cpp_bin_float_50 types, using _X86 [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -33,5 +33,5 @@ Fraction of full accuracy 1 [[TOMS748 ][ 12][ 1812][1.49][ -2][ ][ 14][ 1531][1.48][ 2][ ][ 14][ 1500][1.43][ 2][ ][ 17][284937][[role red 6.38]][ 2][ ]] [[Newton ][ 7][ 1218][[role blue 1.00]][ -1][ ][ 8][ 1031][[role blue 1.00]][ 0][ ][ 8][ 1046][[role blue 1.00]][ 0][ ][ 10][44640][[role blue 1.00]][ 0][ ]] [[Halley ][ 5][ 1265][[role blue 1.04]][ -1][ ][ 6][ 1156][1.12][ 0][ ][ 6][ 1140][1.09][ 0][ ][ 7][77843][1.74][ 0][ ]] -[[Schroeder][ 7][ 1343][1.10][ -1][ ][ 7][ 1046][[role blue 1.01]][ 0][ ][ 7][ 1109][1.06][ 0][ ][ 8][77343][1.73][ 0][ ]] +[[Schr'''ö'''der][ 7][ 1343][1.10][ -1][ ][ 7][ 1046][[role blue 1.01]][ 0][ ][ 7][ 1109][1.06][ 0][ ][ 8][77343][1.73][ 0][ ]] ] [/end of table root] diff --git a/doc/roots/roots_table_100_msvc_X86_SSE2.qbk b/doc/roots/roots_table_100_msvc_X86_SSE2.qbk index cc849809d..dc975df61 100644 --- a/doc/roots/roots_table_100_msvc_X86_SSE2.qbk +++ b/doc/roots/roots_table_100_msvc_X86_SSE2.qbk @@ -17,7 +17,7 @@ Fraction of full accuracy 1 [[TOMS748 ][ 7][ 320][1.53][ 0][ ][ 11][ 576][2.61][ 1][ ][ 11][ 557][2.48][ 1][ ][ 12][119843][[role red 7.52]][ 0][ ]] [[Newton ][ 3][ 209][[role blue 1.00]][ 0][ ][ 4][ 221][[role blue 1.00]][ -1][ ][ 4][ 225][[role blue 1.00]][ -1][ ][ 6][15937][[role blue 1.00]][ 0][ ]] [[Halley ][ 2][ 214][[role blue 1.02]][ 0][ ][ 3][ 256][1.16][ 0][ ][ 3][ 243][1.08][ 0][ ][ 4][28437][1.78][ 0][ ]] -[[Schroeder][ 2][ 218][[role blue 1.04]][ 0][ ][ 3][ 245][1.11][ -1][ ][ 3][ 245][1.09][ -1][ ][ 4][35625][2.24][ 0][ ]] +[[Schr'''ö'''der][ 2][ 218][[role blue 1.04]][ 0][ ][ 3][ 245][1.11][ -1][ ][ 3][ 245][1.09][ -1][ ][ 4][35625][2.24][ 0][ ]] ] [/end of table root] [table:root_7 7th root(28) for float, double, long double and cpp_bin_float_50 types, using _X86_SSE2 [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -25,7 +25,7 @@ Fraction of full accuracy 1 [[TOMS748 ][ 12][ 493][2.18][ 1][ ][ 15][ 762][3.05][ 2][ ][ 15][ 765][3.08][ 2][ ][ 14][157343][[role red 7.09]][ 0][ ]] [[Newton ][ 5][ 226][[role blue 1.00]][ 0][ ][ 6][ 250][[role blue 1.00]][ 0][ ][ 6][ 248][[role blue 1.00]][ 0][ ][ 8][22187][[role blue 1.00]][ 0][ ]] [[Halley ][ 4][ 257][1.14][ 0][ ][ 5][ 293][1.17][ 0][ ][ 5][ 293][1.18][ 0][ ][ 6][44062][1.99][ 0][ ]] -[[Schroeder][ 5][ 285][1.26][ 0][ ][ 6][ 317][1.27][ 0][ ][ 6][ 317][1.28][ 0][ ][ 7][61406][2.77][ 0][ ]] +[[Schr'''ö'''der][ 5][ 285][1.26][ 0][ ][ 6][ 317][1.27][ 0][ ][ 6][ 317][1.28][ 0][ ][ 7][61406][2.77][ 0][ ]] ] [/end of table root] [table:root_11 11th root(28) for float, double, long double and cpp_bin_float_50 types, using _X86_SSE2 [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -33,5 +33,5 @@ Fraction of full accuracy 1 [[TOMS748 ][ 12][ 556][2.24][ -2][ ][ 14][ 784][2.94][ 2][ ][ 14][ 793][2.94][ 2][ ][ 17][235781][[role red 8.88]][ 2][ ]] [[Newton ][ 6][ 248][[role blue 1.00]][ 0][ ][ 7][ 267][[role blue 1.00]][ 0][ ][ 7][ 270][[role blue 1.00]][ 0][ ][ 9][26562][[role blue 1.00]][ 0][ ]] [[Halley ][ 4][ 254][[role blue 1.02]][ -1][ ][ 5][ 290][1.09][ 0][ ][ 5][ 293][1.09][ 0][ ][ 6][46406][1.75][ 0][ ]] -[[Schroeder][ 6][ 312][1.26][ 0][ ][ 7][ 351][1.31][ 0][ ][ 7][ 356][1.32][ 0][ ][ 8][76250][2.87][ 0][ ]] +[[Schr'''ö'''der][ 6][ 312][1.26][ 0][ ][ 7][ 351][1.31][ 0][ ][ 7][ 356][1.32][ 0][ ][ 8][76250][2.87][ 0][ ]] ] [/end of table root] diff --git a/doc/roots/roots_table_75_gcc_SEE_SEE2_X64.qbk b/doc/roots/roots_table_75_gcc_SEE_SEE2_X64.qbk index e7335f6fa..2d967d992 100644 --- a/doc/roots/roots_table_75_gcc_SEE_SEE2_X64.qbk +++ b/doc/roots/roots_table_75_gcc_SEE_SEE2_X64.qbk @@ -17,7 +17,7 @@ Fraction of full accuracy 0.75 [[TOMS748 ][ 7][ 312][2.50][ 0][ ][ 11][ 484][3.46][ 1][ ][ 9][ 1625][4.17][ 0][ ][ 11][67718][6.46][ 0][ ]] [[Newton ][ 3][ 125][1.00][ 0][ ][ 5][ 140][1.00][ -1][ ][ 4][ 390][1.00][ 0][ ][ 6][10484][1.00][ 0][ ]] [[Halley ][ 2][ 125][1.00][ 0][ ][ 3][ 156][1.11][ 0][ ][ 3][ 453][1.16][ 0][ ][ 4][17359][1.66][ 0][ ]] -[[Schroeder][ 6][ 203][1.62][ 0][ ][ 7][ 234][1.67][ -1][ ][ 7][ 625][1.60][ 0][ ][ 8][35203][3.36][ 0][ ]] +[[Schr'''ö'''der][ 6][ 203][1.62][ 0][ ][ 7][ 234][1.67][ -1][ ][ 7][ 625][1.60][ 0][ ][ 8][35203][3.36][ 0][ ]] ] [/end of table root] [table:root_7 7th root(28) for float, double, long double and cpp_bin_float_50 types. [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -25,7 +25,7 @@ Fraction of full accuracy 0.75 [[TOMS748 ][ 12][ 531][3.40][ 1][ ][ 15][ 734][4.29][ 2][ ][ 13][ 2437][5.04][ 0][ ][ 14][105421][6.48][ 0][ ]] [[Newton ][ 5][ 156][1.00][ 0][ ][ 7][ 171][1.00][ 0][ ][ 6][ 484][1.00][ 0][ ][ 8][16281][1.00][ 0][ ]] [[Halley ][ 5][ 187][1.20][ 0][ ][ 6][ 234][1.37][ 0][ ][ 5][ 796][1.64][ 0][ ][ 6][30781][1.89][ 0][ ]] -[[Schroeder][ 5][ 187][1.20][ 0][ ][ 6][ 218][1.27][ 0][ ][ 6][ 546][1.13][ 0][ ][ 7][30640][1.88][ 0][ ]] +[[Schr'''ö'''der][ 5][ 187][1.20][ 0][ ][ 6][ 218][1.27][ 0][ ][ 6][ 546][1.13][ 0][ ][ 7][30640][1.88][ 0][ ]] ] [/end of table root] [table:root_11 11th root(28) for float, double, long double and cpp_bin_float_50 types. [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -33,5 +33,5 @@ Fraction of full accuracy 0.75 [[TOMS748 ][ 11][ 546][3.19][ 0][ ][ 14][ 750][4.01][ 2][ ][ 14][ 2828][5.33][ 1][ ][ 17][153093][7.82][ 2][ ]] [[Newton ][ 6][ 171][1.00][ 0][ ][ 7][ 187][1.00][ 0][ ][ 8][ 531][1.00][ 0][ ][ 9][19578][1.00][ 0][ ]] [[Halley ][ 5][ 203][1.19][ 0][ ][ 6][ 234][1.25][ 0][ ][ 6][ 703][1.32][ 0][ ][ 7][36296][1.85][ 0][ ]] -[[Schroeder][ 6][ 203][1.19][ 0][ ][ 7][ 250][1.34][ 0][ ][ 7][ 578][1.09][ 0][ ][ 8][38046][1.94][ 0][ ]] +[[Schr'''ö'''der][ 6][ 203][1.19][ 0][ ][ 7][ 250][1.34][ 0][ ][ 7][ 578][1.09][ 0][ ][ 8][38046][1.94][ 0][ ]] ] [/end of table root] diff --git a/doc/roots/roots_table_75_gcc_X64_SSE2.qbk b/doc/roots/roots_table_75_gcc_X64_SSE2.qbk index b7b81211f..b10640aef 100644 --- a/doc/roots/roots_table_75_gcc_X64_SSE2.qbk +++ b/doc/roots/roots_table_75_gcc_X64_SSE2.qbk @@ -17,7 +17,7 @@ Fraction of full accuracy 0.75 [[TOMS748 ][ 7][ 250][2.29][ 0][ ][ 11][ 484][3.87][ 1][ ][ 9][ 1546][4.31][ 0][ ][ 11][57453][[role red 6.11]][ 0][ ]] [[Newton ][ 3][ 109][[role blue 1.00]][ 0][ ][ 5][ 125][[role blue 1.00]][ -1][ ][ 4][ 359][[role blue 1.00]][ 0][ ][ 6][ 9406][[role blue 1.00]][ 0][ ]] [[Halley ][ 2][ 109][[role blue 1.00]][ 0][ ][ 3][ 140][[role blue 1.12]][ 0][ ][ 3][ 453][[role blue 1.26]][ 0][ ][ 4][15359][[role blue 1.63]][ 0][ ]] -[[Schroeder][ 6][ 203][[role blue 1.86]][ 0][ ][ 7][ 218][[role blue 1.74]][ -1][ ][ 7][ 562][[role blue 1.57]][ 0][ ][ 8][30921][3.29][ 0][ ]] +[[Schr'''ö'''der][ 6][ 203][[role blue 1.86]][ 0][ ][ 7][ 218][[role blue 1.74]][ -1][ ][ 7][ 562][[role blue 1.57]][ 0][ ][ 8][30921][3.29][ 0][ ]] ] [/end of table root] [table:root_7 7th root(28) for float, double, long double and cpp_bin_float_50 types, using _X64_SSE2 [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -25,7 +25,7 @@ Fraction of full accuracy 0.75 [[TOMS748 ][ 12][ 468][3.74][ 1][ ][ 15][ 671][4.30][ 2][ ][ 13][ 2359][[role red 5.21]][ 0][ ][ 14][88515][[role red 6.05]][ 0][ ]] [[Newton ][ 5][ 125][[role blue 1.00]][ 0][ ][ 7][ 156][[role blue 1.00]][ 0][ ][ 6][ 453][[role blue 1.00]][ 0][ ][ 8][14625][[role blue 1.00]][ 0][ ]] [[Halley ][ 5][ 187][[role blue 1.50]][ 0][ ][ 6][ 218][[role blue 1.40]][ 0][ ][ 5][ 718][[role blue 1.58]][ 0][ ][ 6][27843][[role blue 1.90]][ 0][ ]] -[[Schroeder][ 5][ 171][[role blue 1.37]][ 0][ ][ 6][ 203][[role blue 1.30]][ 0][ ][ 6][ 515][[role blue 1.14]][ 0][ ][ 7][27640][[role blue 1.89]][ 0][ ]] +[[Schr'''ö'''der][ 5][ 171][[role blue 1.37]][ 0][ ][ 6][ 203][[role blue 1.30]][ 0][ ][ 6][ 515][[role blue 1.14]][ 0][ ][ 7][27640][[role blue 1.89]][ 0][ ]] ] [/end of table root] [table:root_11 11th root(28) for float, double, long double and cpp_bin_float_50 types, using _X64_SSE2 [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -33,5 +33,5 @@ Fraction of full accuracy 0.75 [[TOMS748 ][ 11][ 515][3.30][ 0][ ][ 14][ 718][4.20][ 2][ ][ 14][ 2765][[role red 5.37]][ 1][ ][ 17][132062][[role red 7.46]][ 2][ ]] [[Newton ][ 6][ 156][[role blue 1.00]][ 0][ ][ 7][ 171][[role blue 1.00]][ 0][ ][ 8][ 515][[role blue 1.00]][ 0][ ][ 9][17703][[role blue 1.00]][ 0][ ]] [[Halley ][ 5][ 187][[role blue 1.20]][ 0][ ][ 6][ 218][[role blue 1.27]][ 0][ ][ 6][ 671][[role blue 1.30]][ 0][ ][ 7][32000][[role blue 1.81]][ 0][ ]] -[[Schroeder][ 6][ 203][[role blue 1.30]][ 0][ ][ 7][ 234][[role blue 1.37]][ 0][ ][ 7][ 578][[role blue 1.12]][ 0][ ][ 8][34265][[role blue 1.94]][ 0][ ]] +[[Schr'''ö'''der][ 6][ 203][[role blue 1.30]][ 0][ ][ 7][ 234][[role blue 1.37]][ 0][ ][ 7][ 578][[role blue 1.12]][ 0][ ][ 8][34265][[role blue 1.94]][ 0][ ]] ] [/end of table root] diff --git a/doc/roots/roots_table_75_msvc.qbk b/doc/roots/roots_table_75_msvc.qbk index 977ae4638..2fa68caed 100644 --- a/doc/roots/roots_table_75_msvc.qbk +++ b/doc/roots/roots_table_75_msvc.qbk @@ -17,7 +17,7 @@ Fraction of full accuracy 0.75 [[TOMS748 ][ 7][ 750][[role blue 1.00]][ 0][ ][ 11][ 1031][1.10][ 1][ ][ 11][ 1015][1.08][ 1][ ][ 11][125921][[role red 5.53]][ 0][ ]] [[Newton ][ 3][ 906][1.21][ 0][ ][ 5][ 953][[role blue 1.02]][ -1][ ][ 5][ 937][[role blue 1.00]][ -1][ ][ 6][22750][[role blue 1.00]][ 0][ ]] [[Halley ][ 2][ 921][1.23][ 0][ ][ 3][ 937][[role blue 1.00]][ 0][ ][ 3][ 953][[role blue 1.02]][ 0][ ][ 4][40125][1.76][ 0][ ]] -[[Schroeder][ 6][ 984][1.31][ 0][ ][ 7][ 1000][1.07][ -1][ ][ 7][ 1015][1.08][ -1][ ][ 8][73296][3.22][ 0][ ]] +[[Schr'''ö'''der][ 6][ 984][1.31][ 0][ ][ 7][ 1000][1.07][ -1][ ][ 7][ 1015][1.08][ -1][ ][ 8][73296][3.22][ 0][ ]] ] [/end of table root] [table:root_7 7th root(28) for float, double, long double and cpp_bin_float_50 types [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -25,7 +25,7 @@ Fraction of full accuracy 0.75 [[TOMS748 ][ 12][ 1015][1.08][ 1][ ][ 15][ 1265][1.29][ 2][ ][ 15][ 1265][1.31][ 2][ ][ 14][198890][[role red 5.61]][ 0][ ]] [[Newton ][ 5][ 937][[role blue 1.00]][ 0][ ][ 7][ 984][[role blue 1.00]][ 0][ ][ 7][ 1000][1.03][ 0][ ][ 8][35437][[role blue 1.00]][ 0][ ]] [[Halley ][ 5][ 984][1.05][ 0][ ][ 6][ 1078][1.10][ 0][ ][ 6][ 1046][1.08][ 0][ ][ 6][69484][1.96][ 0][ ]] -[[Schroeder][ 5][ 953][[role blue 1.02]][ 0][ ][ 6][ 1000][[role blue 1.02]][ 0][ ][ 6][ 968][[role blue 1.00]][ 0][ ][ 7][67937][1.92][ 0][ ]] +[[Schr'''ö'''der][ 5][ 953][[role blue 1.02]][ 0][ ][ 6][ 1000][[role blue 1.02]][ 0][ ][ 6][ 968][[role blue 1.00]][ 0][ ][ 7][67937][1.92][ 0][ ]] ] [/end of table root] [table:root_11 11th root(28) for float, double, long double and cpp_bin_float_50 types [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -33,5 +33,5 @@ Fraction of full accuracy 0.75 [[TOMS748 ][ 11][ 1093][1.11][ 0][ ][ 14][ 1343][1.34][ 2][ ][ 14][ 1375][1.35][ 2][ ][ 17][303625][[role red 7.07]][ 2][ ]] [[Newton ][ 6][ 984][[role blue 1.00]][ 0][ ][ 7][ 1000][[role blue 1.00]][ 0][ ][ 7][ 1015][[role blue 1.00]][ 0][ ][ 9][42921][[role blue 1.00]][ 0][ ]] [[Halley ][ 5][ 1031][1.05][ 0][ ][ 6][ 1093][1.09][ 0][ ][ 6][ 1093][1.08][ 0][ ][ 7][83062][1.94][ 0][ ]] -[[Schroeder][ 6][ 1046][1.06][ 0][ ][ 7][ 1093][1.09][ 0][ ][ 7][ 1046][1.03][ 0][ ][ 8][86234][2.01][ 0][ ]] +[[Schr'''ö'''der][ 6][ 1046][1.06][ 0][ ][ 7][ 1093][1.09][ 0][ ][ 7][ 1046][1.03][ 0][ ][ 8][86234][2.01][ 0][ ]] ] [/end of table root] diff --git a/doc/roots/roots_table_75_msvc_AVX.qbk b/doc/roots/roots_table_75_msvc_AVX.qbk index 2bade24fc..a85aef874 100644 --- a/doc/roots/roots_table_75_msvc_AVX.qbk +++ b/doc/roots/roots_table_75_msvc_AVX.qbk @@ -17,7 +17,7 @@ Fraction of full accuracy 0.75 [[TOMS748 ][ 7][ 750][[role green 1.0000]1.00][ 0][ ][ 11][ 1031][1.10031.10][ 1][ ][ 11][ 1046][1.09761.10][ 1][ ][ 11][126781][[role red 5.5348]5.53][ 0][ ]] [[Newton ][ 3][ 890][1.18671.19][ 0][ ][ 5][ 937][[role green 1.0000]1.00][ -1][ ][ 5][ 953][[role green 1.0000]1.00][ -1][ ][ 6][22906][[role green 1.0000]1.00][ 0][ ]] [[Halley ][ 2][ 937][1.24931.25][ 0][ ][ 3][ 968][1.03311.03][ 0][ ][ 3][ 953][[role green 1.0000]1.00][ 0][ ][ 4][40265][1.75781.76][ 0][ ]] -[[Schroeder][ 6][ 1000][1.33331.33][ 0][ ][ 7][ 1031][1.10031.10][ -1][ ][ 7][ 1031][1.08181.08][ -1][ ][ 8][72296][3.15623.16][ 0][ ]] +[[Schr'''ö'''der][ 6][ 1000][1.33331.33][ 0][ ][ 7][ 1031][1.10031.10][ -1][ ][ 7][ 1031][1.08181.08][ -1][ ][ 8][72296][3.15623.16][ 0][ ]] ] [/end of table root] [table:root_7 7th root(28) for float, double, long double and cpp_bin_float_50 types, using _AVX [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -25,7 +25,7 @@ Fraction of full accuracy 0.75 [[TOMS748 ][ 12][ 984][1.03251.03][ 1][ ][ 15][ 1218][1.21801.22][ 2][ ][ 15][ 1250][1.29131.29][ 2][ ][ 14][191500][[role red 5.5965]5.60][ 0][ ]] [[Newton ][ 5][ 953][[role green 1.0000]1.00][ 0][ ][ 7][ 1062][1.06201.06][ 0][ ][ 7][ 968][[role green 1.0000]1.00][ 0][ ][ 8][34218][[role green 1.0000]1.00][ 0][ ]] [[Halley ][ 5][ 1000][1.04931.05][ 0][ ][ 6][ 1109][1.10901.11][ 0][ ][ 6][ 1078][1.11361.11][ 0][ ][ 6][66765][1.95121.95][ 0][ ]] -[[Schroeder][ 5][ 984][1.03251.03][ 0][ ][ 6][ 1000][[role green 1.0000]1.00][ 0][ ][ 6][ 1000][1.03311.03][ 0][ ][ 7][65703][1.92011.92][ 0][ ]] +[[Schr'''ö'''der][ 5][ 984][1.03251.03][ 0][ ][ 6][ 1000][[role green 1.0000]1.00][ 0][ ][ 6][ 1000][1.03311.03][ 0][ ][ 7][65703][1.92011.92][ 0][ ]] ] [/end of table root] [table:root_11 11th root(28) for float, double, long double and cpp_bin_float_50 types, using _AVX [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -33,5 +33,5 @@ Fraction of full accuracy 0.75 [[TOMS748 ][ 11][ 1062][1.09711.10][ 0][ ][ 14][ 1281][1.26211.26][ 2][ ][ 14][ 1328][1.32801.33][ 2][ ][ 17][297875][[role red 7.2323]7.23][ 2][ ]] [[Newton ][ 6][ 968][[role green 1.0000]1.00][ 0][ ][ 7][ 1031][[role green 1.0158]1.02][ 0][ ][ 7][ 1000][[role green 1.0000]1.00][ 0][ ][ 9][41187][[role green 1.0000]1.00][ 0][ ]] [[Halley ][ 5][ 1015][1.04861.05][ 0][ ][ 6][ 1171][1.15371.15][ 0][ ][ 6][ 1093][1.09301.09][ 0][ ][ 7][77984][1.89341.89][ 0][ ]] -[[Schroeder][ 6][ 1000][1.03311.03][ 0][ ][ 7][ 1015][[role green 1.0000]1.00][ 0][ ][ 7][ 1046][1.04601.05][ 0][ ][ 8][77781][1.88851.89][ 0][ ]] +[[Schr'''ö'''der][ 6][ 1000][1.03311.03][ 0][ ][ 7][ 1015][[role green 1.0000]1.00][ 0][ ][ 7][ 1046][1.04601.05][ 0][ ][ 8][77781][1.88851.89][ 0][ ]] ] [/end of table root] diff --git a/doc/roots/roots_table_75_msvc_X86.qbk b/doc/roots/roots_table_75_msvc_X86.qbk index 17b992bd7..0fc823436 100644 --- a/doc/roots/roots_table_75_msvc_X86.qbk +++ b/doc/roots/roots_table_75_msvc_X86.qbk @@ -17,7 +17,7 @@ Fraction of full accuracy 0.75 [[TOMS748 ][ 8][ 1062][1.06][ -2][ ][ 11][ 1171][1.21][ 1][ ][ 11][ 1171][1.21][ 1][ ][ 11][122375][[role red 5.45]][ 0][ ]] [[Newton ][ 3][ 1000][[role blue 1.00]][ 0][ ][ 5][ 968][[role blue 1.00]][ -1][ ][ 5][ 968][[role blue 1.00]][ -1][ ][ 6][22468][[role blue 1.00]][ 0][ ]] [[Halley ][ 3][ 1062][1.06][ 0][ ][ 3][ 984][[role blue 1.02]][ 0][ ][ 3][ 984][[role blue 1.02]][ 0][ ][ 4][39234][1.75][ 0][ ]] -[[Schroeder][ 7][ 1234][1.23][ 0][ ][ 7][ 1046][1.08][ -1][ ][ 7][ 1031][1.07][ -1][ ][ 8][70406][3.13][ 0][ ]] +[[Schr'''ö'''der][ 7][ 1234][1.23][ 0][ ][ 7][ 1046][1.08][ -1][ ][ 7][ 1031][1.07][ -1][ ][ 8][70406][3.13][ 0][ ]] ] [/end of table root] [table:root_7 7th root(28) for float, double, long double and cpp_bin_float_50 types, using _X86 [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -25,7 +25,7 @@ Fraction of full accuracy 0.75 [[TOMS748 ][ 12][ 1562][1.47][ 1][ ][ 15][ 1484][1.48][ 2][ ][ 15][ 1453][1.45][ 2][ ][ 14][202265][[role red 5.41]][ 0][ ]] [[Newton ][ 5][ 1062][[role blue 1.00]][ 0][ ][ 7][ 1000][[role blue 1.00]][ 0][ ][ 7][ 1000][[role blue 1.00]][ 0][ ][ 8][37359][[role blue 1.00]][ 0][ ]] [[Halley ][ 5][ 1156][1.09][ 0][ ][ 6][ 1125][1.13][ 0][ ][ 6][ 1109][1.11][ 0][ ][ 6][71843][1.92][ 0][ ]] -[[Schroeder][ 5][ 1125][1.06][ 0][ ][ 6][ 1031][[role blue 1.03]][ 0][ ][ 6][ 1031][[role blue 1.03]][ 0][ ][ 7][67875][1.82][ 0][ ]] +[[Schr'''ö'''der][ 5][ 1125][1.06][ 0][ ][ 6][ 1031][[role blue 1.03]][ 0][ ][ 6][ 1031][[role blue 1.03]][ 0][ ][ 7][67875][1.82][ 0][ ]] ] [/end of table root] [table:root_11 11th root(28) for float, double, long double and cpp_bin_float_50 types, using _X86 [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -33,5 +33,5 @@ Fraction of full accuracy 0.75 [[TOMS748 ][ 11][ 1703][1.40][ 0][ ][ 14][ 1609][1.52][ 2][ ][ 14][ 1562][1.47][ 2][ ][ 17][290031][[role red 6.93]][ 2][ ]] [[Newton ][ 6][ 1218][[role blue 1.00]][ 0][ ][ 7][ 1062][[role blue 1.00]][ 0][ ][ 7][ 1062][[role blue 1.00]][ 0][ ][ 9][41843][[role blue 1.00]][ 0][ ]] [[Halley ][ 5][ 1265][[role blue 1.04]][ -1][ ][ 6][ 1125][1.06][ 0][ ][ 6][ 1125][1.06][ 0][ ][ 7][75937][1.81][ 0][ ]] -[[Schroeder][ 6][ 1296][1.06][ 0][ ][ 7][ 1093][[role blue 1.03]][ 0][ ][ 7][ 1078][[role blue 1.02]][ 0][ ][ 8][77500][1.85][ 0][ ]] +[[Schr'''ö'''der][ 6][ 1296][1.06][ 0][ ][ 7][ 1093][[role blue 1.03]][ 0][ ][ 7][ 1078][[role blue 1.02]][ 0][ ][ 8][77500][1.85][ 0][ ]] ] [/end of table root] diff --git a/doc/roots/roots_table_75_msvc_X86_SSE2.qbk b/doc/roots/roots_table_75_msvc_X86_SSE2.qbk index b8b3cc35b..cb276774d 100644 --- a/doc/roots/roots_table_75_msvc_X86_SSE2.qbk +++ b/doc/roots/roots_table_75_msvc_X86_SSE2.qbk @@ -17,7 +17,7 @@ Fraction of full accuracy 0.75 [[TOMS748 ][ 7][ 750][[role blue 1.00]][ 0][ ][ 11][ 1031][1.10][ 1][ ][ 11][ 1031][1.12][ 1][ ][ 11][125250][[role red 5.53]][ 0][ ]] [[Newton ][ 3][ 906][1.21][ 0][ ][ 5][ 937][[role blue 1.00]][ -1][ ][ 5][ 953][[role blue 1.03]][ -1][ ][ 6][22640][[role blue 1.00]][ 0][ ]] [[Halley ][ 2][ 921][1.23][ 0][ ][ 3][ 953][[role blue 1.02]][ 0][ ][ 3][ 921][[role blue 1.00]][ 0][ ][ 4][39390][1.74][ 0][ ]] -[[Schroeder][ 6][ 984][1.31][ 0][ ][ 7][ 1031][1.10][ -1][ ][ 7][ 1031][1.12][ -1][ ][ 8][72515][3.20][ 0][ ]] +[[Schr'''ö'''der][ 6][ 984][1.31][ 0][ ][ 7][ 1031][1.10][ -1][ ][ 7][ 1031][1.12][ -1][ ][ 8][72515][3.20][ 0][ ]] ] [/end of table root] [table:root_7 7th root(28) for float, double, long double and cpp_bin_float_50 types, using _X86_SSE2 [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -25,7 +25,7 @@ Fraction of full accuracy 0.75 [[TOMS748 ][ 12][ 1000][1.09][ 1][ ][ 15][ 1218][1.28][ 2][ ][ 15][ 1218][1.26][ 2][ ][ 14][192640][[role red 5.64]][ 0][ ]] [[Newton ][ 5][ 921][[role blue 1.00]][ 0][ ][ 7][ 953][[role blue 1.00]][ 0][ ][ 7][ 968][[role blue 1.00]][ 0][ ][ 8][34156][[role blue 1.00]][ 0][ ]] [[Halley ][ 5][ 1000][1.09][ 0][ ][ 6][ 1031][1.08][ 0][ ][ 6][ 1031][1.07][ 0][ ][ 6][66625][1.95][ 0][ ]] -[[Schroeder][ 5][ 968][1.05][ 0][ ][ 6][ 968][[role blue 1.02]][ 0][ ][ 6][ 1015][[role blue 1.05]][ 0][ ][ 7][64953][1.90][ 0][ ]] +[[Schr'''ö'''der][ 5][ 968][1.05][ 0][ ][ 6][ 968][[role blue 1.02]][ 0][ ][ 6][ 1015][[role blue 1.05]][ 0][ ][ 7][64953][1.90][ 0][ ]] ] [/end of table root] [table:root_11 11th root(28) for float, double, long double and cpp_bin_float_50 types, using _X86_SSE2 [[][float][][][] [][double][][][] [][long d][][][] [][cpp50][][]] @@ -33,5 +33,5 @@ Fraction of full accuracy 0.75 [[TOMS748 ][ 11][ 1046][1.08][ 0][ ][ 14][ 1296][1.32][ 2][ ][ 14][ 1312][1.33][ 2][ ][ 17][288437][[role red 6.98]][ 2][ ]] [[Newton ][ 6][ 968][[role blue 1.00]][ 0][ ][ 7][ 984][[role blue 1.00]][ 0][ ][ 7][ 984][[role blue 1.00]][ 0][ ][ 9][41328][[role blue 1.00]][ 0][ ]] [[Halley ][ 5][ 1000][[role blue 1.03]][ 0][ ][ 6][ 1046][1.06][ 0][ ][ 6][ 1046][1.06][ 0][ ][ 7][78593][1.90][ 0][ ]] -[[Schroeder][ 6][ 1015][[role blue 1.05]][ 0][ ][ 7][ 1046][1.06][ 0][ ][ 7][ 1046][1.06][ 0][ ][ 8][78218][1.89][ 0][ ]] +[[Schr'''ö'''der][ 6][ 1015][[role blue 1.05]][ 0][ ][ 7][ 1046][1.06][ 0][ ][ 7][ 1046][1.06][ 0][ ][ 8][78218][1.89][ 0][ ]] ] [/end of table root] diff --git a/example/root_elliptic_finding.cpp b/example/root_elliptic_finding.cpp index 425871ac8..9bc03a783 100644 --- a/example/root_elliptic_finding.cpp +++ b/example/root_elliptic_finding.cpp @@ -5,7 +5,7 @@ // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) -// Comparison of finding roots using TOMS748, Newton-Raphson, Halley & Schroeder algorithms. +// Comparison of finding roots using TOMS748, Newton-Raphson, Halley & Schroder algorithms. // root_n_finding_algorithms.cpp Generalised for nth root version. // http://en.wikipedia.org/wiki/Cube_root @@ -28,7 +28,7 @@ //using boost::math::tools::toms748_solve; //using boost::math::tools::halley_iterate; //using boost::math::tools::newton_raphson_iterate; -//using boost::math::tools::schroeder_iterate; +//using boost::math::tools::schroder_iterate; #include // For float_distance. @@ -117,7 +117,7 @@ std::ofstream fout; std::vector algo_names = { - "TOMS748", "Newton", "Halley", "Schroeder" + "TOMS748", "Newton", "Halley", "Schr'''ö'''der" }; std::vector names = @@ -135,7 +135,7 @@ struct root_info std::size_t bin_digits; // binary in floating-point type numeric_limits::digits; int get_digits; // fraction of maximum possible accuracy required. // = digits * digits_accuracy - // Vector of values (4) for each algorithm, TOMS748, Newton, Halley & Schroeder. + // Vector of values (4) for each algorithm, TOMS748, Newton, Halley & Schroder. //std::vector< boost::int_least64_t> times; converted to int. std::vector times; // arbirary units (ticks). //boost::int_least64_t min_time = std::numeric_limits::max(); // Used to normalize times (as int). @@ -337,14 +337,14 @@ T elliptic_root_2deriv(T radius, T arc) return result; } // nth_2deriv Halley //] -// Using 1st and 2nd derivatives using Schroeder algorithm. +// Using 1st and 2nd derivatives using Schroder algorithm. template T elliptic_root_2deriv_s(T arc, T radius) -{ // return nth root of x using 1st and 2nd derivatives and Schroeder. +{ // return nth root of x using 1st and 2nd derivatives and Schroder. using namespace std; // Help ADL of std functions. - using namespace boost::math::tools; // For schroeder_iterate. + using namespace boost::math::tools; // For schroder_iterate. BOOST_STATIC_ASSERT_MSG(boost::is_integral::value == false, "Only floating-point type types can be used!"); @@ -356,7 +356,7 @@ T elliptic_root_2deriv_s(T arc, T radius) int get_digits = static_cast(digits * digits_accuracy); const boost::uintmax_t maxit = 20; boost::uintmax_t it = maxit; - T result = schroeder_iterate(elliptic_root_functor_2deriv(arc, radius), guess, min, max, get_digits, it); + T result = schroder_iterate(elliptic_root_functor_2deriv(arc, radius), guess, min, max, get_digits, it); iters = it; return result; @@ -551,7 +551,7 @@ int test_root(cpp_bin_float_100 big_radius, cpp_bin_float_100 big_arc, cpp_bin_f root_infos[type_no].full_results.push_back(result); } { - // algorithm_names.push_back("Schroeder"); // algorithm + // algorithm_names.push_back("Schr'''ö'''der"); // algorithm cpu_timer ti; // Can start, pause, resume and stop, and read elapsed. ti.start(); for(long i = eval_count; i >= 0; --i) diff --git a/example/root_finding_algorithms.cpp b/example/root_finding_algorithms.cpp index df38d55b5..ac1e077a7 100644 --- a/example/root_finding_algorithms.cpp +++ b/example/root_finding_algorithms.cpp @@ -5,7 +5,7 @@ // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) -// Comparison of finding roots using TOMS748, Newton-Raphson, Schroeder & Halley algorithms. +// Comparison of finding roots using TOMS748, Newton-Raphson, Schroder & Halley algorithms. // Note that this file contains Quickbook mark-up as well as code // and comments, don't change any of the special comment mark-ups! @@ -29,7 +29,7 @@ //using boost::math::tools::eps_tolerance; // Binary functor for specified number of bits. //using boost::math::tools::bracket_and_solve_root; //using boost::math::tools::toms748_solve; -//using boost::math::tools::schroeder_iterate; +//using boost::math::tools::schroder_iterate; #include // For float_distance. #include // for tuple and make_tuple. @@ -121,7 +121,7 @@ std::ofstream fout (filename.c_str(), std::ios_base::out); std::vector algo_names = { - "cbrt", "TOMS748", "Newton", "Halley", "Schroeder" + "cbrt", "TOMS748", "Newton", "Halley", "Schr'''ö'''der" }; std::vector max_digits10s; @@ -323,11 +323,11 @@ T cbrt_2deriv(T x) return result; } -// Using 1st and 2nd derivatives using Schroeder algorithm. +// Using 1st and 2nd derivatives using Schroder algorithm. template T cbrt_2deriv_s(T x) -{ // return cube root of x using 1st and 2nd derivatives and Schroeder algorithm. +{ // return cube root of x using 1st and 2nd derivatives and Schroder algorithm. //using namespace std; // Help ADL of std functions. using namespace boost::math::tools; int exponent; @@ -346,7 +346,7 @@ T cbrt_2deriv_s(T x) int get_digits = static_cast(std::numeric_limits::digits * 0.4); const boost::uintmax_t maxit = 20; boost::uintmax_t it = maxit; - T result = schroeder_iterate(cbrt_functor_2deriv(x), guess, min, max, get_digits, it); + T result = schroder_iterate(cbrt_functor_2deriv(x), guess, min, max, get_digits, it); iters = it; return result; } // template T cbrt_2deriv_s(T x) diff --git a/example/root_finding_example.cpp b/example/root_finding_example.cpp index 6b5ec1f40..887796c00 100644 --- a/example/root_finding_example.cpp +++ b/example/root_finding_example.cpp @@ -319,7 +319,10 @@ T cbrt_2deriv_lambda(T x) int get_digits = static_cast(digits * 0.4); // Accuracy tripples with each step, so stop when just // over one third of the digits are correct. boost::uintmax_t maxit = 20; - T result = halley_iterate([x](const T& g){ return std::make_tuple(g * g * g - x, 3 * g * g, 6 * g); }, guess, min, max, get_digits, maxit); + T result = halley_iterate( + // lambda function: + [x](const T& g){ return std::make_tuple(g * g * g - x, 3 * g * g, 6 * g); }, + guess, min, max, get_digits, maxit); return result; } diff --git a/example/root_finding_fifth.cpp b/example/root_finding_fifth.cpp index f7fc63be8..a5f69938f 100644 --- a/example/root_finding_fifth.cpp +++ b/example/root_finding_fifth.cpp @@ -7,7 +7,7 @@ // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) -// Example of finding fifth root using Newton-Raphson, Halley, Schroeder, TOMS748 . +// Example of finding fifth root using Newton-Raphson, Halley, Schroder, TOMS748 . // Note that this file contains Quickbook mark-up as well as code // and comments, don't change any of the special comment mark-ups! diff --git a/example/root_finding_start_locations.cpp b/example/root_finding_start_locations.cpp index 67b7eaac2..c906381d6 100644 --- a/example/root_finding_start_locations.cpp +++ b/example/root_finding_start_locations.cpp @@ -5,7 +5,7 @@ // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) -// Comparison of finding roots using TOMS748, Newton-Raphson, Halley & Schroeder algorithms. +// Comparison of finding roots using TOMS748, Newton-Raphson, Halley & Schroder algorithms. // Note that this file contains Quickbook mark-up as well as code // and comments, don't change any of the special comment mark-ups! // This program also writes files in Quickbook tables mark-up format. @@ -140,7 +140,7 @@ boost::uintmax_t cbrt_2deriv_s(T x, T guess) int get_digits = static_cast(digits * 0.4); // Accuracy tripples with each step, so stop when just // over one third of the digits are correct. boost::uintmax_t maxit = 20; - schroeder_iterate(cbrt_functor_2deriv(x), guess, min, max, get_digits, maxit); + schroder_iterate(cbrt_functor_2deriv(x), guess, min, max, get_digits, maxit); return maxit; } @@ -283,14 +283,14 @@ boost::uintmax_t elliptic_root_2deriv(T radius, T arc, T guess) return it; } // nth_2deriv Halley //] -// Using 1st and 2nd derivatives using Schroeder algorithm. +// Using 1st and 2nd derivatives using Schroder algorithm. template boost::uintmax_t elliptic_root_2deriv_s(T radius, T arc, T guess) -{ // return nth root of x using 1st and 2nd derivatives and Schroeder. +{ // return nth root of x using 1st and 2nd derivatives and Schroder. using namespace std; // Help ADL of std functions. - using namespace boost::math::tools; // For schroeder_iterate. + using namespace boost::math::tools; // For schroder_iterate. BOOST_STATIC_ASSERT_MSG(boost::is_integral::value == false, "Only floating-point type types can be used!"); @@ -301,7 +301,7 @@ boost::uintmax_t elliptic_root_2deriv_s(T radius, T arc, T guess) int get_digits = static_cast(digits * 0.4); const boost::uintmax_t maxit = 20; boost::uintmax_t it = maxit; - schroeder_iterate(elliptic_root_functor_2deriv(arc, radius), guess, min, max, get_digits, it); + schroder_iterate(elliptic_root_functor_2deriv(arc, radius), guess, min, max, get_digits, it); return it; } // T elliptic_root_2deriv_s Schroder @@ -358,7 +358,7 @@ int main() << "][" << cbrt_2deriv(to_root, answer + answer) << "][" << cbrt_2deriv(to_root, answer + answer * 5) << "]]\n"; - std::cout << "[[schroeder_iterate][" + std::cout << "[[schr'''ö'''der_iterate][" << cbrt_2deriv_s(to_root, answer / 6) << "][" << cbrt_2deriv_s(to_root, answer / 2) << "][" << cbrt_2deriv_s(to_root, answer - answer * 0.5) @@ -424,7 +424,7 @@ int main() << "][" << elliptic_root_2deriv(radius_a, arc_length, radius_b + radius_b) << "][" << elliptic_root_2deriv(radius_a, arc_length, radius_b + radius_b * 5) << "]]\n"; - std::cout << "[[schroeder_iterate][" + std::cout << "[[schr'''ö'''der_iterate][" << elliptic_root_2deriv_s(radius_a, arc_length, radius_b / 6) << "][" << elliptic_root_2deriv_s(radius_a, arc_length, radius_b / 2) << "][" << elliptic_root_2deriv_s(radius_a, arc_length, radius_b - radius_b * 0.5) diff --git a/example/root_n_finding_algorithms.cpp b/example/root_n_finding_algorithms.cpp index b6b445b6f..0a87ceee9 100644 --- a/example/root_n_finding_algorithms.cpp +++ b/example/root_n_finding_algorithms.cpp @@ -5,7 +5,7 @@ // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) -// Comparison of finding roots using TOMS748, Newton-Raphson, Halley & Schroeder algorithms. +// Comparison of finding roots using TOMS748, Newton-Raphson, Halley & Schroder algorithms. // root_n_finding_algorithms.cpp Generalised for nth root version. // http://en.wikipedia.org/wiki/Cube_root @@ -27,7 +27,7 @@ //using boost::math::tools::toms748_solve; //using boost::math::tools::halley_iterate; //using boost::math::tools::newton_raphson_iterate; -//using boost::math::tools::schroeder_iterate; +//using boost::math::tools::schroder_iterate; #include // For float_distance. #include // For pow. @@ -118,7 +118,7 @@ std::ofstream fout; std::vector algo_names = { - "TOMS748", "Newton", "Halley", "Schroeder" + "TOMS748", "Newton", "Halley", "Schr'''ö'''der" }; std::vector names = @@ -136,7 +136,7 @@ struct root_info std::size_t bin_digits; // binary in floating-point type numeric_limits::digits; int get_digits; // fraction of maximum possible accuracy required. // = digits * digits_accuracy - // Vector of values (4) for each algorithm, TOMS748, Newton, Halley & Schroeder. + // Vector of values (4) for each algorithm, TOMS748, Newton, Halley & Schroder. //std::vector< boost::int_least64_t> times; converted to int. std::vector times; // arbirary units (ticks). //boost::int_least64_t min_time = std::numeric_limits::max(); // Used to normalize times (as int). @@ -324,10 +324,10 @@ T nth_root_2deriv(T x) template T nth_root_2deriv_s(T x) -{ // return nth root of x using 1st and 2nd derivatives and Schroeder. +{ // return nth root of x using 1st and 2nd derivatives and Schroder. using namespace std; // Help ADL of std functions. - using namespace boost::math::tools; // For schroeder_iterate. + using namespace boost::math::tools; // For schroder_iterate. BOOST_STATIC_ASSERT_MSG(boost::is_integral::value == false, "Only floating-point type types can be used!"); BOOST_STATIC_ASSERT_MSG((N > 0) == true, "root N must be > 0!"); @@ -344,7 +344,7 @@ T nth_root_2deriv_s(T x) int get_digits = static_cast(std::numeric_limits::digits * 0.4); const boost::uintmax_t maxit = 20; boost::uintmax_t it = maxit; - T result = schroeder_iterate(nth_root_functor_2deriv(x), guess, min, max, get_digits, it); + T result = schroder_iterate(nth_root_functor_2deriv(x), guess, min, max, get_digits, it); iters = it; return result; @@ -539,7 +539,7 @@ int test_root(cpp_bin_float_100 big_value, cpp_bin_float_100 answer, const char* root_infos[type_no].full_results.push_back(result); } { - // algorithm_names.push_back("Schroeder"); // algorithm + // algorithm_names.push_back("Schroder"); // algorithm cpu_timer ti; // Can start, pause, resume and stop, and read elapsed. ti.start(); for (long i = 0; i < eval_count; ++i) diff --git a/include/boost/math/tools/roots.hpp b/include/boost/math/tools/roots.hpp index 10a1d42ef..3cafa9836 100644 --- a/include/boost/math/tools/roots.hpp +++ b/include/boost/math/tools/roots.hpp @@ -347,7 +347,7 @@ namespace detail{ bool out_of_bounds_sentry = false; #ifdef BOOST_MATH_INSTRUMENT - std::cout << "Halley iteration, limit = " << factor << std::endl; + std::cout << "Second order root iteration, limit = " << factor << std::endl; #endif boost::uintmax_t count(max_iter); @@ -369,7 +369,7 @@ namespace detail{ { // Oops zero derivative!!! #ifdef BOOST_MATH_INSTRUMENT - std::cout << "Halley iteration, zero derivative found" << std::endl; + std::cout << "Second order root iteration, zero derivative found" << std::endl; #endif detail::handle_zero_derivative(f, last_f0, f0, delta, result, guess, min, max); } @@ -398,7 +398,7 @@ namespace detail{ delta = f0 / f1; } #ifdef BOOST_MATH_INSTRUMENT - std::cout << "Halley iteration, delta = " << delta << std::endl; + std::cout << "Second order root iteration, delta = " << delta << std::endl; #endif T convergence = fabs(delta / delta2); if((convergence > 0.8) && (convergence < 2)) @@ -469,7 +469,7 @@ namespace detail{ max_iter -= count; #ifdef BOOST_MATH_INSTRUMENT - std::cout << "Halley iteration, final count = " << max_iter << std::endl; + std::cout << "Second order root iteration, final count = " << max_iter << std::endl; #endif return result; @@ -492,7 +492,7 @@ inline T halley_iterate(F f, T guess, T min, T max, int digits) namespace detail{ - struct schroeder_stepper + struct schroder_stepper { template static T step(const T& x, const T& f0, const T& f1, const T& f2) @@ -514,19 +514,35 @@ namespace detail{ } +template +T schroder_iterate(F f, T guess, T min, T max, int digits, boost::uintmax_t& max_iter) +{ + return detail::second_order_root_finder(f, guess, min, max, digits, max_iter); +} + +template +inline T schroder_iterate(F f, T guess, T min, T max, int digits) +{ + boost::uintmax_t m = (std::numeric_limits::max)(); + return schroder_iterate(f, guess, min, max, digits, m); +} +// +// These two are the old spelling of this function, retained for backwards compatibity just in case: +// template T schroeder_iterate(F f, T guess, T min, T max, int digits, boost::uintmax_t& max_iter) { - return detail::second_order_root_finder(f, guess, min, max, digits, max_iter); + return detail::second_order_root_finder(f, guess, min, max, digits, max_iter); } template inline T schroeder_iterate(F f, T guess, T min, T max, int digits) { boost::uintmax_t m = (std::numeric_limits::max)(); - return schroeder_iterate(f, guess, min, max, digits, m); + return schroder_iterate(f, guess, min, max, digits, m); } + } // namespace tools } // namespace math } // namespace boost diff --git a/include_private/boost/math/tools/test.hpp b/include_private/boost/math/tools/test.hpp index 8527b1cf4..03a2a9d26 100644 --- a/include_private/boost/math/tools/test.hpp +++ b/include_private/boost/math/tools/test.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -60,98 +61,9 @@ struct calculate_result_type template T relative_error(T a, T b) { - BOOST_MATH_STD_USING -#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS - // - // If math.h has no long double support we can't rely - // on the math functions generating exponents outside - // the range of a double: - // - T min_val = (std::max)( - tools::min_value(), - static_cast((std::numeric_limits::min)())); - T max_val = (std::min)( - tools::max_value(), - static_cast((std::numeric_limits::max)())); -#else - T min_val = tools::min_value(); - T max_val = tools::max_value(); -#endif - - if((a != 0) && (b != 0)) - { - // TODO: use isfinite: - if(fabs(b) >= max_val) - { - if(fabs(a) >= max_val) - return 0; // one infinity is as good as another! - } - // If the result is denormalised, treat all denorms as equivalent: - if((a < min_val) && (a > 0)) - a = min_val; - else if((a > -min_val) && (a < 0)) - a = -min_val; - if((b < min_val) && (b > 0)) - b = min_val; - else if((b > -min_val) && (b < 0)) - b = -min_val; - return (std::max)(fabs((a-b)/a), fabs((a-b)/b)); - } - - // Handle special case where one or both are zero: - if(min_val == 0) - return fabs(a-b); - if(fabs(a) < min_val) - a = min_val; - if(fabs(b) < min_val) - b = min_val; - return (std::max)(fabs((a-b)/a), fabs((a-b)/b)); + return boost::math::relative_difference(a, b); } -#if defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) -template <> -inline double relative_error(double a, double b) -{ - BOOST_MATH_STD_USING - // - // On Mac OS X we evaluate "double" functions at "long double" precision, - // but "long double" actually has a very slightly narrower range than "double"! - // Therefore use the range of "long double" as our limits since results outside - // that range may have been truncated to 0 or INF: - // - double min_val = (std::max)((double)tools::min_value(), tools::min_value()); - double max_val = (std::min)((double)tools::max_value(), tools::max_value()); - - if((a != 0) && (b != 0)) - { - // TODO: use isfinite: - if(b > max_val) - { - if(a > max_val) - return 0; // one infinity is as good as another! - } - // If the result is denormalised, treat all denorms as equivalent: - if((a < min_val) && (a > 0)) - a = min_val; - else if((a > -min_val) && (a < 0)) - a = -min_val; - if((b < min_val) && (b > 0)) - b = min_val; - else if((b > -min_val) && (b < 0)) - b = -min_val; - return (std::max)(fabs((a-b)/a), fabs((a-b)/b)); - } - - // Handle special case where one or both are zero: - if(min_val == 0) - return fabs(a-b); - if(fabs(a) < min_val) - a = min_val; - if(fabs(b) < min_val) - b = min_val; - return (std::max)(fabs((a-b)/a), fabs((a-b)/b)); -} -#endif template void set_output_precision(T) diff --git a/test/compile_test/tools_roots_inc_test.cpp b/test/compile_test/tools_roots_inc_test.cpp index a5a9d7f1e..1438444c9 100644 --- a/test/compile_test/tools_roots_inc_test.cpp +++ b/test/compile_test/tools_roots_inc_test.cpp @@ -34,6 +34,6 @@ void compile_and_link_test() check_result >(boost::math::tools::bisect(f, d, d, tol)); check_result(boost::math::tools::newton_raphson_iterate(f2, d, d, d, i, max_iter)); check_result(boost::math::tools::halley_iterate(f3, d, d, d, i, max_iter)); - check_result(boost::math::tools::schroeder_iterate(f3, d, d, d, i, max_iter)); + check_result(boost::math::tools::schroder_iterate(f3, d, d, d, i, max_iter)); } diff --git a/test/test_root_finding_concepts.cpp b/test/test_root_finding_concepts.cpp index ab7bc01ab..4552a6119 100644 --- a/test/test_root_finding_concepts.cpp +++ b/test/test_root_finding_concepts.cpp @@ -233,21 +233,21 @@ BOOST_AUTO_TEST_CASE( test_main ) BOOST_CHECK_CLOSE_FRACTION(expected, result, tolerance); #endif #ifndef BOOST_NO_CXX11_HDR_TUPLE - result = boost::math::tools::schroeder_iterate(f6, x, 0.0, x, std::numeric_limits::digits - 1); + result = boost::math::tools::schroder_iterate(f6, x, 0.0, x, std::numeric_limits::digits - 1); BOOST_CHECK_CLOSE_FRACTION(expected, result, tolerance); #endif - result = boost::math::tools::schroeder_iterate(f7, x, 0.0, x, std::numeric_limits::digits - 1); + result = boost::math::tools::schroder_iterate(f7, x, 0.0, x, std::numeric_limits::digits - 1); BOOST_CHECK_CLOSE_FRACTION(expected, result, tolerance); - result = boost::math::tools::schroeder_iterate(f8, x, 0.0, x, std::numeric_limits::digits - 1); + result = boost::math::tools::schroder_iterate(f8, x, 0.0, x, std::numeric_limits::digits - 1); BOOST_CHECK_CLOSE_FRACTION(expected, result, tolerance); #ifndef BOOST_NO_CXX11_LAMBDAS #ifndef BOOST_NO_CXX11_HDR_TUPLE - result = boost::math::tools::schroeder_iterate([x](double z){ return std::make_tuple(z * z * z - x, 3 * z * z, 6 * z); }, x, 0.0, x, std::numeric_limits::digits - 1); + result = boost::math::tools::schroder_iterate([x](double z){ return std::make_tuple(z * z * z - x, 3 * z * z, 6 * z); }, x, 0.0, x, std::numeric_limits::digits - 1); BOOST_CHECK_CLOSE_FRACTION(expected, result, tolerance); #endif - result = boost::math::tools::schroeder_iterate([x](double z){ return boost::tuple(z * z * z - x, 3 * z * z, 6 * z); }, x, 0.0, x, std::numeric_limits::digits - 1); + result = boost::math::tools::schroder_iterate([x](double z){ return boost::tuple(z * z * z - x, 3 * z * z, 6 * z); }, x, 0.0, x, std::numeric_limits::digits - 1); BOOST_CHECK_CLOSE_FRACTION(expected, result, tolerance); - result = boost::math::tools::schroeder_iterate([x](double z){ return boost::fusion::tuple(z * z * z - x, 3 * z * z, 6 * z); }, x, 0.0, x, std::numeric_limits::digits - 1); + result = boost::math::tools::schroder_iterate([x](double z){ return boost::fusion::tuple(z * z * z - x, 3 * z * z, 6 * z); }, x, 0.0, x, std::numeric_limits::digits - 1); BOOST_CHECK_CLOSE_FRACTION(expected, result, tolerance); #endif } // BOOST_AUTO_TEST_CASE( test_main ) diff --git a/test/test_root_iterations.cpp b/test/test_root_iterations.cpp index 8122faa71..a0b1aca91 100644 --- a/test/test_root_iterations.cpp +++ b/test/test_root_iterations.cpp @@ -94,7 +94,7 @@ BOOST_AUTO_TEST_CASE( test_main ) BOOST_CHECK_LE(iters, 7); // Schroder next: iters = 1000; - dr = boost::math::tools::schroeder_iterate(cbrt_functor_2deriv(arg), guess, result / 10, result * 10, newton_limits, iters); + dr = boost::math::tools::schroder_iterate(cbrt_functor_2deriv(arg), guess, result / 10, result * 10, newton_limits, iters); BOOST_CHECK_CLOSE_FRACTION(dr, result, std::numeric_limits::epsilon() * 2); BOOST_CHECK_LE(iters, 11); // @@ -117,7 +117,7 @@ BOOST_AUTO_TEST_CASE( test_main ) BOOST_CHECK_LE(iters, 7); // Schroder next: iters = 1000; - dr = boost::math::tools::schroeder_iterate(cbrt_functor_2deriv(arg), guess, result / 10, result * 10, newton_limits, iters); + dr = boost::math::tools::schroder_iterate(cbrt_functor_2deriv(arg), guess, result / 10, result * 10, newton_limits, iters); BOOST_CHECK_CLOSE_FRACTION(dr, result, std::numeric_limits::epsilon() * 2); BOOST_CHECK_LE(iters, 11); // @@ -140,7 +140,7 @@ BOOST_AUTO_TEST_CASE( test_main ) BOOST_CHECK_LE(iters, 3); // Schroder next: iters = 1000; - dr = boost::math::tools::schroeder_iterate(cbrt_functor_2deriv(arg), guess, result / 10, result * 10, newton_limits, iters); + dr = boost::math::tools::schroder_iterate(cbrt_functor_2deriv(arg), guess, result / 10, result * 10, newton_limits, iters); BOOST_CHECK_CLOSE_FRACTION(dr, result, std::numeric_limits::epsilon() * 2); BOOST_CHECK_LE(iters, 4); // @@ -163,7 +163,7 @@ BOOST_AUTO_TEST_CASE( test_main ) BOOST_CHECK_LE(iters, 3); // Schroder next: iters = 1000; - dr = boost::math::tools::schroeder_iterate(cbrt_functor_2deriv(arg), guess, result / 10, result * 10, newton_limits, iters); + dr = boost::math::tools::schroder_iterate(cbrt_functor_2deriv(arg), guess, result / 10, result * 10, newton_limits, iters); BOOST_CHECK_CLOSE_FRACTION(dr, result, std::numeric_limits::epsilon() * 2); BOOST_CHECK_LE(iters, 4); diff --git a/test/test_roots.cpp b/test/test_roots.cpp index 18d307938..0d67b6326 100644 --- a/test/test_roots.cpp +++ b/test/test_roots.cpp @@ -209,7 +209,7 @@ double inverse_ibeta_halley(double a, double b, double z) return boost::math::tools::halley_iterate(ibeta_roots_3 >(a, b, z, invert), guess, min, max, precision); } -double inverse_ibeta_schroeder(double a, double b, double z) +double inverse_ibeta_schroder(double a, double b, double z) { double guess = 0.5; bool invert = false; @@ -237,7 +237,7 @@ double inverse_ibeta_schroeder(double a, double b, double z) double min = 0; double max = 1; - return boost::math::tools::schroeder_iterate(ibeta_roots_3 >(a, b, z, invert), guess, min, max, precision); + return boost::math::tools::schroder_iterate(ibeta_roots_3 >(a, b, z, invert), guess, min, max, precision); } @@ -263,7 +263,7 @@ void test_inverses(const T& data) if(data[i][5] == 0) { BOOST_CHECK_EQUAL(inverse_ibeta_halley(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(0)); - BOOST_CHECK_EQUAL(inverse_ibeta_schroeder(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(0)); + BOOST_CHECK_EQUAL(inverse_ibeta_schroder(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(0)); BOOST_CHECK_EQUAL(inverse_ibeta_newton(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(0)); BOOST_CHECK_EQUAL(inverse_ibeta_bisect(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(0)); } @@ -273,7 +273,7 @@ void test_inverses(const T& data) { value_type inv = inverse_ibeta_halley(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])); BOOST_CHECK_CLOSE_EX(Real(data[i][2]), inv, precision, i); - inv = inverse_ibeta_schroeder(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])); + inv = inverse_ibeta_schroder(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])); BOOST_CHECK_CLOSE_EX(Real(data[i][2]), inv, precision, i); inv = inverse_ibeta_newton(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])); BOOST_CHECK_CLOSE_EX(Real(data[i][2]), inv, precision, i); @@ -283,7 +283,7 @@ void test_inverses(const T& data) else if(1 == data[i][5]) { BOOST_CHECK_EQUAL(inverse_ibeta_halley(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(1)); - BOOST_CHECK_EQUAL(inverse_ibeta_schroeder(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(1)); + BOOST_CHECK_EQUAL(inverse_ibeta_schroder(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(1)); BOOST_CHECK_EQUAL(inverse_ibeta_newton(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(1)); BOOST_CHECK_EQUAL(inverse_ibeta_bisect(Real(data[i][0]), Real(data[i][1]), Real(data[i][5])), value_type(1)); }