| 1 |
<html> |
| 2 |
<head> |
| 3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 4 |
<title>Jacobi Zeta Function</title> |
| 5 |
<link rel="stylesheet" href="../../math.css" type="text/css"> |
| 6 |
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> |
| 7 |
<link rel="home" href="../../index.html" title="Math Toolkit 4.2.1"> |
| 8 |
<link rel="up" href="../ellint.html" title="Elliptic Integrals"> |
| 9 |
<link rel="prev" href="ellint_d.html" title="Elliptic Integral D - Legendre Form"> |
| 10 |
<link rel="next" href="heuman_lambda.html" title="Heuman Lambda Function"> |
| 11 |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
| 12 |
</head> |
| 13 |
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
| 14 |
<table cellpadding="2" width="100%"><tr> |
| 15 |
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td> |
| 16 |
<td align="center"><a href="../../../../../../index.html">Home</a></td> |
| 17 |
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td> |
| 18 |
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> |
| 19 |
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> |
| 20 |
<td align="center"><a href="../../../../../../more/index.htm">More</a></td> |
| 21 |
</tr></table> |
| 22 |
<hr> |
| 23 |
<div class="spirit-nav"> |
| 24 |
<a accesskey="p" href="ellint_d.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="heuman_lambda.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> |
| 25 |
</div> |
| 26 |
<div class="section"> |
| 27 |
<div class="titlepage"><div><div><h3 class="title"> |
| 28 |
<a name="math_toolkit.ellint.jacobi_zeta"></a><a class="link" href="jacobi_zeta.html" title="Jacobi Zeta Function">Jacobi Zeta Function</a> |
| 29 |
</h3></div></div></div> |
| 30 |
<h5> |
| 31 |
<a name="math_toolkit.ellint.jacobi_zeta.h0"></a> |
| 32 |
<span class="phrase"><a name="math_toolkit.ellint.jacobi_zeta.synopsis"></a></span><a class="link" href="jacobi_zeta.html#math_toolkit.ellint.jacobi_zeta.synopsis">Synopsis</a> |
| 33 |
</h5> |
| 34 |
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</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_zeta</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></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"><</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> |
| 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_zeta</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"><</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 22. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">></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_zeta</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 22. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&);</span> |
| 43 |
|
| 44 |
<span class="special">}}</span> <span class="comment">// namespaces</span> |
| 45 |
</pre> |
| 46 |
<h5> |
| 47 |
<a name="math_toolkit.ellint.jacobi_zeta.h1"></a> |
| 48 |
<span class="phrase"><a name="math_toolkit.ellint.jacobi_zeta.description"></a></span><a class="link" href="jacobi_zeta.html#math_toolkit.ellint.jacobi_zeta.description">Description</a> |
| 49 |
</h5> |
| 50 |
<p> |
| 51 |
This function evaluates the Jacobi Zeta Function <span class="emphasis"><em>Z(φ, k)</em></span> |
| 52 |
</p> |
| 53 |
<div class="blockquote"><blockquote class="blockquote"><p> |
| 54 |
<span class="inlinemediaobject"><img src="../../../equations/jacobi_zeta.svg"></span> |
| 55 |
|
| 56 |
</p></blockquote></div> |
| 57 |
<p> |
| 58 |
Please note the use of φ, and <span class="emphasis"><em>k</em></span> as the parameters, the |
| 59 |
function is often defined as <span class="emphasis"><em>Z(φ, m)</em></span> with <span class="emphasis"><em>m |
| 60 |
= k<sup>2</sup></em></span>, see for example <a href="http://mathworld.wolfram.com/JacobiZetaFunction.html" target="_top">Weisstein, |
| 61 |
Eric W. "Jacobi Zeta Function." From MathWorld--A Wolfram Web Resource.</a> |
| 62 |
Or else as <a href="https://dlmf.nist.gov/22.16#E32" target="_top"><span class="emphasis"><em>Z(x, k)</em></span></a> |
| 63 |
with <span class="emphasis"><em>φ = am(x, k)</em></span>, where <span class="emphasis"><em>am</em></span> is the |
| 64 |
<a href="https://dlmf.nist.gov/22.16#E1" target="_top">Jacobi amplitude function</a> |
| 65 |
which is equivalent to <span class="emphasis"><em>asin(jacobi_elliptic(k, x))</em></span>. |
| 66 |
</p> |
| 67 |
<p> |
| 68 |
The return type of this function is computed using the <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>result |
| 69 |
type calculation rules</em></span></a> when the arguments are of different |
| 70 |
types: when they are the same type then the result is the same type as the |
| 71 |
arguments. |
| 72 |
</p> |
| 73 |
<p> |
| 74 |
Requires <span class="emphasis"><em>-1 <= k <= 1</em></span>, otherwise returns the result |
| 75 |
of <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a> |
| 76 |
(outside this range the result would be complex). |
| 77 |
</p> |
| 78 |
<p> |
| 79 |
The final <a class="link" href="../../policy.html" title="Chapter 22. Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can |
| 80 |
be used to control the behaviour of the function: how it handles errors, |
| 81 |
what level of precision to use etc. Refer to the <a class="link" href="../../policy.html" title="Chapter 22. Policies: Controlling Precision, Error Handling etc">policy |
| 82 |
documentation for more details</a>. |
| 83 |
</p> |
| 84 |
<p> |
| 85 |
Note that there is no complete analogue of this function (where φ = π / 2) as |
| 86 |
this takes the value 0 for all <span class="emphasis"><em>k</em></span>. |
| 87 |
</p> |
| 88 |
<h5> |
| 89 |
<a name="math_toolkit.ellint.jacobi_zeta.h2"></a> |
| 90 |
<span class="phrase"><a name="math_toolkit.ellint.jacobi_zeta.accuracy"></a></span><a class="link" href="jacobi_zeta.html#math_toolkit.ellint.jacobi_zeta.accuracy">Accuracy</a> |
| 91 |
</h5> |
| 92 |
<p> |
| 93 |
These functions are trivially computed in terms of other elliptic integrals |
| 94 |
and generally have very low error rates (a few epsilon) unless parameter |
| 95 |
φ |
| 96 |
is very large, in which case the usual trigonometric function argument-reduction |
| 97 |
issues apply. |
| 98 |
</p> |
| 99 |
<div class="table"> |
| 100 |
<a name="math_toolkit.ellint.jacobi_zeta.table_jacobi_zeta"></a><p class="title"><b>Table 8.68. Error rates for jacobi_zeta</b></p> |
| 101 |
<div class="table-contents"><table class="table" summary="Error rates for jacobi_zeta"> |
| 102 |
<colgroup> |
| 103 |
<col> |
| 104 |
<col> |
| 105 |
<col> |
| 106 |
<col> |
| 107 |
<col> |
| 108 |
</colgroup> |
| 109 |
<thead><tr> |
| 110 |
<th> |
| 111 |
</th> |
| 112 |
<th> |
| 113 |
<p> |
| 114 |
GNU C++ version 7.1.0<br> linux<br> double |
| 115 |
</p> |
| 116 |
</th> |
| 117 |
<th> |
| 118 |
<p> |
| 119 |
GNU C++ version 7.1.0<br> linux<br> long double |
| 120 |
</p> |
| 121 |
</th> |
| 122 |
<th> |
| 123 |
<p> |
| 124 |
Sun compiler version 0x5150<br> Sun Solaris<br> long double |
| 125 |
</p> |
| 126 |
</th> |
| 127 |
<th> |
| 128 |
<p> |
| 129 |
Microsoft Visual C++ version 14.1<br> Win32<br> double |
| 130 |
</p> |
| 131 |
</th> |
| 132 |
</tr></thead> |
| 133 |
<tbody> |
| 134 |
<tr> |
| 135 |
<td> |
| 136 |
<p> |
| 137 |
Elliptic Integral Jacobi Zeta: Mathworld Data |
| 138 |
</p> |
| 139 |
</td> |
| 140 |
<td> |
| 141 |
<p> |
| 142 |
<span class="blue">Max = 0ε (Mean = 0ε)</span> |
| 143 |
</p> |
| 144 |
</td> |
| 145 |
<td> |
| 146 |
<p> |
| 147 |
<span class="blue">Max = 1.66ε (Mean = 0.48ε)</span> |
| 148 |
</p> |
| 149 |
</td> |
| 150 |
<td> |
| 151 |
<p> |
| 152 |
<span class="blue">Max = 1.66ε (Mean = 0.48ε)</span> |
| 153 |
</p> |
| 154 |
</td> |
| 155 |
<td> |
| 156 |
<p> |
| 157 |
<span class="blue">Max = 1.52ε (Mean = 0.357ε)</span> |
| 158 |
</p> |
| 159 |
</td> |
| 160 |
</tr> |
| 161 |
<tr> |
| 162 |
<td> |
| 163 |
<p> |
| 164 |
Elliptic Integral Jacobi Zeta: Random Data |
| 165 |
</p> |
| 166 |
</td> |
| 167 |
<td> |
| 168 |
<p> |
| 169 |
<span class="blue">Max = 0ε (Mean = 0ε)</span> |
| 170 |
</p> |
| 171 |
</td> |
| 172 |
<td> |
| 173 |
<p> |
| 174 |
<span class="blue">Max = 2.99ε (Mean = 0.824ε)</span> |
| 175 |
</p> |
| 176 |
</td> |
| 177 |
<td> |
| 178 |
<p> |
| 179 |
<span class="blue">Max = 3.96ε (Mean = 1.06ε)</span> |
| 180 |
</p> |
| 181 |
</td> |
| 182 |
<td> |
| 183 |
<p> |
| 184 |
<span class="blue">Max = 3.89ε (Mean = 0.824ε)</span> |
| 185 |
</p> |
| 186 |
</td> |
| 187 |
</tr> |
| 188 |
<tr> |
| 189 |
<td> |
| 190 |
<p> |
| 191 |
Elliptic Integral Jacobi Zeta: Large Phi Values |
| 192 |
</p> |
| 193 |
</td> |
| 194 |
<td> |
| 195 |
<p> |
| 196 |
<span class="blue">Max = 0ε (Mean = 0ε)</span> |
| 197 |
</p> |
| 198 |
</td> |
| 199 |
<td> |
| 200 |
<p> |
| 201 |
<span class="blue">Max = 2.92ε (Mean = 0.951ε)</span> |
| 202 |
</p> |
| 203 |
</td> |
| 204 |
<td> |
| 205 |
<p> |
| 206 |
<span class="blue">Max = 3.05ε (Mean = 1.13ε)</span> |
| 207 |
</p> |
| 208 |
</td> |
| 209 |
<td> |
| 210 |
<p> |
| 211 |
<span class="blue">Max = 2.52ε (Mean = 0.977ε)</span> |
| 212 |
</p> |
| 213 |
</td> |
| 214 |
</tr> |
| 215 |
</tbody> |
| 216 |
</table></div> |
| 217 |
</div> |
| 218 |
<br class="table-break"><h5> |
| 219 |
<a name="math_toolkit.ellint.jacobi_zeta.h3"></a> |
| 220 |
<span class="phrase"><a name="math_toolkit.ellint.jacobi_zeta.testing"></a></span><a class="link" href="jacobi_zeta.html#math_toolkit.ellint.jacobi_zeta.testing">Testing</a> |
| 221 |
</h5> |
| 222 |
<p> |
| 223 |
The tests use a mixture of spot test values calculated using values calculated |
| 224 |
at <a href="http://www.wolframalpha.com/" target="_top">Wolfram Alpha</a>, and random |
| 225 |
test data generated using MPFR at 1000-bit precision and a deliberately naive |
| 226 |
implementation in terms of the Legendre integrals. |
| 227 |
</p> |
| 228 |
<h5> |
| 229 |
<a name="math_toolkit.ellint.jacobi_zeta.h4"></a> |
| 230 |
<span class="phrase"><a name="math_toolkit.ellint.jacobi_zeta.implementation"></a></span><a class="link" href="jacobi_zeta.html#math_toolkit.ellint.jacobi_zeta.implementation">Implementation</a> |
| 231 |
</h5> |
| 232 |
<p> |
| 233 |
The implementation for Z(φ, k) first makes the argument φ positive using: |
| 234 |
</p> |
| 235 |
<div class="blockquote"><blockquote class="blockquote"><p> |
| 236 |
<span class="serif_italic"><span class="emphasis"><em>Z(-φ, k) = -Z(φ, k)</em></span></span> |
| 237 |
</p></blockquote></div> |
| 238 |
<p> |
| 239 |
The function is then implemented in terms of Carlson's integral R<sub>J</sub> |
| 240 |
using the |
| 241 |
relation: |
| 242 |
</p> |
| 243 |
<div class="blockquote"><blockquote class="blockquote"><p> |
| 244 |
<span class="inlinemediaobject"><img src="../../../equations/jacobi_zeta.svg"></span> |
| 245 |
|
| 246 |
</p></blockquote></div> |
| 247 |
<p> |
| 248 |
There is one special case where the above relation fails: when <span class="emphasis"><em>k |
| 249 |
= 1</em></span>, in that case the function simplifies to |
| 250 |
</p> |
| 251 |
<div class="blockquote"><blockquote class="blockquote"><p> |
| 252 |
<span class="serif_italic"><span class="emphasis"><em>Z(φ, 1) = sign(cos(φ)) sin(φ)</em></span></span> |
| 253 |
</p></blockquote></div> |
| 254 |
<h6> |
| 255 |
<a name="math_toolkit.ellint.jacobi_zeta.h5"></a> |
| 256 |
<span class="phrase"><a name="math_toolkit.ellint.jacobi_zeta.jacobi_zeta_example"></a></span><a class="link" href="jacobi_zeta.html#math_toolkit.ellint.jacobi_zeta.jacobi_zeta_example">Example</a> |
| 257 |
</h6> |
| 258 |
<p> |
| 259 |
A simple example comparing use of <a href="http://www.wolframalpha.com/" target="_top">Wolfram |
| 260 |
Alpha</a> with Boost.Math (including much higher precision using Boost.Multiprecision) |
| 261 |
is <a href="../../../../example/jacobi_zeta_example.cpp" target="_top">jacobi_zeta_example.cpp</a>. |
| 262 |
</p> |
| 263 |
</div> |
| 264 |
<div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland, |
| 265 |
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno |
| 266 |
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde, |
| 267 |
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle |
| 268 |
Walker and Xiaogang Zhang<p> |
| 269 |
Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 270 |
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>) |
| 271 |
</p> |
| 272 |
</div> |
| 273 |
<hr> |
| 274 |
<div class="spirit-nav"> |
| 275 |
<a accesskey="p" href="ellint_d.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="heuman_lambda.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> |
| 276 |
</div> |
| 277 |
</body> |
| 278 |
</html> |