[DEV] add v1.76.0

This commit is contained in:
2021-10-05 21:37:46 +02:00
parent a97e9ae7d4
commit d0115b733d
45133 changed files with 4744437 additions and 1026325 deletions

View File

@@ -0,0 +1,153 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Jacobi Theta Function θ1</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 3.0.0">
<link rel="up" href="../jacobi_theta.html" title="Jacobi Theta Functions">
<link rel="prev" href="jacobi_theta_overview.html" title="Overview of the Jacobi Theta Functions">
<link rel="next" href="jacobi_theta2.html" title="Jacobi Theta Function θ2">
</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="jacobi_theta_overview.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../jacobi_theta.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_theta2.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_theta.jacobi_theta1"></a><a class="link" href="jacobi_theta1.html" title="Jacobi Theta Function θ1">Jacobi Theta
Function θ<sub>1</sub></a>
</h3></div></div></div>
<h5>
<a name="math_toolkit.jacobi_theta.jacobi_theta1.h0"></a>
<span class="phrase"><a name="math_toolkit.jacobi_theta.jacobi_theta1.synopsis"></a></span><a class="link" href="jacobi_theta1.html#math_toolkit.jacobi_theta.jacobi_theta1.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_theta</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">&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_theta1</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">q</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">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_theta1</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">q</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Policy</span><span class="special">&amp;);</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">&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_theta1tau</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">tau</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">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_theta1tau</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">tau</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_theta.jacobi_theta1.h1"></a>
<span class="phrase"><a name="math_toolkit.jacobi_theta.jacobi_theta1.description"></a></span><a class="link" href="jacobi_theta1.html#math_toolkit.jacobi_theta.jacobi_theta1.description">Description</a>
</h5>
<p>
The functions calculate the value of first <a class="link" href="jacobi_theta_overview.html" title="Overview of the Jacobi Theta Functions">Jacobi
Theta function</a>, parameterized either in terms of the nome <span class="emphasis"><em>q</em></span>:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi_theta1.svg"></span>
</p></blockquote></div>
<p>
Or in terms of an imaginary τ:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi_theta1tau.svg"></span>
</p></blockquote></div>
<p>
The nome <span class="emphasis"><em>q</em></span> is restricted to the domain (0, 1), returning
the result of <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a>
otherwise. The following graph shows the theta function at various values
of <span class="emphasis"><em>q</em></span>:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/jacobi_theta1.svg" align="middle"></span>
</p></blockquote></div>
<p>
The final <a class="link" href="../../policy.html" title="Chapter 21. 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 21. Policies: Controlling Precision, Error Handling etc">policy
documentation for more details</a>.
</p>
<h5>
<a name="math_toolkit.jacobi_theta.jacobi_theta1.h2"></a>
<span class="phrase"><a name="math_toolkit.jacobi_theta.jacobi_theta1.accuracy"></a></span><a class="link" href="jacobi_theta1.html#math_toolkit.jacobi_theta.jacobi_theta1.accuracy">Accuracy</a>
</h5>
<p>
The following <a class="link" href="../ulps_plots.html" title="ULPs Plots">ULPs plot</a> is
representative, fixing <span class="emphasis"><em>q</em></span>=0.5 and varying <span class="emphasis"><em>x</em></span>
from 0 to 2π:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/jacobi_theta1_float.svg" align="middle"></span>
</p></blockquote></div>
<p>
The envelope represents the function's <a href="https://en.wikipedia.org/wiki/Condition_number#One_variable" target="_top">condition
number</a>. Note that relative accuracy degenerates periodically near
θ<sub>1</sub>=0.
</p>
<p>
Fixing <span class="emphasis"><em>x</em></span>=5 and varying <span class="emphasis"><em>q</em></span>, the ULPs
plot looks like:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/jacobi_theta1q_float.svg" align="middle"></span>
</p></blockquote></div>
<p>
Accuracy tends to degenerate near <span class="emphasis"><em>q</em></span>=1 (small τ).
</p>
<h5>
<a name="math_toolkit.jacobi_theta.jacobi_theta1.h3"></a>
<span class="phrase"><a name="math_toolkit.jacobi_theta.jacobi_theta1.implementation"></a></span><a class="link" href="jacobi_theta1.html#math_toolkit.jacobi_theta.jacobi_theta1.implementation">Implementation</a>
</h5>
<p>
The <span class="emphasis"><em>q</em></span> parameterization is implemented using the τ parameterization,
where τ=-log(<span class="emphasis"><em>q</em></span>)/π.
</p>
<p>
If τ is greater than or equal to 1, the summation above is used as-is. However
if τ &lt; 1, the following identity <a href="https://dlmf.nist.gov/20.7#viii" target="_top">DLMF
20.7.30</a> is used, defining τ'=-1/τ:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi_theta1_imaginary.svg"></span>
</p></blockquote></div>
<p>
This transformation of variables ensures that the function will always converge
in a small number of iterations.
</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 © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Rå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="jacobi_theta_overview.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../jacobi_theta.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_theta2.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,153 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Jacobi Theta Function θ2</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 3.0.0">
<link rel="up" href="../jacobi_theta.html" title="Jacobi Theta Functions">
<link rel="prev" href="jacobi_theta1.html" title="Jacobi Theta Function θ1">
<link rel="next" href="jacobi_theta3.html" title="Jacobi Theta Function θ3">
</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="jacobi_theta1.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../jacobi_theta.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_theta3.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_theta.jacobi_theta2"></a><a class="link" href="jacobi_theta2.html" title="Jacobi Theta Function θ2">Jacobi Theta
Function θ<sub>2</sub></a>
</h3></div></div></div>
<h5>
<a name="math_toolkit.jacobi_theta.jacobi_theta2.h0"></a>
<span class="phrase"><a name="math_toolkit.jacobi_theta.jacobi_theta2.synopsis"></a></span><a class="link" href="jacobi_theta2.html#math_toolkit.jacobi_theta.jacobi_theta2.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_theta</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">&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_theta2</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">q</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">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_theta2</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">q</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Policy</span><span class="special">&amp;);</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">&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_theta2tau</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">tau</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">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_theta2tau</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">tau</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_theta.jacobi_theta2.h1"></a>
<span class="phrase"><a name="math_toolkit.jacobi_theta.jacobi_theta2.description"></a></span><a class="link" href="jacobi_theta2.html#math_toolkit.jacobi_theta.jacobi_theta2.description">Description</a>
</h5>
<p>
The functions calculate the value of second <a class="link" href="jacobi_theta_overview.html" title="Overview of the Jacobi Theta Functions">Jacobi
Theta function</a>, parameterized either in terms of the nome <span class="emphasis"><em>q</em></span>:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi_theta2.svg"></span>
</p></blockquote></div>
<p>
Or in terms of an imaginary τ:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi_theta2tau.svg"></span>
</p></blockquote></div>
<p>
The nome <span class="emphasis"><em>q</em></span> is restricted to the domain (0, 1), returning
the result of <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a>
otherwise. The following graph shows the theta function at various values
of <span class="emphasis"><em>q</em></span>:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/jacobi_theta2.svg" align="middle"></span>
</p></blockquote></div>
<p>
The final <a class="link" href="../../policy.html" title="Chapter 21. 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 21. Policies: Controlling Precision, Error Handling etc">policy
documentation for more details</a>.
</p>
<h5>
<a name="math_toolkit.jacobi_theta.jacobi_theta2.h2"></a>
<span class="phrase"><a name="math_toolkit.jacobi_theta.jacobi_theta2.accuracy"></a></span><a class="link" href="jacobi_theta2.html#math_toolkit.jacobi_theta.jacobi_theta2.accuracy">Accuracy</a>
</h5>
<p>
The following <a class="link" href="../ulps_plots.html" title="ULPs Plots">ULPs plot</a> is
representative, fixing <span class="emphasis"><em>q</em></span>=0.5 and varying <span class="emphasis"><em>x</em></span>
from 0 to 2π:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/jacobi_theta2_float.svg" align="middle"></span>
</p></blockquote></div>
<p>
The envelope represents the function's <a href="https://en.wikipedia.org/wiki/Condition_number#One_variable" target="_top">condition
number</a>. Note that relative accuracy degenerates periodically near
θ<sub>2</sub>=0.
</p>
<p>
Fixing <span class="emphasis"><em>x</em></span>=0.4 and varying <span class="emphasis"><em>q</em></span>, the
ULPs plot looks like:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/jacobi_theta2q_float.svg" align="middle"></span>
</p></blockquote></div>
<p>
Accuracy tends to degenerate near <span class="emphasis"><em>q</em></span>=1 (small τ).
</p>
<h5>
<a name="math_toolkit.jacobi_theta.jacobi_theta2.h3"></a>
<span class="phrase"><a name="math_toolkit.jacobi_theta.jacobi_theta2.implementation"></a></span><a class="link" href="jacobi_theta2.html#math_toolkit.jacobi_theta.jacobi_theta2.implementation">Implementation</a>
</h5>
<p>
The <span class="emphasis"><em>q</em></span> parameterization is implemented using the τ parameterization,
where τ=-log(<span class="emphasis"><em>q</em></span>)/π.
</p>
<p>
If τ is greater than or equal to 1, the summation above is used as-is. However
if τ &lt; 1, the following identity <a href="https://dlmf.nist.gov/20.7#viii" target="_top">DLMF
20.7.31</a> is used, defining τ'=-1/τ:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi_theta2_imaginary.svg"></span>
</p></blockquote></div>
<p>
This transformation of variables ensures that the function will always converge
in a small number of iterations.
</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 © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Rå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="jacobi_theta1.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../jacobi_theta.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_theta3.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,170 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Jacobi Theta Function θ3</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 3.0.0">
<link rel="up" href="../jacobi_theta.html" title="Jacobi Theta Functions">
<link rel="prev" href="jacobi_theta2.html" title="Jacobi Theta Function θ2">
<link rel="next" href="jacobi_theta4.html" title="Jacobi Theta Function θ4">
</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="jacobi_theta2.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../jacobi_theta.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_theta4.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_theta.jacobi_theta3"></a><a class="link" href="jacobi_theta3.html" title="Jacobi Theta Function θ3">Jacobi Theta
Function θ<sub>3</sub></a>
</h3></div></div></div>
<h5>
<a name="math_toolkit.jacobi_theta.jacobi_theta3.h0"></a>
<span class="phrase"><a name="math_toolkit.jacobi_theta.jacobi_theta3.synopsis"></a></span><a class="link" href="jacobi_theta3.html#math_toolkit.jacobi_theta.jacobi_theta3.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_theta</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">&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_theta3</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">q</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">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_theta3</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">q</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Policy</span><span class="special">&amp;);</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">&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_theta3tau</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">tau</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">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_theta3tau</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">tau</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Policy</span><span class="special">&amp;);</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">&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_theta3m1</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">q</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">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_theta3m1</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">q</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Policy</span><span class="special">&amp;);</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">&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_theta3m1tau</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">tau</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">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_theta3m1tau</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">tau</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_theta.jacobi_theta3.h1"></a>
<span class="phrase"><a name="math_toolkit.jacobi_theta.jacobi_theta3.description"></a></span><a class="link" href="jacobi_theta3.html#math_toolkit.jacobi_theta.jacobi_theta3.description">Description</a>
</h5>
<p>
The functions calculate the value of third <a class="link" href="jacobi_theta_overview.html" title="Overview of the Jacobi Theta Functions">Jacobi
Theta function</a>, parameterized either in terms of the nome <span class="emphasis"><em>q</em></span>:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi_theta3.svg"></span>
</p></blockquote></div>
<p>
Or in terms of an imaginary τ:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi_theta3tau.svg"></span>
</p></blockquote></div>
<p>
The nome <span class="emphasis"><em>q</em></span> is restricted to the domain (0, 1), returning
the result of <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a>
otherwise. The following graph shows the theta function at various values
of <span class="emphasis"><em>q</em></span>:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/jacobi_theta3.svg" align="middle"></span>
</p></blockquote></div>
<p>
The final <a class="link" href="../../policy.html" title="Chapter 21. 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 21. Policies: Controlling Precision, Error Handling etc">policy
documentation for more details</a>.
</p>
<p>
A second quartet of functions (functions containing <code class="computeroutput"><span class="identifier">m1</span></code>)
compute one less than the value of the third theta function. These versions
of the functions provide increased accuracy when the result is close to unity.
</p>
<h5>
<a name="math_toolkit.jacobi_theta.jacobi_theta3.h2"></a>
<span class="phrase"><a name="math_toolkit.jacobi_theta.jacobi_theta3.accuracy"></a></span><a class="link" href="jacobi_theta3.html#math_toolkit.jacobi_theta.jacobi_theta3.accuracy">Accuracy</a>
</h5>
<p>
The following <a class="link" href="../ulps_plots.html" title="ULPs Plots">ULPs plot</a> is
representative, fixing <span class="emphasis"><em>q</em></span>=0.5 and varying <span class="emphasis"><em>x</em></span>
from 0 to 2π:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/jacobi_theta3_float.svg" align="middle"></span>
</p></blockquote></div>
<p>
The envelope represents the function's <a href="https://en.wikipedia.org/wiki/Condition_number#One_variable" target="_top">condition
number</a>. Note that relative accuracy degenerates periodically near
θ<sub>3</sub>=1.
</p>
<p>
Fixing <span class="emphasis"><em>x</em></span>=0.4 and varying <span class="emphasis"><em>q</em></span>, the
ULPs plot looks like:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/jacobi_theta3q_float.svg" align="middle"></span>
</p></blockquote></div>
<p>
Accuracy tends to degenerate near <span class="emphasis"><em>q</em></span>=1 (small τ).
</p>
<h5>
<a name="math_toolkit.jacobi_theta.jacobi_theta3.h3"></a>
<span class="phrase"><a name="math_toolkit.jacobi_theta.jacobi_theta3.implementation"></a></span><a class="link" href="jacobi_theta3.html#math_toolkit.jacobi_theta.jacobi_theta3.implementation">Implementation</a>
</h5>
<p>
The <span class="emphasis"><em>q</em></span> parameterization is implemented using the τ parameterization,
where τ=-log(<span class="emphasis"><em>q</em></span>)/π.
</p>
<p>
If τ is greater than or equal to 1, the summation above is used as-is. However
if τ &lt; 1, the following identity <a href="https://dlmf.nist.gov/20.7#viii" target="_top">DLMF
20.7.32</a> is used, defining τ'=-1/τ:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi_theta3_imaginary.svg"></span>
</p></blockquote></div>
<p>
This transformation of variables ensures that the function will always converge
in a small number of iterations.
</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 © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Rå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="jacobi_theta2.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../jacobi_theta.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_theta4.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,170 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Jacobi Theta Function θ4</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 3.0.0">
<link rel="up" href="../jacobi_theta.html" title="Jacobi Theta Functions">
<link rel="prev" href="jacobi_theta3.html" title="Jacobi Theta Function θ3">
<link rel="next" href="../lambert_w.html" title="Lambert W function">
</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="jacobi_theta3.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../jacobi_theta.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="../lambert_w.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_theta.jacobi_theta4"></a><a class="link" href="jacobi_theta4.html" title="Jacobi Theta Function θ4">Jacobi Theta
Function θ<sub>4</sub></a>
</h3></div></div></div>
<h5>
<a name="math_toolkit.jacobi_theta.jacobi_theta4.h0"></a>
<span class="phrase"><a name="math_toolkit.jacobi_theta.jacobi_theta4.synopsis"></a></span><a class="link" href="jacobi_theta4.html#math_toolkit.jacobi_theta.jacobi_theta4.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_theta</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">&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_theta4</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">q</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">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_theta4</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">q</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Policy</span><span class="special">&amp;);</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">&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_theta4tau</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">tau</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">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_theta4tau</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">tau</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Policy</span><span class="special">&amp;);</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">&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_theta4m1</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">q</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">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_theta4m1</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">q</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Policy</span><span class="special">&amp;);</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">&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_theta4m1tau</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">tau</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">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_theta4m1tau</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">U</span> <span class="identifier">tau</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_theta.jacobi_theta4.h1"></a>
<span class="phrase"><a name="math_toolkit.jacobi_theta.jacobi_theta4.description"></a></span><a class="link" href="jacobi_theta4.html#math_toolkit.jacobi_theta.jacobi_theta4.description">Description</a>
</h5>
<p>
The functions calculate the value of fourth <a class="link" href="jacobi_theta_overview.html" title="Overview of the Jacobi Theta Functions">Jacobi
Theta function</a>, parameterized either in terms of the nome <span class="emphasis"><em>q</em></span>:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi_theta4.svg"></span>
</p></blockquote></div>
<p>
Or in terms of an imaginary τ:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi_theta4tau.svg"></span>
</p></blockquote></div>
<p>
The nome <span class="emphasis"><em>q</em></span> is restricted to the domain (0, 1), returning
the result of <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a>
otherwise. The following graph shows the theta function at various values
of <span class="emphasis"><em>q</em></span>:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/jacobi_theta4.svg" align="middle"></span>
</p></blockquote></div>
<p>
The final <a class="link" href="../../policy.html" title="Chapter 21. 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 21. Policies: Controlling Precision, Error Handling etc">policy
documentation for more details</a>.
</p>
<p>
A second quartet of functions (functions containing <code class="computeroutput"><span class="identifier">m1</span></code>)
compute one less than the value of the fourth theta function. These versions
of the functions provide increased accuracy when the result is close to unity.
</p>
<h5>
<a name="math_toolkit.jacobi_theta.jacobi_theta4.h2"></a>
<span class="phrase"><a name="math_toolkit.jacobi_theta.jacobi_theta4.accuracy"></a></span><a class="link" href="jacobi_theta4.html#math_toolkit.jacobi_theta.jacobi_theta4.accuracy">Accuracy</a>
</h5>
<p>
The following <a class="link" href="../ulps_plots.html" title="ULPs Plots">ULPs plot</a> is
representative, fixing <span class="emphasis"><em>q</em></span>=0.5 and varying <span class="emphasis"><em>x</em></span>
from 0 to 2π:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/jacobi_theta4_float.svg" align="middle"></span>
</p></blockquote></div>
<p>
The envelope represents the function's <a href="https://en.wikipedia.org/wiki/Condition_number#One_variable" target="_top">condition
number</a>. Note that relative accuracy degenerates periodically near
θ<sub>4</sub>=1.
</p>
<p>
Fixing <span class="emphasis"><em>x</em></span>=5 and varying <span class="emphasis"><em>q</em></span>, the ULPs
plot looks like:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/jacobi_theta4q_float.svg" align="middle"></span>
</p></blockquote></div>
<p>
Accuracy tends to degenerate near <span class="emphasis"><em>q</em></span>=1 (small τ).
</p>
<h5>
<a name="math_toolkit.jacobi_theta.jacobi_theta4.h3"></a>
<span class="phrase"><a name="math_toolkit.jacobi_theta.jacobi_theta4.implementation"></a></span><a class="link" href="jacobi_theta4.html#math_toolkit.jacobi_theta.jacobi_theta4.implementation">Implementation</a>
</h5>
<p>
The <span class="emphasis"><em>q</em></span> parameterization is implemented using the τ parameterization,
where τ=-log(<span class="emphasis"><em>q</em></span>)/π.
</p>
<p>
If τ is greater than or equal to 1, the summation above is used as-is. However
if τ &lt; 1, the following identity <a href="https://dlmf.nist.gov/20.7#viii" target="_top">DLMF
20.7.33</a> is used, defining τ'=-1/τ:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi_theta4_imaginary.svg"></span>
</p></blockquote></div>
<p>
This transformation of variables ensures that the function will always converge
in a small number of iterations.
</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 © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Rå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="jacobi_theta3.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../jacobi_theta.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="../lambert_w.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,176 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Overview of the Jacobi Theta Functions</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 3.0.0">
<link rel="up" href="../jacobi_theta.html" title="Jacobi Theta Functions">
<link rel="prev" href="../jacobi_theta.html" title="Jacobi Theta Functions">
<link rel="next" href="jacobi_theta1.html" title="Jacobi Theta Function θ1">
</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="../jacobi_theta.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../jacobi_theta.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_theta1.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_theta.jacobi_theta_overview"></a><a class="link" href="jacobi_theta_overview.html" title="Overview of the Jacobi Theta Functions">Overview
of the Jacobi Theta Functions</a>
</h3></div></div></div>
<p>
The Jacobi Theta functions are a set of four inter-related periodic functions
of <span class="emphasis"><em>x</em></span> which are expressed in terms of a parameter <span class="emphasis"><em>q</em></span>
(also called the nome), or a closely related value, τ
<a href="#ftn.math_toolkit.jacobi_theta.jacobi_theta_overview.f0" class="footnote" name="math_toolkit.jacobi_theta.jacobi_theta_overview.f0"><sup class="footnote">[8]</sup></a> <a href="#ftn.math_toolkit.jacobi_theta.jacobi_theta_overview.f1" class="footnote" name="math_toolkit.jacobi_theta.jacobi_theta_overview.f1"><sup class="footnote">[9]</sup></a> <a href="#ftn.math_toolkit.jacobi_theta.jacobi_theta_overview.f2" class="footnote" name="math_toolkit.jacobi_theta.jacobi_theta_overview.f2"><sup class="footnote">[10]</sup></a>.
</p>
<p>
They are
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi_theta1.svg"></span>
</p></blockquote></div>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi_theta2.svg"></span>
</p></blockquote></div>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi_theta3.svg"></span>
</p></blockquote></div>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi_theta4.svg"></span>
</p></blockquote></div>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/jacobi_theta.svg" align="middle"></span>
</p></blockquote></div>
<p>
Plots of the four theta functions for <span class="emphasis"><em>q</em></span>=0.15.
</p>
<p>
Appropriately multiplied and divided, these four theta functions can be used
to implement the <a class="link" href="../jacobi/jac_over.html" title="Overview of the Jacobi Elliptic Functions">Jacobi elliptic
functions</a>; but this is not really recommended, as the existing Boost
implementations are likely faster and more accurate.
</p>
<p>
Most applications will want to use the <span class="emphasis"><em>q</em></span> parameterization
of the functions: <code class="computeroutput"><a class="link" href="jacobi_theta1.html" title="Jacobi Theta Function θ1">jacobi_theta1</a></code>,
<code class="computeroutput"><a class="link" href="jacobi_theta2.html" title="Jacobi Theta Function θ2">jacobi_theta2</a></code>,
<code class="computeroutput"><a class="link" href="jacobi_theta3.html" title="Jacobi Theta Function θ3">jacobi_theta3</a></code>,
and <code class="computeroutput"><a class="link" href="jacobi_theta4.html" title="Jacobi Theta Function θ4">jacobi_theta4</a></code>,
where <span class="emphasis"><em>q</em></span> is restricted to the domain (0, 1). These four
functions are equivalent to Mathematica's <a href="https://reference.wolfram.com/language/ref/EllipticTheta.html" target="_top">EllipticTheta</a>
function (whose first argument is the function number).
</p>
<p>
A second τ parameterization is also provided for all four functions, where
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/jacobi_theta_nome.svg"></span>
</p></blockquote></div>
<p>
Note that there is a slight difference between τ in the equation above and
the <code class="computeroutput"><span class="identifier">tau</span></code> in the Boost function
signatures. The mathematical τ is assumed to be a purely imaginary number,
but the Boost argument is real-valued. Boost treats its real-valued argument
as an imaginary number; that is, it implicitly multiplies the argument by
<span class="emphasis"><em>i</em></span>. This assumption of τ's imaginarity is not required
by the mathematics, but it does cover the most common application domains.
</p>
<h5>
<a name="math_toolkit.jacobi_theta.jacobi_theta_overview.h0"></a>
<span class="phrase"><a name="math_toolkit.jacobi_theta.jacobi_theta_overview.accuracy_considerations"></a></span><a class="link" href="jacobi_theta_overview.html#math_toolkit.jacobi_theta.jacobi_theta_overview.accuracy_considerations">Accuracy
considerations</a>
</h5>
<p>
The purpose of the τ parameterization is to provide increased accuracy either
when <span class="emphasis"><em>q</em></span> is expressible as an exponential or is very close
to unity. For example, instead of:
</p>
<pre class="programlisting"><span class="identifier">jacobi_theta1</span><span class="special">(</span><span class="identifier">x</span><span class="special">,</span> <span class="identifier">exp</span><span class="special">(-</span><span class="identifier">a</span><span class="special">));</span>
</pre>
<p>
A more accurate computation will take advantage of τ:
</p>
<pre class="programlisting"><span class="identifier">jacobi_theta1tau</span><span class="special">(</span><span class="identifier">x</span><span class="special">,</span> <span class="identifier">a</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">constants</span><span class="special">::</span><span class="identifier">pi</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;());</span>
</pre>
<p>
Internally, Boost implements the <span class="emphasis"><em>q</em></span> parameterization
by taking the logarithm of <span class="emphasis"><em>q</em></span> and passing it to the τ parameterization;
as such, using the τ parameterization directly will generally yield greater
precision. As another example, if the complement of <span class="emphasis"><em>q</em></span>
is known with great accuracy, then instead of:
</p>
<pre class="programlisting"><span class="identifier">jacobi_theta1</span><span class="special">(</span><span class="identifier">x</span><span class="special">,</span> <span class="number">1</span><span class="special">-</span><span class="identifier">q_complement</span><span class="special">);</span>
</pre>
<p>
It is more accurate to use <code class="computeroutput"><a class="link" href="../powers/log1p.html" title="log1p">log1p</a></code>
and pass in the result to the τ version:
</p>
<pre class="programlisting"><span class="identifier">jacobi_theta1tau</span><span class="special">(</span><span class="identifier">x</span><span class="special">,</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">log1p</span><span class="special">(-</span><span class="identifier">q_complement</span><span class="special">)</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">constants</span><span class="special">::</span><span class="identifier">pi</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;());</span>
</pre>
<p>
Additional "minus 1" versions of the third and fourth theta functions
are provided. Similar in spirit to <code class="computeroutput"><a class="link" href="../powers/expm1.html" title="expm1">expm1</a></code>,
these functions return one less than the evaluated function, and yield increased
accuracy when <span class="emphasis"><em>q</em></span> is small.
</p>
<h5>
<a name="math_toolkit.jacobi_theta.jacobi_theta_overview.h1"></a>
<span class="phrase"><a name="math_toolkit.jacobi_theta.jacobi_theta_overview.testing"></a></span><a class="link" href="jacobi_theta_overview.html#math_toolkit.jacobi_theta.jacobi_theta_overview.testing">Testing</a>
</h5>
<p>
Results of the theta functions are tested against Wolfram Alpha data, as
well as random values computed at high precision. In addition, the tests
verify the majority of the identities described in <a href="https://dlmf.nist.gov/20.7" target="_top">DLMF
Chapter 20.7</a>.
</p>
<div class="footnotes">
<br><hr style="width:100; text-align:left;margin-left: 0">
<div id="ftn.math_toolkit.jacobi_theta.jacobi_theta_overview.f0" class="footnote"><p><a href="#math_toolkit.jacobi_theta.jacobi_theta_overview.f0" class="para"><sup class="para">[8] </sup></a>
<a href="https://en.wikipedia.org/wiki/Theta_function" target="_top">Wikipedia: Theta
function</a>
</p></div>
<div id="ftn.math_toolkit.jacobi_theta.jacobi_theta_overview.f1" class="footnote"><p><a href="#math_toolkit.jacobi_theta.jacobi_theta_overview.f1" class="para"><sup class="para">[9] </sup></a>
<a href="https://mathworld.wolfram.com/JacobiThetaFunctions.html" target="_top">Weisstein,
Eric W. "Jacobi Theta Functions." From MathWorld - A Wolfram
Web Resource.</a>
</p></div>
<div id="ftn.math_toolkit.jacobi_theta.jacobi_theta_overview.f2" class="footnote"><p><a href="#math_toolkit.jacobi_theta.jacobi_theta_overview.f2" class="para"><sup class="para">[10] </sup></a>
<a href="https://dlmf.nist.gov/20" target="_top">Digital Library of Mathematical Functions:
Theta Functions, Reinhardt, W. P., Walker, P. L.</a>
</p></div>
</div>
</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 © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Rå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="../jacobi_theta.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../jacobi_theta.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_theta1.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>