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.5.2">
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="../polynomials.html" title="Polynomials">
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="../polynomials.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h4 class="title">
27 <a name="math_toolkit.roots.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 </h4></div></div></div>
31 A second example compares four root finding algorithms for locating the
32 second radius of an ellipse with first radius 28 and arc length 300, for
33 four floating-point types, <code class="computeroutput"><span class="keyword">float</span></code>,
34 <code class="computeroutput"><span class="keyword">double</span></code>, <code class="computeroutput"><span class="keyword">long</span>
35 <span class="keyword">double</span></code> and a <a href="../../../../../../../libs/multiprecision/doc/html/index.html" target="_top">Boost.Multiprecision</a>
36 type <code class="computeroutput"><span class="identifier">cpp_bin_float_50</span></code>.
39 Which is to say we're solving:
41 <pre class="programlisting">4xE(sqrt(1 - 28<sup>2</sup> / x<sup>2</sup>)) - 300 = 0</pre>
43 In each case the target accuracy was set using our "recomended"
44 accuracy limits (or at least limits that make a good starting point - which
45 is likely to give close to full accuracy without resorting to unnecessary
48 <div class="informaltable"><table class="table">
74 numeric_limits<T>::digits - 2
86 floor(numeric_limits<T>::digits * 0.6)
98 floor(numeric_limits<T>::digits * 0.4)
110 floor(numeric_limits<T>::digits * 0.4)
117 Tests used Microsoft Visual Studio 2013 (Update 1) and GCC 4.9.1 using
118 source code <a href="../../../../../example/root_elliptic_finding.cpp" target="_top">root_elliptic_finding.cpp</a>.
121 The timing uncertainty (especially using MSVC) is at least 5% of normalized
125 To pick out the 'best' and 'worst' algorithms are highlighted in blue and
126 red. More than one result can be 'best' when normalized times are indistinguishable
127 within the uncertainty.
130 <a name="math_toolkit.roots.root_comparison.elliptic_comparison.h0"></a>
131 <span class="phrase"><a name="math_toolkit.roots.root_comparison.elliptic_comparison.program_example_root_elliptic_fi"></a></span><a class="link" href="elliptic_comparison.html#math_toolkit.roots.root_comparison.elliptic_comparison.program_example_root_elliptic_fi">Program
132 root_elliptic_finding.cpp,
133 Microsoft Visual C++ version 12.0, Dinkumware standard library version
134 610, Win32 Compiled in optimise mode., _X86_SSE2</a>
137 <a name="math_toolkit.roots.root_comparison.elliptic_comparison.elliptic"></a><p class="title"><b>Table 12.12. root with radius 28 and arc length 300) for float, double, long
138 double and cpp_bin_float_50 types, using _X86_SSE2</b></p>
139 <div class="table-contents"><table class="table" summary="root with radius 28 and arc length 300) for float, double, long
140 double and cpp_bin_float_50 types, using _X86_SSE2">
215 <td class="auto-generated"> </td>
216 <td class="auto-generated"> </td>
522 <span class="blue">1.00</span>
544 <span class="blue">1.00</span>
566 <span class="blue">1.00</span>
588 <span class="blue">1.00</span>
697 <br class="table-break"><h5>
698 <a name="math_toolkit.roots.root_comparison.elliptic_comparison.h1"></a>
699 <span class="phrase"><a name="math_toolkit.roots.root_comparison.elliptic_comparison.program_example_root_elliptic_f0"></a></span><a class="link" href="elliptic_comparison.html#math_toolkit.roots.root_comparison.elliptic_comparison.program_example_root_elliptic_f0">Program
700 root_elliptic_finding.cpp,
701 Microsoft Visual C++ version 12.0, Dinkumware standard library version
702 610, Win32 Compiled in optimise mode., _X64_AVX</a>
705 <a name="math_toolkit.roots.root_comparison.elliptic_comparison.elliptic0"></a><p class="title"><b>Table 12.13. root with radius 28 and arc length 300) for float, double, long
706 double and cpp_bin_float_50 types, using _X64_AVX</b></p>
707 <div class="table-contents"><table class="table" summary="root with radius 28 and arc length 300) for float, double, long
708 double and cpp_bin_float_50 types, using _X64_AVX">
783 <td class="auto-generated"> </td>
784 <td class="auto-generated"> </td>
1090 <span class="blue">1.00</span>
1112 <span class="blue">1.00</span>
1134 <span class="blue">1.00</span>
1156 <span class="blue">1.00</span>
1265 <br class="table-break"><h5>
1266 <a name="math_toolkit.roots.root_comparison.elliptic_comparison.h2"></a>
1267 <span class="phrase"><a name="math_toolkit.roots.root_comparison.elliptic_comparison.program_example_root_elliptic_f1"></a></span><a class="link" href="elliptic_comparison.html#math_toolkit.roots.root_comparison.elliptic_comparison.program_example_root_elliptic_f1">Program
1268 root_elliptic_finding.cpp,
1269 GNU C++ version 4.9.2, GNU libstdc++ version 20141030, Win32 Compiled in
1270 optimise mode., _X64_SSE2</a>
1273 <a name="math_toolkit.roots.root_comparison.elliptic_comparison.elliptic1"></a><p class="title"><b>Table 12.14. root with radius 28 and arc length 300) for float, double, long
1274 double and cpp_bin_float_50 types, using _X64_SSE2</b></p>
1275 <div class="table-contents"><table class="table" summary="root with radius 28 and arc length 300) for float, double, long
1276 double and cpp_bin_float_50 types, using _X64_SSE2">
1351 <td class="auto-generated"> </td>
1352 <td class="auto-generated"> </td>
1658 <span class="blue">1.00</span>
1680 <span class="blue">1.00</span>
1702 <span class="blue">1.00</span>
1724 <span class="blue">1.00</span>
1833 <br class="table-break"><p>
1836 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1837 <li class="listitem">
1838 The function being solved is now moderately expensive to call, and
1839 twice as expensive to call when obtaining the derivative than when
1840 not. Consequently there is very little improvement in moving from a
1841 derivative free method, to Newton iteration. However, once you've calculated
1842 the first derivative the second comes almost for free, consequently
1843 the third order methods (Halley) does much the best.
1845 <li class="listitem">
1846 Of the two second order methods, Halley does best as would be expected:
1847 the Schroder method offers better guarantees of <span class="emphasis"><em>quadratic</em></span>
1848 convergence, while Halley relies on a smooth function with a single
1849 root to give <span class="emphasis"><em>cubic</em></span> convergence. It's not entirely
1850 clear why Schroder iteration often does worse than Newton.
1854 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
1855 <td align="left"></td>
1856 <td align="right"><div class="copyright-footer">Copyright © 2006-2010, 2012-2014 Nikhar Agrawal,
1857 Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert
1858 Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan Råde, Gautam Sewani,
1859 Benjamin Sobotta, Thijs van den Berg, 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="../polynomials.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>