]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/math/doc/html/math_toolkit/jacobi/jacobi_elliptic.html
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / math / doc / html / math_toolkit / jacobi / jacobi_elliptic.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Jacobi Elliptic SN, CN and DN</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="../jacobi.html" title="Jacobi Elliptic Functions">
9 <link rel="prev" href="jac_over.html" title="Overvew of the Jacobi Elliptic Functions">
10 <link rel="next" href="jacobi_cd.html" title="Jacobi Elliptic Function cd">
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="jac_over.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../jacobi.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="jacobi_cd.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.jacobi.jacobi_elliptic"></a><a class="link" href="jacobi_elliptic.html" title="Jacobi Elliptic SN, CN and DN">Jacobi Elliptic
28 SN, CN and DN</a>
29 </h3></div></div></div>
30 <h5>
31 <a name="math_toolkit.jacobi.jacobi_elliptic.h0"></a>
32 <span class="phrase"><a name="math_toolkit.jacobi.jacobi_elliptic.synopsis"></a></span><a class="link" href="jacobi_elliptic.html#math_toolkit.jacobi.jacobi_elliptic.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">jacobi_elliptic</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">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</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">jacobi_elliptic</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">k</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">V</span><span class="special">*</span> <span class="identifier">pcn</span><span class="special">,</span> <span class="identifier">V</span><span class="special">*</span> <span class="identifier">pdn</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">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Policy</span><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">jacobi_elliptic</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">k</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">V</span><span class="special">*</span> <span class="identifier">pcn</span><span class="special">,</span> <span class="identifier">V</span><span class="special">*</span> <span class="identifier">pdn</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Policy</span><span class="special">&amp;);</span>
43
44 <span class="special">}}</span> <span class="comment">// namespaces</span>
45 </pre>
46 <h5>
47 <a name="math_toolkit.jacobi.jacobi_elliptic.h1"></a>
48 <span class="phrase"><a name="math_toolkit.jacobi.jacobi_elliptic.description"></a></span><a class="link" href="jacobi_elliptic.html#math_toolkit.jacobi.jacobi_elliptic.description">Description</a>
49 </h5>
50 <p>
51 The function <a class="link" href="jacobi_elliptic.html" title="Jacobi Elliptic SN, CN and DN">jacobi_elliptic</a>
52 calculates the three copolar Jacobi elliptic functions <span class="emphasis"><em>sn(u, k)</em></span>,
53 <span class="emphasis"><em>cn(u, k)</em></span> and <span class="emphasis"><em>dn(u, k)</em></span>. The returned
54 value is <span class="emphasis"><em>sn(u, k)</em></span>, and if provided, <span class="emphasis"><em>*pcn</em></span>
55 is set to <span class="emphasis"><em>cn(u, k)</em></span>, and <span class="emphasis"><em>*pdn</em></span> is
56 set to <span class="emphasis"><em>dn(u, k)</em></span>.
57 </p>
58 <p>
59 The functions are defined as follows, given:
60 </p>
61 <p>
62 <span class="inlinemediaobject"><img src="../../../equations/jacobi1.svg"></span>
63 </p>
64 <p>
65 The the angle &#966; is called the <span class="emphasis"><em>amplitude</em></span> and:
66 </p>
67 <p>
68 <span class="inlinemediaobject"><img src="../../../equations/jacobi2.svg"></span>
69 </p>
70 <div class="note"><table border="0" summary="Note">
71 <tr>
72 <td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/src/images/note.png"></td>
73 <th align="left">Note</th>
74 </tr>
75 <tr><td align="left" valign="top">
76 <p>
77 <span class="emphasis"><em>&#966;</em></span> is called the amplitude.
78 </p>
79 <p>
80 <span class="emphasis"><em>k</em></span> is called the modulus.
81 </p>
82 </td></tr>
83 </table></div>
84 <div class="caution"><table border="0" summary="Caution">
85 <tr>
86 <td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../../../../doc/src/images/caution.png"></td>
87 <th align="left">Caution</th>
88 </tr>
89 <tr><td align="left" valign="top">
90 <p>
91 Rather like other elliptic functions, the Jacobi functions are expressed
92 in a variety of different ways. In particular, the parameter <span class="emphasis"><em>k</em></span>
93 (the modulus) may also be expressed using a modular angle &#945;, or a parameter
94 <span class="emphasis"><em>m</em></span>. These are related by:
95 </p>
96 <p>
97 k = sin&#945;
98 </p>
99 <p>
100 m = k<sup>2</sup> = sin<sup>2</sup>&#945;
101 </p>
102 <p>
103 So that the function <span class="emphasis"><em>sn</em></span> (for example) may be expressed
104 as either:
105 </p>
106 <p>
107 sn(u, k)
108 </p>
109 <p>
110 sn(u \ &#945;)
111 </p>
112 <p>
113 sn(u| m)
114 </p>
115 <p>
116 To further complicate matters, some texts refer to the <span class="emphasis"><em>complement
117 of the parameter m</em></span>, or 1 - m, where:
118 </p>
119 <p>
120 1 - m = 1 - k<sup>2</sup> = cos<sup>2</sup>&#945;
121 </p>
122 <p>
123 This implementation uses <span class="emphasis"><em>k</em></span> throughout, and makes this
124 the first argument to the functions: this is for alignment with the elliptic
125 integrals which match the requirements of the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf" target="_top">Technical
126 Report on C++ Library Extensions</a>. However, you should be extra
127 careful when using these functions!
128 </p>
129 </td></tr>
130 </table></div>
131 <p>
132 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
133 be used to control the behaviour of the function: how it handles errors,
134 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
135 documentation for more details</a>.
136 </p>
137 <p>
138 The following graphs illustrate how these functions change as <span class="emphasis"><em>k</em></span>
139 changes: for small <span class="emphasis"><em>k</em></span> these are sine waves, while as
140 <span class="emphasis"><em>k</em></span> tends to 1 they become hyperbolic functions:
141 </p>
142 <p>
143 <span class="inlinemediaobject"><img src="../../../graphs/jacobi_sn.svg" align="middle"></span>
144 </p>
145 <p>
146 <span class="inlinemediaobject"><img src="../../../graphs/jacobi_cn.svg" align="middle"></span>
147 </p>
148 <p>
149 <span class="inlinemediaobject"><img src="../../../graphs/jacobi_dn.svg" align="middle"></span>
150 </p>
151 <h5>
152 <a name="math_toolkit.jacobi.jacobi_elliptic.h2"></a>
153 <span class="phrase"><a name="math_toolkit.jacobi.jacobi_elliptic.accuracy"></a></span><a class="link" href="jacobi_elliptic.html#math_toolkit.jacobi.jacobi_elliptic.accuracy">Accuracy</a>
154 </h5>
155 <p>
156 These functions are computed using only basic arithmetic operations and trigomometric
157 functions, so there isn't much variation in accuracy over differing platforms.
158 Typically errors are trivially small for small angles, and as is typical
159 for cyclic functions, grow as the angle increases. Note that only results
160 for the widest floating point type on the system are given as narrower types
161 have <a class="link" href="../relative_error.html#math_toolkit.relative_error.zero_error">effectively zero
162 error</a>. All values are relative errors in units of epsilon.
163 </p>
164 <div class="table">
165 <a name="math_toolkit.jacobi.jacobi_elliptic.table_jacobi_cn"></a><p class="title"><b>Table&#160;6.70.&#160;Error rates for jacobi_cn</b></p>
166 <div class="table-contents"><table class="table" summary="Error rates for jacobi_cn">
167 <colgroup>
168 <col>
169 <col>
170 <col>
171 <col>
172 <col>
173 </colgroup>
174 <thead><tr>
175 <th>
176 </th>
177 <th>
178 <p>
179 Microsoft Visual C++ version 12.0<br> Win32<br> double
180 </p>
181 </th>
182 <th>
183 <p>
184 GNU C++ version 5.1.0<br> linux<br> double
185 </p>
186 </th>
187 <th>
188 <p>
189 GNU C++ version 5.1.0<br> linux<br> long double
190 </p>
191 </th>
192 <th>
193 <p>
194 Sun compiler version 0x5130<br> Sun Solaris<br> long double
195 </p>
196 </th>
197 </tr></thead>
198 <tbody>
199 <tr>
200 <td>
201 <p>
202 Jacobi Elliptic: Mathworld Data
203 </p>
204 </td>
205 <td>
206 <p>
207 <span class="blue">Max = 45.8&#949; (Mean = 11.4&#949;)</span>
208 </p>
209 </td>
210 <td>
211 <p>
212 <span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>GSL
213 1.16:</em></span> Max = 17.3&#949; (Mean = 4.29&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_jacobi_cn_GSL_1_16_Jacobi_Elliptic_Mathworld_Data">And
214 other failures.</a>)<br> (<span class="emphasis"><em>Cephes:</em></span> <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_jacobi_cn_Cephes_Jacobi_Elliptic_Mathworld_Data">And
215 other failures.</a>)</span>
216 </p>
217 </td>
218 <td>
219 <p>
220 <span class="blue">Max = 71.6&#949; (Mean = 19.3&#949;)</span>
221 </p>
222 </td>
223 <td>
224 <p>
225 <span class="blue">Max = 71.6&#949; (Mean = 19.4&#949;)</span>
226 </p>
227 </td>
228 </tr>
229 <tr>
230 <td>
231 <p>
232 Jacobi Elliptic: Random Data
233 </p>
234 </td>
235 <td>
236 <p>
237 <span class="blue">Max = 1.83&#949; (Mean = 0.455&#949;)</span>
238 </p>
239 </td>
240 <td>
241 <p>
242 <span class="blue">Max = 0.816&#949; (Mean = 0.0563&#949;)</span><br>
243 <br> (<span class="emphasis"><em>GSL 1.16:</em></span> Max = 2.43&#949; (Mean = 0.803&#949;))<br>
244 (<span class="emphasis"><em>Cephes:</em></span> Max = 1.83&#949; (Mean = 0.437&#949;))
245 </p>
246 </td>
247 <td>
248 <p>
249 <span class="blue">Max = 1.68&#949; (Mean = 0.443&#949;)</span>
250 </p>
251 </td>
252 <td>
253 <p>
254 <span class="blue">Max = 1.68&#949; (Mean = 0.454&#949;)</span>
255 </p>
256 </td>
257 </tr>
258 <tr>
259 <td>
260 <p>
261 Jacobi Elliptic: Random Small Values
262 </p>
263 </td>
264 <td>
265 <p>
266 <span class="blue">Max = 26.2&#949; (Mean = 1.17&#949;)</span>
267 </p>
268 </td>
269 <td>
270 <p>
271 <span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>GSL
272 1.16:</em></span> Max = 55.2&#949; (Mean = 1.64&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_jacobi_cn_GSL_1_16_Jacobi_Elliptic_Random_Small_Values">And
273 other failures.</a>)<br> (<span class="emphasis"><em>Cephes:</em></span> <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_jacobi_cn_Cephes_Jacobi_Elliptic_Random_Small_Values">And
274 other failures.</a>)</span>
275 </p>
276 </td>
277 <td>
278 <p>
279 <span class="blue">Max = 10.4&#949; (Mean = 0.594&#949;)</span>
280 </p>
281 </td>
282 <td>
283 <p>
284 <span class="blue">Max = 10.4&#949; (Mean = 0.602&#949;)</span>
285 </p>
286 </td>
287 </tr>
288 <tr>
289 <td>
290 <p>
291 Jacobi Elliptic: Modulus near 1
292 </p>
293 </td>
294 <td>
295 <p>
296 <span class="blue">Max = 513&#949; (Mean = 126&#949;)</span>
297 </p>
298 </td>
299 <td>
300 <p>
301 <span class="blue">Max = 0.919&#949; (Mean = 0.127&#949;)</span><br> <br>
302 (<span class="emphasis"><em>GSL 1.16:</em></span> Max = 0&#949; (Mean = 0&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_jacobi_cn_GSL_1_16_Jacobi_Elliptic_Modulus_near_1">And
303 other failures.</a>)<br> (<span class="emphasis"><em>Cephes:</em></span> <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_jacobi_cn_Cephes_Jacobi_Elliptic_Modulus_near_1">And
304 other failures.</a>)</span>
305 </p>
306 </td>
307 <td>
308 <p>
309 <span class="blue">Max = 675&#949; (Mean = 87.1&#949;)</span>
310 </p>
311 </td>
312 <td>
313 <p>
314 <span class="blue">Max = 675&#949; (Mean = 86.8&#949;)</span>
315 </p>
316 </td>
317 </tr>
318 <tr>
319 <td>
320 <p>
321 Jacobi Elliptic: Large Phi
322 </p>
323 </td>
324 <td>
325 <p>
326 <span class="blue">Max = 3.27e+004&#949; (Mean = 1.93e+003&#949;)</span>
327 </p>
328 </td>
329 <td>
330 <p>
331 <span class="blue">Max = 14.2&#949; (Mean = 0.927&#949;)</span><br> <br>
332 (<span class="emphasis"><em>GSL 1.16:</em></span> Max = 5.92e+03&#949; (Mean = 477&#949;))<br>
333 (<span class="emphasis"><em>Cephes:</em></span> Max = 3.27e+04&#949; (Mean = 1.93e+03&#949;))
334 </p>
335 </td>
336 <td>
337 <p>
338 <span class="blue">Max = 2.97e+04&#949; (Mean = 1.9e+03&#949;)</span>
339 </p>
340 </td>
341 <td>
342 <p>
343 <span class="blue">Max = 2.97e+04&#949; (Mean = 1.9e+03&#949;)</span>
344 </p>
345 </td>
346 </tr>
347 </tbody>
348 </table></div>
349 </div>
350 <br class="table-break"><div class="table">
351 <a name="math_toolkit.jacobi.jacobi_elliptic.table_jacobi_dn"></a><p class="title"><b>Table&#160;6.71.&#160;Error rates for jacobi_dn</b></p>
352 <div class="table-contents"><table class="table" summary="Error rates for jacobi_dn">
353 <colgroup>
354 <col>
355 <col>
356 <col>
357 <col>
358 <col>
359 </colgroup>
360 <thead><tr>
361 <th>
362 </th>
363 <th>
364 <p>
365 Microsoft Visual C++ version 12.0<br> Win32<br> double
366 </p>
367 </th>
368 <th>
369 <p>
370 GNU C++ version 5.1.0<br> linux<br> double
371 </p>
372 </th>
373 <th>
374 <p>
375 GNU C++ version 5.1.0<br> linux<br> long double
376 </p>
377 </th>
378 <th>
379 <p>
380 Sun compiler version 0x5130<br> Sun Solaris<br> long double
381 </p>
382 </th>
383 </tr></thead>
384 <tbody>
385 <tr>
386 <td>
387 <p>
388 Jacobi Elliptic: Mathworld Data
389 </p>
390 </td>
391 <td>
392 <p>
393 <span class="blue">Max = 34.3&#949; (Mean = 8.71&#949;)</span>
394 </p>
395 </td>
396 <td>
397 <p>
398 <span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>GSL
399 1.16:</em></span> Max = 2.82&#949; (Mean = 1.18&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_jacobi_dn_GSL_1_16_Jacobi_Elliptic_Mathworld_Data">And
400 other failures.</a>)<br> (<span class="emphasis"><em>Cephes:</em></span> <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_jacobi_dn_Cephes_Jacobi_Elliptic_Mathworld_Data">And
401 other failures.</a>)</span>
402 </p>
403 </td>
404 <td>
405 <p>
406 <span class="blue">Max = 49&#949; (Mean = 14&#949;)</span>
407 </p>
408 </td>
409 <td>
410 <p>
411 <span class="blue">Max = 49&#949; (Mean = 14&#949;)</span>
412 </p>
413 </td>
414 </tr>
415 <tr>
416 <td>
417 <p>
418 Jacobi Elliptic: Random Data
419 </p>
420 </td>
421 <td>
422 <p>
423 <span class="blue">Max = 1.52&#949; (Mean = 0.466&#949;)</span>
424 </p>
425 </td>
426 <td>
427 <p>
428 <span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>GSL
429 1.16:</em></span> Max = 3&#949; (Mean = 0.61&#949;))<br> (<span class="emphasis"><em>Cephes:</em></span>
430 Max = 1.49&#949; (Mean = 0.321&#949;))
431 </p>
432 </td>
433 <td>
434 <p>
435 <span class="blue">Max = 1.53&#949; (Mean = 0.473&#949;)</span>
436 </p>
437 </td>
438 <td>
439 <p>
440 <span class="blue">Max = 1.53&#949; (Mean = 0.481&#949;)</span>
441 </p>
442 </td>
443 </tr>
444 <tr>
445 <td>
446 <p>
447 Jacobi Elliptic: Random Small Values
448 </p>
449 </td>
450 <td>
451 <p>
452 <span class="blue">Max = 16.1&#949; (Mean = 0.685&#949;)</span>
453 </p>
454 </td>
455 <td>
456 <p>
457 <span class="blue">Max = 0.5&#949; (Mean = 0.0122&#949;)</span><br> <br>
458 (<span class="emphasis"><em>GSL 1.16:</em></span> Max = 1.5&#949; (Mean = 0.391&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_jacobi_dn_GSL_1_16_Jacobi_Elliptic_Random_Small_Values">And
459 other failures.</a>)<br> (<span class="emphasis"><em>Cephes:</em></span> <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_jacobi_dn_Cephes_Jacobi_Elliptic_Random_Small_Values">And
460 other failures.</a>)</span>
461 </p>
462 </td>
463 <td>
464 <p>
465 <span class="blue">Max = 22.4&#949; (Mean = 0.777&#949;)</span>
466 </p>
467 </td>
468 <td>
469 <p>
470 <span class="blue">Max = 22.4&#949; (Mean = 0.763&#949;)</span>
471 </p>
472 </td>
473 </tr>
474 <tr>
475 <td>
476 <p>
477 Jacobi Elliptic: Modulus near 1
478 </p>
479 </td>
480 <td>
481 <p>
482 <span class="blue">Max = 6.24e+003&#949; (Mean = 482&#949;)</span>
483 </p>
484 </td>
485 <td>
486 <p>
487 <span class="blue">Max = 2.28&#949; (Mean = 0.194&#949;)</span><br> <br>
488 (<span class="emphasis"><em>GSL 1.16:</em></span> Max = 0&#949; (Mean = 0&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_jacobi_dn_GSL_1_16_Jacobi_Elliptic_Modulus_near_1">And
489 other failures.</a>)<br> (<span class="emphasis"><em>Cephes:</em></span> <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_jacobi_dn_Cephes_Jacobi_Elliptic_Modulus_near_1">And
490 other failures.</a>)</span>
491 </p>
492 </td>
493 <td>
494 <p>
495 <span class="blue">Max = 3.75e+03&#949; (Mean = 293&#949;)</span>
496 </p>
497 </td>
498 <td>
499 <p>
500 <span class="blue">Max = 3.75e+03&#949; (Mean = 293&#949;)</span>
501 </p>
502 </td>
503 </tr>
504 <tr>
505 <td>
506 <p>
507 Jacobi Elliptic: Large Phi
508 </p>
509 </td>
510 <td>
511 <p>
512 <span class="blue">Max = 1.67e+004&#949; (Mean = 1e+003&#949;)</span>
513 </p>
514 </td>
515 <td>
516 <p>
517 <span class="blue">Max = 14.1&#949; (Mean = 0.897&#949;)</span><br> <br>
518 (<span class="emphasis"><em>GSL 1.16:</em></span> Max = 121&#949; (Mean = 22&#949;))<br> (<span class="emphasis"><em>Cephes:</em></span>
519 Max = 196&#949; (Mean = 30.2&#949;))
520 </p>
521 </td>
522 <td>
523 <p>
524 <span class="blue">Max = 2.82e+04&#949; (Mean = 1.79e+03&#949;)</span>
525 </p>
526 </td>
527 <td>
528 <p>
529 <span class="blue">Max = 2.82e+04&#949; (Mean = 1.79e+03&#949;)</span>
530 </p>
531 </td>
532 </tr>
533 </tbody>
534 </table></div>
535 </div>
536 <br class="table-break"><div class="table">
537 <a name="math_toolkit.jacobi.jacobi_elliptic.table_jacobi_sn"></a><p class="title"><b>Table&#160;6.72.&#160;Error rates for jacobi_sn</b></p>
538 <div class="table-contents"><table class="table" summary="Error rates for jacobi_sn">
539 <colgroup>
540 <col>
541 <col>
542 <col>
543 <col>
544 <col>
545 </colgroup>
546 <thead><tr>
547 <th>
548 </th>
549 <th>
550 <p>
551 Microsoft Visual C++ version 12.0<br> Win32<br> double
552 </p>
553 </th>
554 <th>
555 <p>
556 GNU C++ version 5.1.0<br> linux<br> double
557 </p>
558 </th>
559 <th>
560 <p>
561 GNU C++ version 5.1.0<br> linux<br> long double
562 </p>
563 </th>
564 <th>
565 <p>
566 Sun compiler version 0x5130<br> Sun Solaris<br> long double
567 </p>
568 </th>
569 </tr></thead>
570 <tbody>
571 <tr>
572 <td>
573 <p>
574 Jacobi Elliptic: Mathworld Data
575 </p>
576 </td>
577 <td>
578 <p>
579 <span class="blue">Max = 481&#949; (Mean = 113&#949;)</span>
580 </p>
581 </td>
582 <td>
583 <p>
584 <span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>GSL
585 1.16:</em></span> Max = 588&#949; (Mean = 146&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_jacobi_sn_GSL_1_16_Jacobi_Elliptic_Mathworld_Data">And
586 other failures.</a>)<br> (<span class="emphasis"><em>Cephes:</em></span> <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_jacobi_sn_Cephes_Jacobi_Elliptic_Mathworld_Data">And
587 other failures.</a>)</span>
588 </p>
589 </td>
590 <td>
591 <p>
592 <span class="blue">Max = 341&#949; (Mean = 80.7&#949;)</span>
593 </p>
594 </td>
595 <td>
596 <p>
597 <span class="blue">Max = 341&#949; (Mean = 80.7&#949;)</span>
598 </p>
599 </td>
600 </tr>
601 <tr>
602 <td>
603 <p>
604 Jacobi Elliptic: Random Data
605 </p>
606 </td>
607 <td>
608 <p>
609 <span class="blue">Max = 1.92&#949; (Mean = 0.567&#949;)</span>
610 </p>
611 </td>
612 <td>
613 <p>
614 <span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>GSL
615 1.16:</em></span> Max = 4.02&#949; (Mean = 1.07&#949;))<br> (<span class="emphasis"><em>Cephes:</em></span>
616 Max = 1.92&#949; (Mean = 0.567&#949;))
617 </p>
618 </td>
619 <td>
620 <p>
621 <span class="blue">Max = 2.01&#949; (Mean = 0.584&#949;)</span>
622 </p>
623 </td>
624 <td>
625 <p>
626 <span class="blue">Max = 2.01&#949; (Mean = 0.593&#949;)</span>
627 </p>
628 </td>
629 </tr>
630 <tr>
631 <td>
632 <p>
633 Jacobi Elliptic: Random Small Values
634 </p>
635 </td>
636 <td>
637 <p>
638 <span class="blue">Max = 2.11&#949; (Mean = 0.385&#949;)</span>
639 </p>
640 </td>
641 <td>
642 <p>
643 <span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>GSL
644 1.16:</em></span> Max = 11.7&#949; (Mean = 1.65&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_jacobi_sn_GSL_1_16_Jacobi_Elliptic_Random_Small_Values">And
645 other failures.</a>)<br> (<span class="emphasis"><em>Cephes:</em></span> <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_jacobi_sn_Cephes_Jacobi_Elliptic_Random_Small_Values">And
646 other failures.</a>)</span>
647 </p>
648 </td>
649 <td>
650 <p>
651 <span class="blue">Max = 1.99&#949; (Mean = 0.347&#949;)</span>
652 </p>
653 </td>
654 <td>
655 <p>
656 <span class="blue">Max = 1.99&#949; (Mean = 0.347&#949;)</span>
657 </p>
658 </td>
659 </tr>
660 <tr>
661 <td>
662 <p>
663 Jacobi Elliptic: Modulus near 1
664 </p>
665 </td>
666 <td>
667 <p>
668 <span class="blue">Max = 23.2&#949; (Mean = 1.85&#949;)</span>
669 </p>
670 </td>
671 <td>
672 <p>
673 <span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>GSL
674 1.16:</em></span> Max = 0&#949; (Mean = 0&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_jacobi_sn_GSL_1_16_Jacobi_Elliptic_Modulus_near_1">And
675 other failures.</a>)<br> (<span class="emphasis"><em>Cephes:</em></span> <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_jacobi_sn_Cephes_Jacobi_Elliptic_Modulus_near_1">And
676 other failures.</a>)</span>
677 </p>
678 </td>
679 <td>
680 <p>
681 <span class="blue">Max = 109&#949; (Mean = 7.35&#949;)</span>
682 </p>
683 </td>
684 <td>
685 <p>
686 <span class="blue">Max = 109&#949; (Mean = 7.38&#949;)</span>
687 </p>
688 </td>
689 </tr>
690 <tr>
691 <td>
692 <p>
693 Jacobi Elliptic: Large Phi
694 </p>
695 </td>
696 <td>
697 <p>
698 <span class="blue">Max = 4.36e+004&#949; (Mean = 2.54e+003&#949;)</span>
699 </p>
700 </td>
701 <td>
702 <p>
703 <span class="blue">Max = 12&#949; (Mean = 0.771&#949;)</span><br> <br>
704 (<span class="emphasis"><em>GSL 1.16:</em></span> Max = 4.54e+04&#949; (Mean = 2.63e+03&#949;))<br>
705 (<span class="emphasis"><em>Cephes:</em></span> Max = 4.36e+04&#949; (Mean = 2.54e+03&#949;))
706 </p>
707 </td>
708 <td>
709 <p>
710 <span class="blue">Max = 2.45e+04&#949; (Mean = 1.51e+03&#949;)</span>
711 </p>
712 </td>
713 <td>
714 <p>
715 <span class="blue">Max = 2.45e+04&#949; (Mean = 1.51e+03&#949;)</span>
716 </p>
717 </td>
718 </tr>
719 </tbody>
720 </table></div>
721 </div>
722 <br class="table-break"><h5>
723 <a name="math_toolkit.jacobi.jacobi_elliptic.h3"></a>
724 <span class="phrase"><a name="math_toolkit.jacobi.jacobi_elliptic.testing"></a></span><a class="link" href="jacobi_elliptic.html#math_toolkit.jacobi.jacobi_elliptic.testing">Testing</a>
725 </h5>
726 <p>
727 The tests use a mixture of spot test values calculated using the online calculator
728 at <a href="http://functions.wolfram.com/" target="_top">functions.wolfram.com</a>,
729 and random test data generated using MPFR at 1000-bit precision and this
730 implementation.
731 </p>
732 <h5>
733 <a name="math_toolkit.jacobi.jacobi_elliptic.h4"></a>
734 <span class="phrase"><a name="math_toolkit.jacobi.jacobi_elliptic.implementation"></a></span><a class="link" href="jacobi_elliptic.html#math_toolkit.jacobi.jacobi_elliptic.implementation">Implementation</a>
735 </h5>
736 <p>
737 For <span class="emphasis"><em>k &gt; 1</em></span> we apply the relations:
738 </p>
739 <p>
740 <span class="inlinemediaobject"><img src="../../../equations/jacobi3.svg"></span>
741 </p>
742 <p>
743 Then filter off the special cases:
744 </p>
745 <p>
746 <span class="emphasis"><em>sn(0, k) = 0</em></span> and <span class="emphasis"><em>cn(0, k) = dn(0, k) = 1</em></span>.
747 </p>
748 <p>
749 <span class="emphasis"><em>sn(u, 0) = sin(u), cn(u, 0) = cos(u) and dn(u, 0) = 1</em></span>.
750 </p>
751 <p>
752 <span class="emphasis"><em>sn(u, 1) = tanh(u), cn(u, 1) = dn(u, 1) = 1 / cosh(u)</em></span>.
753 </p>
754 <p>
755 And for <span class="emphasis"><em>k<sup>4</sup> &lt; &#949;</em></span> we have:
756 </p>
757 <p>
758 <span class="inlinemediaobject"><img src="../../../equations/jacobi4.svg"></span>
759 </p>
760 <p>
761 Otherwise the values are calculated using the method of <a href="http://dlmf.nist.gov/22.20#SS2" target="_top">arithmetic
762 geometric means</a>.
763 </p>
764 </div>
765 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
766 <td align="left"></td>
767 <td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014 Nikhar Agrawal,
768 Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert
769 Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam Sewani,
770 Benjamin Sobotta, Thijs van den Berg, Daryle Walker and Xiaogang Zhang<p>
771 Distributed under the Boost Software License, Version 1.0. (See accompanying
772 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>)
773 </p>
774 </div></td>
775 </tr></table>
776 <hr>
777 <div class="spirit-nav">
778 <a accesskey="p" href="jac_over.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../jacobi.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="jacobi_cd.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
779 </div>
780 </body>
781 </html>