3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Comparison of Elliptic Integral Root Finding Algoritghms</title>
5 <link rel="stylesheet" href="../../math.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../index.html" title="Math Toolkit 2.11.0">
8 <link rel="up" href="../root_comparison.html" title="Comparison of Root Finding Algorithms">
9 <link rel="prev" href="root_n_comparison.html" title="Comparison of Nth-root Finding Algorithms">
10 <link rel="next" href="../../poly.html" title="Chapter 11. Polynomials and Rational Functions">
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
15 <td align="center"><a href="../../../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../../../more/index.htm">More</a></td>
22 <div class="spirit-nav">
23 <a accesskey="p" href="root_n_comparison.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../root_comparison.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../../poly.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h3 class="title">
27 <a name="math_toolkit.root_comparison.elliptic_comparison"></a><a class="link" href="elliptic_comparison.html" title="Comparison of Elliptic Integral Root Finding Algoritghms">Comparison
28 of Elliptic Integral Root Finding Algoritghms</a>
29 </h3></div></div></div>
31 A second example compares four root finding algorithms for locating the second
32 radius of an ellipse with first radius 28 and arc length 300, for four floating-point
33 types, <code class="computeroutput"><span class="keyword">float</span></code>, <code class="computeroutput"><span class="keyword">double</span></code>, <code class="computeroutput"><span class="keyword">long</span>
34 <span class="keyword">double</span></code> and a <a href="../../../../../../libs/multiprecision/doc/html/index.html" target="_top">Boost.Multiprecision</a>
35 type <code class="computeroutput"><span class="identifier">cpp_bin_float_50</span></code>.
38 Which is to say we're solving:
40 <pre class="programlisting">4xE(sqrt(1 - 28<sup>2</sup> / x<sup>2</sup>)) - 300 = 0</pre>
42 In each case the target accuracy was set using our "recomended"
43 accuracy limits (or at least limits that make a good starting point - which
44 is likely to give close to full accuracy without resorting to unnecessary
47 <div class="informaltable"><table class="table">
73 numeric_limits<T>::digits - 2
85 floor(numeric_limits<T>::digits * 0.6)
97 floor(numeric_limits<T>::digits * 0.4)
109 floor(numeric_limits<T>::digits * 0.4)
116 Tests used Microsoft Visual Studio 2013 (Update 1) and GCC 4.9.1 using source
117 code <a href="../../../../example/root_elliptic_finding.cpp" target="_top">root_elliptic_finding.cpp</a>.
120 The timing uncertainty (especially using MSVC) is at least 5% of normalized
124 To pick out the 'best' and 'worst' algorithms are highlighted in blue and
125 red. More than one result can be 'best' when normalized times are indistinguishable
126 within the uncertainty.
129 <a name="math_toolkit.root_comparison.elliptic_comparison.h0"></a>
130 <span class="phrase"><a name="math_toolkit.root_comparison.elliptic_comparison.program_example_root_elliptic_fi"></a></span><a class="link" href="elliptic_comparison.html#math_toolkit.root_comparison.elliptic_comparison.program_example_root_elliptic_fi">Program
131 root_elliptic_finding.cpp,
132 Microsoft Visual C++ version 14.1, Dinkumware standard library version 650,
133 Win32 Compiled in optimise mode., _X86_SSE2</a>
136 <a name="math_toolkit.root_comparison.elliptic_comparison.elliptic"></a><p class="title"><b>Table 10.12. root with radius 28 and arc length 300) for float, double, long double
137 and cpp_bin_float_50 types, using _X86_SSE2</b></p>
138 <div class="table-contents"><table class="table" summary="root with radius 28 and arc length 300) for float, double, long double
139 and cpp_bin_float_50 types, using _X86_SSE2">
214 <td class="auto-generated"> </td>
215 <td class="auto-generated"> </td>
521 <span class="blue">1.00</span>
543 <span class="blue">1.00</span>
565 <span class="blue">1.00</span>
587 <span class="blue">1.00</span>
696 <br class="table-break"><h4>
697 <a name="math_toolkit.root_comparison.elliptic_comparison.h1"></a>
698 <span class="phrase"><a name="math_toolkit.root_comparison.elliptic_comparison.program_example_root_elliptic_f0"></a></span><a class="link" href="elliptic_comparison.html#math_toolkit.root_comparison.elliptic_comparison.program_example_root_elliptic_f0">Program
699 root_elliptic_finding.cpp,
700 Microsoft Visual C++ version 12.0, Dinkumware standard library version 610,
701 Win32 Compiled in optimise mode., _X64_AVX</a>
704 <a name="math_toolkit.root_comparison.elliptic_comparison.elliptic0"></a><p class="title"><b>Table 10.13. root with radius 28 and arc length 300) for float, double, long double
705 and cpp_bin_float_50 types, using _X64_AVX</b></p>
706 <div class="table-contents"><table class="table" summary="root with radius 28 and arc length 300) for float, double, long double
707 and cpp_bin_float_50 types, using _X64_AVX">
782 <td class="auto-generated"> </td>
783 <td class="auto-generated"> </td>
1089 <span class="blue">1.00</span>
1111 <span class="blue">1.00</span>
1133 <span class="blue">1.00</span>
1155 <span class="blue">1.00</span>
1264 <br class="table-break"><h4>
1265 <a name="math_toolkit.root_comparison.elliptic_comparison.h2"></a>
1266 <span class="phrase"><a name="math_toolkit.root_comparison.elliptic_comparison.program_example_root_elliptic_f1"></a></span><a class="link" href="elliptic_comparison.html#math_toolkit.root_comparison.elliptic_comparison.program_example_root_elliptic_f1">Program
1267 root_elliptic_finding.cpp,
1268 GNU C++ version 7.1.0, GNU libstdc++ version 20170502, Win32 Compiled in
1269 optimise mode., _X64_SSE2</a>
1272 <a name="math_toolkit.root_comparison.elliptic_comparison.elliptic1"></a><p class="title"><b>Table 10.14. root with radius 28 and arc length 300) for float, double, long double
1273 and cpp_bin_float_50 types, using _X64_SSE2</b></p>
1274 <div class="table-contents"><table class="table" summary="root with radius 28 and arc length 300) for float, double, long double
1275 and cpp_bin_float_50 types, using _X64_SSE2">
1350 <td class="auto-generated"> </td>
1351 <td class="auto-generated"> </td>
1657 <span class="blue">1.00</span>
1679 <span class="blue">1.00</span>
1701 <span class="blue">1.00</span>
1723 <span class="blue">1.00</span>
1832 <br class="table-break"><p>
1835 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1836 <li class="listitem">
1837 The function being solved is now moderately expensive to call, and twice
1838 as expensive to call when obtaining the derivative than when not. Consequently
1839 there is very little improvement in moving from a derivative free method,
1840 to Newton iteration. However, once you've calculated the first derivative
1841 the second comes almost for free, consequently the third order methods
1842 (Halley) does much the best.
1844 <li class="listitem">
1845 Of the two second order methods, Halley does best as would be expected:
1846 the Schroder method offers better guarantees of <span class="emphasis"><em>quadratic</em></span>
1847 convergence, while Halley relies on a smooth function with a single root
1848 to give <span class="emphasis"><em>cubic</em></span> convergence. It's not entirely clear
1849 why Schroder iteration often does worse than Newton.
1853 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
1854 <td align="left"></td>
1855 <td align="right"><div class="copyright-footer">Copyright © 2006-2019 Nikhar
1856 Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
1857 Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Matthew Pulver, Johan
1858 Råde, Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg,
1859 Daryle Walker and Xiaogang Zhang<p>
1860 Distributed under the Boost Software License, Version 1.0. (See accompanying
1861 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
1866 <div class="spirit-nav">
1867 <a accesskey="p" href="root_n_comparison.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../root_comparison.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../../poly.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>