3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=US-ASCII">
4 <title>The Effect of a Poor Initial Guess
</title>
5 <link rel=
"stylesheet" href=
"../../math.css" type=
"text/css">
6 <meta name=
"generator" content=
"DocBook XSL Stylesheets V1.77.1">
7 <link rel=
"home" href=
"../../index.html" title=
"Math Toolkit 2.5.1">
8 <link rel=
"up" href=
"../roots.html" title=
"Root finding">
9 <link rel=
"prev" href=
"root_finding_examples/elliptic_eg.html" title=
"A More complex example - Inverting the Elliptic Integrals">
10 <link rel=
"next" href=
"bad_roots.html" title=
"Examples Where Root Finding Goes Wrong">
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_finding_examples/elliptic_eg.html"><img src=
"../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../roots.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=
"bad_roots.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.roots.bad_guess"></a><a class=
"link" href=
"bad_guess.html" title=
"The Effect of a Poor Initial Guess">The Effect of a Poor Initial
29 </h3></div></div></div>
31 It's instructive to take our
"toy" example algorithms, and use
32 deliberately bad initial guesses to see how the various root finding algorithms
33 fair. We'll start with the cubed root, and using the cube root of
500 as
36 <div class=
"informaltable"><table class=
"table">
123 bracket_and_solve_root
391 As you can see
<code class=
"computeroutput"><span class=
"identifier">bracket_and_solve_root
</span></code>
392 is relatively insensitive to starting location - as long as you don't start
393 many orders of magnitude away from the root it will take roughly the same
394 number of steps to bracket the root and solve it. On the other hand the derivative-based
395 methods are slow to start, but once they have some digits correct they increase
396 precision exceptionally fast: they are therefore quite sensitive to the initial
400 The next table shows the number of iterations required to find the second
401 radius of an ellipse with first radius
50 and arc-length
500:
403 <div class=
"informaltable"><table class=
"table">
490 bracket_and_solve_root
758 Interestingly this function is much more resistant to a poor initial guess
759 when using derivatives.
762 <table xmlns:
rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width=
"100%"><tr>
763 <td align=
"left"></td>
764 <td align=
"right"><div class=
"copyright-footer">Copyright
© 2006-
2010,
2012-
2014 Nikhar Agrawal,
765 Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert
766 Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R
åde, Gautam Sewani,
767 Benjamin Sobotta, Thijs van den Berg, Daryle Walker and Xiaogang Zhang
<p>
768 Distributed under the Boost Software License, Version
1.0. (See accompanying
769 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>)
774 <div class=
"spirit-nav">
775 <a accesskey=
"p" href=
"root_finding_examples/elliptic_eg.html"><img src=
"../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../roots.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=
"bad_roots.html"><img src=
"../../../../../../doc/src/images/next.png" alt=
"Next"></a>