math/doc/html/math_toolkit/jacobi/jacobi_elliptic.html
2019-10-31 17:55:35 +00:00

775 lines
32 KiB
HTML

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Jacobi Elliptic SN, CN and DN</title>
<link rel="stylesheet" href="../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Math Toolkit 2.11.0">
<link rel="up" href="../jacobi.html" title="Jacobi Elliptic Functions">
<link rel="prev" href="jac_over.html" title="Overview of the Jacobi Elliptic Functions">
<link rel="next" href="jacobi_cd.html" title="Jacobi Elliptic Function cd">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<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>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.jacobi.jacobi_elliptic"></a><a class="link" href="jacobi_elliptic.html" title="Jacobi Elliptic SN, CN and DN">Jacobi Elliptic
SN, CN and DN</a>
</h3></div></div></div>
<h5>
<a name="math_toolkit.jacobi.jacobi_elliptic.h0"></a>
<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>
</h5>
<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>
</pre>
<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>
<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>
<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">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>
<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>
<span class="special">}}</span> <span class="comment">// namespaces</span>
</pre>
<h5>
<a name="math_toolkit.jacobi.jacobi_elliptic.h1"></a>
<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>
</h5>
<p>
The function <a class="link" href="jacobi_elliptic.html" title="Jacobi Elliptic SN, CN and DN">jacobi_elliptic</a>
calculates the three copolar Jacobi elliptic functions <span class="emphasis"><em>sn(u, k)</em></span>,
<span class="emphasis"><em>cn(u, k)</em></span> and <span class="emphasis"><em>dn(u, k)</em></span>. The returned
value is <span class="emphasis"><em>sn(u, k)</em></span>, and if provided, <code class="computeroutput"><span class="special">*</span><span class="identifier">pcn</span></code> is set to <span class="emphasis"><em>cn(u, k)</em></span>,
and <code class="computeroutput"><span class="special">*</span><span class="identifier">pdn</span></code>
is set to <span class="emphasis"><em>dn(u, k)</em></span>.
</p>
<p>
The functions are defined as follows, given:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi1.svg"></span>
</p></blockquote></div>
<p>
The the angle <span class="emphasis"><em>&#966;</em></span> is called the <span class="emphasis"><em>amplitude</em></span>
and:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi2.svg"></span>
</p></blockquote></div>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/src/images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>
<span class="emphasis"><em>&#966;</em></span> is called the amplitude. <span class="emphasis"><em>k</em></span> is
called the elliptic modulus.
</p></td></tr>
</table></div>
<div class="caution"><table border="0" summary="Caution">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../../../../doc/src/images/caution.png"></td>
<th align="left">Caution</th>
</tr>
<tr><td align="left" valign="top">
<p>
Rather like other elliptic functions, the Jacobi functions are expressed
in a variety of different ways. In particular, the parameter <span class="emphasis"><em>k</em></span>
(the modulus) may also be expressed using a modular angle &#945;, or a parameter
<span class="emphasis"><em>m</em></span>. These are related by:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="serif_italic">k = sin &#945;</span>
</p></blockquote></div>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="serif_italic">m = k<sup>2</sup> = sin<sup>2</sup>&#945;</span>
</p></blockquote></div>
<p>
So that the function <span class="emphasis"><em>sn</em></span> (for example) may be expressed
as either:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="serif_italic">sn(u, k)</span>
</p></blockquote></div>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="serif_italic">sn(u \ &#945;)</span>
</p></blockquote></div>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="serif_italic">sn(u | m)</span>
</p></blockquote></div>
<p>
To further complicate matters, some texts refer to the <span class="emphasis"><em>complement
of the parameter m</em></span>, or 1 - m, where:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="serif_italic">1 - m = 1 - k<sup>2</sup> = cos<sup>2</sup>&#945;</span>
</p></blockquote></div>
<p>
This implementation uses <span class="emphasis"><em>k</em></span> throughout, and makes this
the first argument to the functions: this is for alignment with the elliptic
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
Report on C++ Library Extensions</a>. However, you should be extra
careful when using these functions!
</p>
</td></tr>
</table></div>
<p>
The final <a class="link" href="../../policy.html" title="Chapter&#160;20.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can
be used to control the behaviour of the function: how it handles errors,
what level of precision to use etc. Refer to the <a class="link" href="../../policy.html" title="Chapter&#160;20.&#160;Policies: Controlling Precision, Error Handling etc">policy
documentation for more details</a>.
</p>
<p>
The following graphs illustrate how these functions change as <span class="emphasis"><em>k</em></span>
changes: for small <span class="emphasis"><em>k</em></span> these are sine waves, while as
<span class="emphasis"><em>k</em></span> tends to 1 they become hyperbolic functions:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/jacobi_sn.svg" align="middle"></span>
</p></blockquote></div>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/jacobi_cn.svg" align="middle"></span>
</p></blockquote></div>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/jacobi_dn.svg" align="middle"></span>
</p></blockquote></div>
<h5>
<a name="math_toolkit.jacobi.jacobi_elliptic.h2"></a>
<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>
</h5>
<p>
These functions are computed using only basic arithmetic operations and trigomometric
functions, so there isn't much variation in accuracy over differing platforms.
Typically errors are trivially small for small angles, and as is typical
for cyclic functions, grow as the angle increases. Note that only results
for the widest floating-point type on the system are given as narrower types
have <a class="link" href="../relative_error.html#math_toolkit.relative_error.zero_error">effectively zero
error</a>. All values are relative errors in units of epsilon.
</p>
<div class="table">
<a name="math_toolkit.jacobi.jacobi_elliptic.table_jacobi_cn"></a><p class="title"><b>Table&#160;8.70.&#160;Error rates for jacobi_cn</b></p>
<div class="table-contents"><table class="table" summary="Error rates for jacobi_cn">
<colgroup>
<col>
<col>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
</th>
<th>
<p>
GNU C++ version 7.1.0<br> linux<br> double
</p>
</th>
<th>
<p>
GNU C++ version 7.1.0<br> linux<br> long double
</p>
</th>
<th>
<p>
Sun compiler version 0x5150<br> Sun Solaris<br> long double
</p>
</th>
<th>
<p>
Microsoft Visual C++ version 14.1<br> Win32<br> double
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
Jacobi Elliptic: Mathworld Data
</p>
</td>
<td>
<p>
<span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>GSL
2.1:</em></span> Max = 17.3&#949; (Mean = 4.29&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_7_1_0_linux_double_jacobi_cn_GSL_2_1_Jacobi_Elliptic_Mathworld_Data">And
other failures.</a>)
</p>
</td>
<td>
<p>
<span class="blue">Max = 71.6&#949; (Mean = 19.3&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 71.6&#949; (Mean = 19.4&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 45.8&#949; (Mean = 11.4&#949;)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
Jacobi Elliptic: Random Data
</p>
</td>
<td>
<p>
<span class="blue">Max = 0.816&#949; (Mean = 0.0563&#949;)</span><br>
<br> (<span class="emphasis"><em>GSL 2.1:</em></span> Max = 2.43&#949; (Mean = 0.803&#949;))
</p>
</td>
<td>
<p>
<span class="blue">Max = 1.68&#949; (Mean = 0.443&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 1.68&#949; (Mean = 0.454&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 1.83&#949; (Mean = 0.455&#949;)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
Jacobi Elliptic: Random Small Values
</p>
</td>
<td>
<p>
<span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>GSL
2.1:</em></span> Max = 55.2&#949; (Mean = 1.64&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_7_1_0_linux_double_jacobi_cn_GSL_2_1_Jacobi_Elliptic_Random_Small_Values">And
other failures.</a>)
</p>
</td>
<td>
<p>
<span class="blue">Max = 10.4&#949; (Mean = 0.594&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 10.4&#949; (Mean = 0.602&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 26.2&#949; (Mean = 1.17&#949;)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
Jacobi Elliptic: Modulus near 1
</p>
</td>
<td>
<p>
<span class="blue">Max = 0.919&#949; (Mean = 0.127&#949;)</span><br> <br>
(<span class="emphasis"><em>GSL 2.1:</em></span> Max = 0&#949; (Mean = 0&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_7_1_0_linux_double_jacobi_cn_GSL_2_1_Jacobi_Elliptic_Modulus_near_1">And
other failures.</a>)
</p>
</td>
<td>
<p>
<span class="blue">Max = 675&#949; (Mean = 87.1&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 675&#949; (Mean = 86.8&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 513&#949; (Mean = 126&#949;)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
Jacobi Elliptic: Large Phi
</p>
</td>
<td>
<p>
<span class="blue">Max = 14.2&#949; (Mean = 0.927&#949;)</span><br> <br>
(<span class="emphasis"><em>GSL 2.1:</em></span> Max = 5.92e+03&#949; (Mean = 477&#949;))
</p>
</td>
<td>
<p>
<span class="blue">Max = 2.97e+04&#949; (Mean = 1.9e+03&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 2.97e+04&#949; (Mean = 1.9e+03&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 3.27e+04&#949; (Mean = 1.93e+03&#949;)</span>
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><div class="table">
<a name="math_toolkit.jacobi.jacobi_elliptic.table_jacobi_dn"></a><p class="title"><b>Table&#160;8.71.&#160;Error rates for jacobi_dn</b></p>
<div class="table-contents"><table class="table" summary="Error rates for jacobi_dn">
<colgroup>
<col>
<col>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
</th>
<th>
<p>
GNU C++ version 7.1.0<br> linux<br> double
</p>
</th>
<th>
<p>
GNU C++ version 7.1.0<br> linux<br> long double
</p>
</th>
<th>
<p>
Sun compiler version 0x5150<br> Sun Solaris<br> long double
</p>
</th>
<th>
<p>
Microsoft Visual C++ version 14.1<br> Win32<br> double
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
Jacobi Elliptic: Mathworld Data
</p>
</td>
<td>
<p>
<span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>GSL
2.1:</em></span> Max = 2.82&#949; (Mean = 1.18&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_7_1_0_linux_double_jacobi_dn_GSL_2_1_Jacobi_Elliptic_Mathworld_Data">And
other failures.</a>)
</p>
</td>
<td>
<p>
<span class="blue">Max = 49&#949; (Mean = 14&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 49&#949; (Mean = 14&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 34.3&#949; (Mean = 8.71&#949;)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
Jacobi Elliptic: Random Data
</p>
</td>
<td>
<p>
<span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>GSL
2.1:</em></span> Max = 3&#949; (Mean = 0.61&#949;))
</p>
</td>
<td>
<p>
<span class="blue">Max = 1.53&#949; (Mean = 0.473&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 1.53&#949; (Mean = 0.481&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 1.52&#949; (Mean = 0.466&#949;)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
Jacobi Elliptic: Random Small Values
</p>
</td>
<td>
<p>
<span class="blue">Max = 0.5&#949; (Mean = 0.0122&#949;)</span><br> <br>
(<span class="emphasis"><em>GSL 2.1:</em></span> Max = 1.5&#949; (Mean = 0.391&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_7_1_0_linux_double_jacobi_dn_GSL_2_1_Jacobi_Elliptic_Random_Small_Values">And
other failures.</a>)
</p>
</td>
<td>
<p>
<span class="blue">Max = 22.4&#949; (Mean = 0.777&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 22.4&#949; (Mean = 0.763&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 16.1&#949; (Mean = 0.685&#949;)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
Jacobi Elliptic: Modulus near 1
</p>
</td>
<td>
<p>
<span class="blue">Max = 2.28&#949; (Mean = 0.194&#949;)</span><br> <br>
(<span class="emphasis"><em>GSL 2.1:</em></span> Max = 0&#949; (Mean = 0&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_7_1_0_linux_double_jacobi_dn_GSL_2_1_Jacobi_Elliptic_Modulus_near_1">And
other failures.</a>)
</p>
</td>
<td>
<p>
<span class="blue">Max = 3.75e+03&#949; (Mean = 293&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 3.75e+03&#949; (Mean = 293&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 6.24e+03&#949; (Mean = 482&#949;)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
Jacobi Elliptic: Large Phi
</p>
</td>
<td>
<p>
<span class="blue">Max = 14.1&#949; (Mean = 0.897&#949;)</span><br> <br>
(<span class="emphasis"><em>GSL 2.1:</em></span> Max = 121&#949; (Mean = 22&#949;))
</p>
</td>
<td>
<p>
<span class="blue">Max = 2.82e+04&#949; (Mean = 1.79e+03&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 2.82e+04&#949; (Mean = 1.79e+03&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 1.67e+04&#949; (Mean = 1e+03&#949;)</span>
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><div class="table">
<a name="math_toolkit.jacobi.jacobi_elliptic.table_jacobi_sn"></a><p class="title"><b>Table&#160;8.72.&#160;Error rates for jacobi_sn</b></p>
<div class="table-contents"><table class="table" summary="Error rates for jacobi_sn">
<colgroup>
<col>
<col>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
</th>
<th>
<p>
GNU C++ version 7.1.0<br> linux<br> double
</p>
</th>
<th>
<p>
GNU C++ version 7.1.0<br> linux<br> long double
</p>
</th>
<th>
<p>
Sun compiler version 0x5150<br> Sun Solaris<br> long double
</p>
</th>
<th>
<p>
Microsoft Visual C++ version 14.1<br> Win32<br> double
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
Jacobi Elliptic: Mathworld Data
</p>
</td>
<td>
<p>
<span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>GSL
2.1:</em></span> Max = 588&#949; (Mean = 146&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_7_1_0_linux_double_jacobi_sn_GSL_2_1_Jacobi_Elliptic_Mathworld_Data">And
other failures.</a>)
</p>
</td>
<td>
<p>
<span class="blue">Max = 341&#949; (Mean = 80.7&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 341&#949; (Mean = 80.7&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 481&#949; (Mean = 113&#949;)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
Jacobi Elliptic: Random Data
</p>
</td>
<td>
<p>
<span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>GSL
2.1:</em></span> Max = 4.02&#949; (Mean = 1.07&#949;))
</p>
</td>
<td>
<p>
<span class="blue">Max = 2.01&#949; (Mean = 0.584&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 2.01&#949; (Mean = 0.593&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 1.92&#949; (Mean = 0.567&#949;)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
Jacobi Elliptic: Random Small Values
</p>
</td>
<td>
<p>
<span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>GSL
2.1:</em></span> Max = 11.7&#949; (Mean = 1.65&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_7_1_0_linux_double_jacobi_sn_GSL_2_1_Jacobi_Elliptic_Random_Small_Values">And
other failures.</a>)
</p>
</td>
<td>
<p>
<span class="blue">Max = 1.99&#949; (Mean = 0.347&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 1.99&#949; (Mean = 0.347&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 2.11&#949; (Mean = 0.385&#949;)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
Jacobi Elliptic: Modulus near 1
</p>
</td>
<td>
<p>
<span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>GSL
2.1:</em></span> Max = 0&#949; (Mean = 0&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_7_1_0_linux_double_jacobi_sn_GSL_2_1_Jacobi_Elliptic_Modulus_near_1">And
other failures.</a>)
</p>
</td>
<td>
<p>
<span class="blue">Max = 109&#949; (Mean = 7.35&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 109&#949; (Mean = 7.38&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 23.2&#949; (Mean = 1.85&#949;)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
Jacobi Elliptic: Large Phi
</p>
</td>
<td>
<p>
<span class="blue">Max = 12&#949; (Mean = 0.771&#949;)</span><br> <br>
(<span class="emphasis"><em>GSL 2.1:</em></span> Max = 4.54e+04&#949; (Mean = 2.63e+03&#949;))
</p>
</td>
<td>
<p>
<span class="blue">Max = 2.45e+04&#949; (Mean = 1.51e+03&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 2.45e+04&#949; (Mean = 1.51e+03&#949;)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 4.36e+04&#949; (Mean = 2.54e+03&#949;)</span>
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><h5>
<a name="math_toolkit.jacobi.jacobi_elliptic.h3"></a>
<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>
</h5>
<p>
The tests use a mixture of spot test values calculated using the online calculator
at <a href="http://functions.wolfram.com/" target="_top">functions.wolfram.com</a>,
and random test data generated using MPFR at 1000-bit precision and this
implementation.
</p>
<h5>
<a name="math_toolkit.jacobi.jacobi_elliptic.h4"></a>
<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>
</h5>
<p>
For <span class="emphasis"><em>k &gt; 1</em></span> we apply the relations:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi3.svg"></span>
</p></blockquote></div>
<p>
Then filter off the special cases:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="serif_italic"><span class="emphasis"><em>sn(0, k) = 0</em></span> and <span class="emphasis"><em>cn(0,
k) = dn(0, k) = 1</em></span></span>
</p></blockquote></div>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="serif_italic"><span class="emphasis"><em>sn(u, 0) = sin(u), cn(u, 0) = cos(u)
and dn(u, 0) = 1</em></span></span>
</p></blockquote></div>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="serif_italic"><span class="emphasis"><em>sn(u, 1) = tanh(u), cn(u, 1) = dn(u,
1) = 1 / cosh(u)</em></span></span>
</p></blockquote></div>
<p>
And for <span class="emphasis"><em>k<sup>4</sup> &lt; &#949;</em></span> we have:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi4.svg"></span>
</p></blockquote></div>
<p>
Otherwise the values are calculated using the method of <a href="http://dlmf.nist.gov/22.20#SS2" target="_top">arithmetic
geometric means</a>.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2019 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Matthew Pulver, Johan
R&#229;de, Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg,
Daryle Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
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>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<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>
</div>
</body>
</html>