mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-22 21:01:50 +08:00
Documentation for c26eea874d
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: numerical_methods/false_position.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -168,8 +168,7 @@ Functions</h2></td></tr>
|
||||
<div class="textblock"><p>Solve the equation \(f(x)=0\) using <a href="https://en.wikipedia.org/wiki/Regula_falsi" target="_blank">false position method</a>, also known as the Secant method. </p>
|
||||
<p>First, multiple intervals are selected with the interval gap provided. Separate recursive function called for every root. Roots are printed Separatelt.</p>
|
||||
<p>For an interval [a,b] \(a\) and \(b\) such that \(f(a)<0\) and \(f(b)>0\), then the \((i+1)^\text{th}\) approximation is given by: </p><p class="formulaDsp">
|
||||
\[
|
||||
x_{i+1} = \frac{a_i\cdot f(b_i) - b_i\cdot f(a_i)}{f(b_i) - f(a_i)}
|
||||
\[x_{i+1} = \frac{a_i\cdot f(b_i) - b_i\cdot f(a_i)}{f(b_i) - f(a_i)}
|
||||
\]
|
||||
</p>
|
||||
<p> For the next iteration, the interval is selected as: \([a,x]\) if \(x>0\) or \([x,b]\) if \(x<0\). The Process is continued till a close enough approximation is achieved.</p>
|
||||
@@ -198,7 +197,7 @@ x_{i+1} = \frac{a_i\cdot f(b_i) - b_i\cdot f(a_i)}{f(b_i) - f(a_i)}
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -346,7 +345,7 @@ x_{i+1} = \frac{a_i\cdot f(b_i) - b_i\cdot f(a_i)}{f(b_i) - f(a_i)}
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -382,10 +381,9 @@ x_{i+1} = \frac{a_i\cdot f(b_i) - b_i\cdot f(a_i)}{f(b_i) - f(a_i)}
|
||||
<div class="line"><span class="lineno"> 72</span> }</div>
|
||||
<div class="line"><span class="lineno"> 73</span> <span class="keywordtype">float</span> x3 = 0, y3 = 0;</div>
|
||||
<div class="line"><span class="lineno"> 74</span> x3 = x1 - (x1 - x2) * (y1) / (y1 - y2);</div>
|
||||
<div class="line"><span class="lineno"> 75</span> y3 = <a class="code hl_function" href="../../d7/d6a/bisection__method_8cpp.html#a2003b5b2dcfff0769b957ab5c968b03d">eq</a>(x3);</div>
|
||||
<div class="line"><span class="lineno"> 75</span> y3 = <a class="code hl_function" href="#a85a6ec58b5064d63d4f0df3854496713">eq</a>(x3);</div>
|
||||
<div class="line"><span class="lineno"> 76</span> <span class="keywordflow">return</span> <a class="code hl_function" href="#a7d69b49dc37da1c02b3ab8c7fe783494">regula_falsi</a>(x2, x3, y2, y3);</div>
|
||||
<div class="line"><span class="lineno"> 77</span>}</div>
|
||||
<div class="ttc" id="abisection__method_8cpp_html_a2003b5b2dcfff0769b957ab5c968b03d"><div class="ttname"><a href="../../d7/d6a/bisection__method_8cpp.html#a2003b5b2dcfff0769b957ab5c968b03d">eq</a></div><div class="ttdeci">static double eq(double i)</div><div class="ttdef"><b>Definition</b> <a href="../../d7/d6a/bisection__method_8cpp_source.html#l00026">bisection_method.cpp:26</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -395,7 +393,7 @@ x_{i+1} = \frac{a_i\cdot f(b_i) - b_i\cdot f(a_i)}{f(b_i) - f(a_i)}
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_9c6faab82c22511b50177aa2e38e2780.html">numerical_methods</a></li><li class="navelem"><a class="el" href="../../dd/d29/false__position_8cpp.html">false_position.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user