3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Examples of Root-Finding (with and without derivatives)</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_finding.html" title="Chapter 10. Root Finding & Minimization Algorithms">
9 <link rel="prev" href="roots_deriv.html" title="Root Finding With Derivatives: Newton-Raphson, Halley & Schröder">
10 <link rel="next" href="root_finding_examples/cbrt_eg.html" title="Finding the Cubed Root With and Without Derivatives">
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="roots_deriv.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../root_finding.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="root_finding_examples/cbrt_eg.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
27 <a name="math_toolkit.root_finding_examples"></a><a class="link" href="root_finding_examples.html" title="Examples of Root-Finding (with and without derivatives)">Examples of Root-Finding
28 (with and without derivatives)</a>
29 </h2></div></div></div>
30 <div class="toc"><dl class="toc">
31 <dt><span class="section"><a href="root_finding_examples/cbrt_eg.html">Finding the
32 Cubed Root With and Without Derivatives</a></span></dt>
33 <dt><span class="section"><a href="root_finding_examples/lambda.html">Using C++11
34 Lambda's</a></span></dt>
35 <dt><span class="section"><a href="root_finding_examples/5th_root_eg.html">Computing
36 the Fifth Root</a></span></dt>
37 <dt><span class="section"><a href="root_finding_examples/multiprecision_root.html">Root-finding
38 using Boost.Multiprecision</a></span></dt>
39 <dt><span class="section"><a href="root_finding_examples/nth_root.html">Generalizing
40 to Compute the nth root</a></span></dt>
41 <dt><span class="section"><a href="root_finding_examples/elliptic_eg.html">A More
42 complex example - Inverting the Elliptic Integrals</a></span></dt>
45 The examples demonstrate how to use the various tools for <a href="http://en.wikipedia.org/wiki/Root-finding_algorithm" target="_top">root
49 We start with the simple cube root function <code class="computeroutput"><span class="identifier">cbrt</span></code>
50 ( C++ standard function name <a href="http://en.cppreference.com/w/cpp/numeric/math/cbrt" target="_top">cbrt</a>)
51 showing root finding <a class="link" href="root_finding_examples/cbrt_eg.html#math_toolkit.root_finding_examples.cbrt_eg.cbrt_no_derivatives">without
55 We then show how use of derivatives can improve the speed of convergence.
58 (But these examples are only a demonstration and do not try to make the ultimate
59 improvements of an 'industrial-strength' implementation, for example, of <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">cbrt</span></code>, mainly
60 by using a better computed initial 'guess' at <a href="../../../../../libs/math/include/boost/math/special_functions/cbrt.hpp" target="_top">cbrt.hpp</a>).
63 Then we show how a higher root (<a class="link" href="root_finding_examples/5th_root_eg.html" title="Computing the Fifth Root">fifth
64 root</a>) <sup>5</sup>√ can be computed, and in <a href="../../../example/root_finding_n_example.cpp" target="_top">root_finding_n_example.cpp</a>
65 a generic method for the <a class="link" href="root_finding_examples/nth_root.html" title="Generalizing to Compute the nth root">nth
66 root</a> that constructs the derivatives at compile-time.
69 These methods should be applicable to other functions that can be differentiated
73 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
74 <td align="left"></td>
75 <td align="right"><div class="copyright-footer">Copyright © 2006-2019 Nikhar
76 Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
77 Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Matthew Pulver, Johan
78 Råde, Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg,
79 Daryle Walker and Xiaogang Zhang<p>
80 Distributed under the Boost Software License, Version 1.0. (See accompanying
81 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>)
86 <div class="spirit-nav">
87 <a accesskey="p" href="roots_deriv.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../root_finding.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="root_finding_examples/cbrt_eg.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>