]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/math/doc/html/math_toolkit/ellint/ellint_2.html
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / math / doc / html / math_toolkit / ellint / ellint_2.html
CommitLineData
7c673cae
FG
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4<title>Elliptic Integrals of the Second Kind - Legendre Form</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="../ellint.html" title="Elliptic Integrals">
9<link rel="prev" href="ellint_1.html" title="Elliptic Integrals of the First Kind - Legendre Form">
10<link rel="next" href="ellint_3.html" title="Elliptic Integrals of the Third Kind - Legendre Form">
11</head>
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>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="ellint_1.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ellint.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="ellint_3.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h3 class="title">
27<a name="math_toolkit.ellint.ellint_2"></a><a class="link" href="ellint_2.html" title="Elliptic Integrals of the Second Kind - Legendre Form">Elliptic Integrals of the
28 Second Kind - Legendre Form</a>
29</h3></div></div></div>
30<h5>
31<a name="math_toolkit.ellint.ellint_2.h0"></a>
32 <span class="phrase"><a name="math_toolkit.ellint.ellint_2.synopsis"></a></span><a class="link" href="ellint_2.html#math_toolkit.ellint.ellint_2.synopsis">Synopsis</a>
33 </h5>
34<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">special_functions</span><span class="special">/</span><span class="identifier">ellint_2</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
35</pre>
36<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">math</span> <span class="special">{</span>
37
38<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">&gt;</span>
39<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_2</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">k</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">phi</span><span class="special">);</span>
40
41<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="../../policy.html" title="Chapter&#160;15.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&gt;</span>
42<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_2</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">k</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">phi</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter&#160;15.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&amp;);</span>
43
44<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
45<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_2</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">k</span><span class="special">);</span>
46
47<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="../../policy.html" title="Chapter&#160;15.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&gt;</span>
48<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_2</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">k</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter&#160;15.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&amp;);</span>
49
50<span class="special">}}</span> <span class="comment">// namespaces</span>
51</pre>
52<h5>
53<a name="math_toolkit.ellint.ellint_2.h1"></a>
54 <span class="phrase"><a name="math_toolkit.ellint.ellint_2.description"></a></span><a class="link" href="ellint_2.html#math_toolkit.ellint.ellint_2.description">Description</a>
55 </h5>
56<p>
57 These two functions evaluate the incomplete elliptic integral of the second
58 kind <span class="emphasis"><em>E(&#966;, k)</em></span> and its complete counterpart <span class="emphasis"><em>E(k)
59 = E(&#960;/2, k)</em></span>.
60 </p>
61<p>
62 <span class="inlinemediaobject"><img src="../../../graphs/ellint_2.svg" align="middle"></span>
63 </p>
64<p>
65 The return type of these functions is computed using the <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>result
66 type calculation rules</em></span></a> when T1 and T2 are different types:
67 when they are the same type then the result is the same type as the arguments.
68 </p>
69<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">&gt;</span>
70<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_2</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">k</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">phi</span><span class="special">);</span>
71
72<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="../../policy.html" title="Chapter&#160;15.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&gt;</span>
73<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_2</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">k</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">phi</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter&#160;15.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&amp;);</span>
74</pre>
75<p>
76 Returns the incomplete elliptic integral of the second kind <span class="emphasis"><em>E(&#966;,
77 k)</em></span>:
78 </p>
79<p>
80 <span class="inlinemediaobject"><img src="../../../equations/ellint3.svg"></span>
81 </p>
82<p>
83 Requires -1 &lt;= k &lt;= 1, otherwise returns the result of <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a>.
84 </p>
85<p>
86 The final <a class="link" href="../../policy.html" title="Chapter&#160;15.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can
87 be used to control the behaviour of the function: how it handles errors,
88 what level of precision to use etc. Refer to the <a class="link" href="../../policy.html" title="Chapter&#160;15.&#160;Policies: Controlling Precision, Error Handling etc">policy
89 documentation for more details</a>.
90 </p>
91<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
92<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_2</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">k</span><span class="special">);</span>
93
94<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
95<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_2</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">k</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter&#160;15.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&amp;);</span>
96</pre>
97<p>
98 Returns the complete elliptic integral of the second kind <span class="emphasis"><em>E(k)</em></span>:
99 </p>
100<p>
101 <span class="inlinemediaobject"><img src="../../../equations/ellint7.svg"></span>
102 </p>
103<p>
104 Requires -1 &lt;= k &lt;= 1, otherwise returns the result of <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a>.
105 </p>
106<p>
107 The final <a class="link" href="../../policy.html" title="Chapter&#160;15.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can
108 be used to control the behaviour of the function: how it handles errors,
109 what level of precision to use etc. Refer to the <a class="link" href="../../policy.html" title="Chapter&#160;15.&#160;Policies: Controlling Precision, Error Handling etc">policy
110 documentation for more details</a>.
111 </p>
112<h5>
113<a name="math_toolkit.ellint.ellint_2.h2"></a>
114 <span class="phrase"><a name="math_toolkit.ellint.ellint_2.accuracy"></a></span><a class="link" href="ellint_2.html#math_toolkit.ellint.ellint_2.accuracy">Accuracy</a>
115 </h5>
116<p>
117 These functions are computed using only basic arithmetic operations, so there
118 isn't much variation in accuracy over differing platforms. Note that only
119 results for the widest floating point type on the system are given as narrower
120 types have <a class="link" href="../relative_error.html#math_toolkit.relative_error.zero_error">effectively
121 zero error</a>. All values are relative errors in units of epsilon.
122 </p>
123<div class="table">
124<a name="math_toolkit.ellint.ellint_2.table_ellint_2"></a><p class="title"><b>Table&#160;6.64.&#160;Error rates for ellint_2</b></p>
125<div class="table-contents"><table class="table" summary="Error rates for ellint_2">
126<colgroup>
127<col>
128<col>
129<col>
130<col>
131<col>
132</colgroup>
133<thead><tr>
134<th>
135 </th>
136<th>
137 <p>
138 Microsoft Visual C++ version 12.0<br> Win32<br> double
139 </p>
140 </th>
141<th>
142 <p>
143 GNU C++ version 5.1.0<br> linux<br> long double
144 </p>
145 </th>
146<th>
147 <p>
148 GNU C++ version 5.1.0<br> linux<br> double
149 </p>
150 </th>
151<th>
152 <p>
153 Sun compiler version 0x5130<br> Sun Solaris<br> long double
154 </p>
155 </th>
156</tr></thead>
157<tbody>
158<tr>
159<td>
160 <p>
161 Elliptic Integral E: Mathworld Data
162 </p>
163 </td>
164<td>
165 <p>
166 <span class="blue">Max = 1.31&#949; (Mean = 0.727&#949;)</span>
167 </p>
168 </td>
169<td>
170 <p>
171 <span class="blue">Max = 0.656&#949; (Mean = 0.317&#949;)</span><br> <br>
172 (<span class="emphasis"><em>&lt;tr1/cmath&gt;:</em></span> <span class="red">Max
173 = +INF&#949; (Mean = +INF&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_long_double_ellint_2__tr1_cmath__Elliptic_Integral_E_Mathworld_Data">And
174 other failures.</a>)</span>
175 </p>
176 </td>
177<td>
178 <p>
179 <span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>GSL
180 1.16:</em></span> Max = 0.63&#949; (Mean = 0.325&#949;))<br> (<span class="emphasis"><em>Cephes:</em></span>
181 <span class="red">Max = +INF&#949; (Mean = +INF&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_ellint_2_Cephes_Elliptic_Integral_E_Mathworld_Data">And
182 other failures.</a>)</span>
183 </p>
184 </td>
185<td>
186 <p>
187 <span class="blue">Max = 0.656&#949; (Mean = 0.317&#949;)</span>
188 </p>
189 </td>
190</tr>
191<tr>
192<td>
193 <p>
194 Elliptic Integral E: Random Data
195 </p>
196 </td>
197<td>
198 <p>
199 <span class="blue">Max = 2.23&#949; (Mean = 0.639&#949;)</span>
200 </p>
201 </td>
202<td>
203 <p>
204 <span class="blue">Max = 2.05&#949; (Mean = 0.632&#949;)</span><br> <br>
205 (<span class="emphasis"><em>&lt;tr1/cmath&gt;:</em></span> Max = 3.08e+04&#949; (Mean =
206 3.84e+03&#949;))
207 </p>
208 </td>
209<td>
210 <p>
211 <span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>GSL
212 1.16:</em></span> Max = 4.4&#949; (Mean = 1.16&#949;))<br> (<span class="emphasis"><em>Cephes:</em></span>
213 Max = 8.92&#949; (Mean = 1.48&#949;))
214 </p>
215 </td>
216<td>
217 <p>
218 <span class="blue">Max = 2.05&#949; (Mean = 0.632&#949;)</span>
219 </p>
220 </td>
221</tr>
222</tbody>
223</table></div>
224</div>
225<br class="table-break"><h5>
226<a name="math_toolkit.ellint.ellint_2.h3"></a>
227 <span class="phrase"><a name="math_toolkit.ellint.ellint_2.testing"></a></span><a class="link" href="ellint_2.html#math_toolkit.ellint.ellint_2.testing">Testing</a>
228 </h5>
229<p>
230 The tests use a mixture of spot test values calculated using the online calculator
231 at <a href="http://functions.wolfram.com" target="_top">functions.wolfram.com</a>,
232 and random test data generated using NTL::RR at 1000-bit precision and this
233 implementation.
234 </p>
235<h5>
236<a name="math_toolkit.ellint.ellint_2.h4"></a>
237 <span class="phrase"><a name="math_toolkit.ellint.ellint_2.implementation"></a></span><a class="link" href="ellint_2.html#math_toolkit.ellint.ellint_2.implementation">Implementation</a>
238 </h5>
239<p>
240 These functions are implemented in terms of Carlson's integrals using the
241 relations:
242 </p>
243<p>
244 <span class="inlinemediaobject"><img src="../../../equations/ellint21.svg"></span>
245 </p>
246<p>
247 and
248 </p>
249<p>
250 <span class="inlinemediaobject"><img src="../../../equations/ellint22.svg"></span>
251 </p>
252</div>
253<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
254<td align="left"></td>
255<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014 Nikhar Agrawal,
256 Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert
257 Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam Sewani,
258 Benjamin Sobotta, Thijs van den Berg, Daryle Walker and Xiaogang Zhang<p>
259 Distributed under the Boost Software License, Version 1.0. (See accompanying
260 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>)
261 </p>
262</div></td>
263</tr></table>
264<hr>
265<div class="spirit-nav">
266<a accesskey="p" href="ellint_1.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ellint.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="ellint_3.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
267</div>
268</body>
269</html>