| 1 |
<html> |
| 2 |
<head> |
| 3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 4 |
<title>Elliptic Integrals - Carlson Form</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_intro.html" title="Elliptic Integral Overview"> |
| 10 |
<link rel="next" href="ellint_1.html" title="Elliptic Integrals of the First Kind - Legendre Form"> |
| 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_intro.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ellint.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="ellint_1.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.ellint_carlson"></a><a class="link" href="ellint_carlson.html" title="Elliptic Integrals - Carlson Form">Elliptic Integrals |
| 29 |
- Carlson Form</a> |
| 30 |
</h3></div></div></div> |
| 31 |
<h5> |
| 32 |
<a name="math_toolkit.ellint.ellint_carlson.h0"></a> |
| 33 |
<span class="phrase"><a name="math_toolkit.ellint.ellint_carlson.synopsis"></a></span><a class="link" href="ellint_carlson.html#math_toolkit.ellint.ellint_carlson.synopsis">Synopsis</a> |
| 34 |
</h5> |
| 35 |
<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">ellint_rf</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> |
| 36 |
</pre> |
| 37 |
<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> |
| 38 |
|
| 39 |
<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> <span class="identifier">T3</span><span class="special">></span> |
| 40 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rf</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">z</span><span class="special">)</span> |
| 41 |
|
| 42 |
<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> <span class="identifier">T3</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> |
| 43 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rf</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">z</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> |
| 44 |
|
| 45 |
<span class="special">}}</span> <span class="comment">// namespaces</span> |
| 46 |
</pre> |
| 47 |
<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">ellint_rd</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> |
| 48 |
</pre> |
| 49 |
<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> |
| 50 |
|
| 51 |
<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> <span class="identifier">T3</span><span class="special">></span> |
| 52 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rd</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">z</span><span class="special">)</span> |
| 53 |
|
| 54 |
<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> <span class="identifier">T3</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> |
| 55 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rd</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">z</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> |
| 56 |
|
| 57 |
<span class="special">}}</span> <span class="comment">// namespaces</span> |
| 58 |
</pre> |
| 59 |
<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">ellint_rj</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> |
| 60 |
</pre> |
| 61 |
<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> |
| 62 |
|
| 63 |
<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> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T4</span><span class="special">></span> |
| 64 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rj</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">z</span><span class="special">,</span> <span class="identifier">T4</span> <span class="identifier">p</span><span class="special">)</span> |
| 65 |
|
| 66 |
<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> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T4</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> |
| 67 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rj</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">z</span><span class="special">,</span> <span class="identifier">T4</span> <span class="identifier">p</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> |
| 68 |
|
| 69 |
<span class="special">}}</span> <span class="comment">// namespaces</span> |
| 70 |
</pre> |
| 71 |
<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">ellint_rc</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> |
| 72 |
</pre> |
| 73 |
<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> |
| 74 |
|
| 75 |
<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> |
| 76 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rc</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</span><span class="special">)</span> |
| 77 |
|
| 78 |
<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> |
| 79 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rc</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</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> |
| 80 |
|
| 81 |
<span class="special">}}</span> <span class="comment">// namespaces</span> |
| 82 |
</pre> |
| 83 |
<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">ellint_rg</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> |
| 84 |
</pre> |
| 85 |
<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> |
| 86 |
|
| 87 |
<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> <span class="identifier">T3</span><span class="special">></span> |
| 88 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rg</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">z</span><span class="special">)</span> |
| 89 |
|
| 90 |
<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> <span class="identifier">T3</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> |
| 91 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rg</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">z</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> |
| 92 |
|
| 93 |
<span class="special">}}</span> <span class="comment">// namespaces</span> |
| 94 |
</pre> |
| 95 |
<h5> |
| 96 |
<a name="math_toolkit.ellint.ellint_carlson.h1"></a> |
| 97 |
<span class="phrase"><a name="math_toolkit.ellint.ellint_carlson.description"></a></span><a class="link" href="ellint_carlson.html#math_toolkit.ellint.ellint_carlson.description">Description</a> |
| 98 |
</h5> |
| 99 |
<p> |
| 100 |
These functions return Carlson's symmetrical elliptic integrals, the functions |
| 101 |
have complicated behavior over all their possible domains, but the following |
| 102 |
graph gives an idea of their behavior: |
| 103 |
</p> |
| 104 |
<div class="blockquote"><blockquote class="blockquote"><p> |
| 105 |
<span class="inlinemediaobject"><img src="../../../graphs/ellint_carlson.svg" align="middle"></span> |
| 106 |
|
| 107 |
</p></blockquote></div> |
| 108 |
<p> |
| 109 |
The return type of these functions is computed using the <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>result |
| 110 |
type calculation rules</em></span></a> when the arguments are of different |
| 111 |
types: otherwise the return is the same type as the arguments. |
| 112 |
</p> |
| 113 |
<pre class="programlisting"><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> <span class="identifier">T3</span><span class="special">></span> |
| 114 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rf</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">z</span><span class="special">)</span> |
| 115 |
|
| 116 |
<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> <span class="identifier">T3</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> |
| 117 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rf</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">z</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> |
| 118 |
</pre> |
| 119 |
<p> |
| 120 |
Returns Carlson's Elliptic Integral <span class="emphasis"><em>R<sub>F</sub></em></span>: |
| 121 |
</p> |
| 122 |
<div class="blockquote"><blockquote class="blockquote"><p> |
| 123 |
<span class="inlinemediaobject"><img src="../../../equations/ellint9.svg"></span> |
| 124 |
|
| 125 |
</p></blockquote></div> |
| 126 |
<p> |
| 127 |
Requires that all of the arguments are non-negative, and at most one may |
| 128 |
be zero. Otherwise returns the result of <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a>. |
| 129 |
</p> |
| 130 |
<p> |
| 131 |
The final <a class="link" href="../../policy.html" title="Chapter 22. Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can |
| 132 |
be used to control the behaviour of the function: how it handles errors, |
| 133 |
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 |
| 134 |
documentation for more details</a>. |
| 135 |
</p> |
| 136 |
<pre class="programlisting"><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> <span class="identifier">T3</span><span class="special">></span> |
| 137 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rd</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">z</span><span class="special">)</span> |
| 138 |
|
| 139 |
<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> <span class="identifier">T3</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> |
| 140 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rd</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">z</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> |
| 141 |
</pre> |
| 142 |
<p> |
| 143 |
Returns Carlson's elliptic integral R<sub>D</sub>: |
| 144 |
</p> |
| 145 |
<div class="blockquote"><blockquote class="blockquote"><p> |
| 146 |
<span class="inlinemediaobject"><img src="../../../equations/ellint10.svg"></span> |
| 147 |
|
| 148 |
</p></blockquote></div> |
| 149 |
<p> |
| 150 |
Requires that x and y are non-negative, with at most one of them zero, and |
| 151 |
that z >= 0. Otherwise returns the result of <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a>. |
| 152 |
</p> |
| 153 |
<p> |
| 154 |
The final <a class="link" href="../../policy.html" title="Chapter 22. Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can |
| 155 |
be used to control the behaviour of the function: how it handles errors, |
| 156 |
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 |
| 157 |
documentation for more details</a>. |
| 158 |
</p> |
| 159 |
<pre class="programlisting"><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> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T4</span><span class="special">></span> |
| 160 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rj</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">z</span><span class="special">,</span> <span class="identifier">T4</span> <span class="identifier">p</span><span class="special">)</span> |
| 161 |
|
| 162 |
<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> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T4</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> |
| 163 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rj</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">z</span><span class="special">,</span> <span class="identifier">T4</span> <span class="identifier">p</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> |
| 164 |
</pre> |
| 165 |
<p> |
| 166 |
Returns Carlson's elliptic integral R<sub>J</sub>: |
| 167 |
</p> |
| 168 |
<div class="blockquote"><blockquote class="blockquote"><p> |
| 169 |
<span class="inlinemediaobject"><img src="../../../equations/ellint11.svg"></span> |
| 170 |
|
| 171 |
</p></blockquote></div> |
| 172 |
<p> |
| 173 |
Requires that x, y and z are non-negative, with at most one of them zero, |
| 174 |
and that <span class="emphasis"><em>p != 0</em></span>. Otherwise returns the result of <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a>. |
| 175 |
</p> |
| 176 |
<p> |
| 177 |
The final <a class="link" href="../../policy.html" title="Chapter 22. Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can |
| 178 |
be used to control the behaviour of the function: how it handles errors, |
| 179 |
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 |
| 180 |
documentation for more details</a>. |
| 181 |
</p> |
| 182 |
<p> |
| 183 |
When <span class="emphasis"><em>p < 0</em></span> the function returns the <a href="http://en.wikipedia.org/wiki/Cauchy_principal_value" target="_top">Cauchy |
| 184 |
principal value</a> using the relation: |
| 185 |
</p> |
| 186 |
<div class="blockquote"><blockquote class="blockquote"><p> |
| 187 |
<span class="inlinemediaobject"><img src="../../../equations/ellint17.svg"></span> |
| 188 |
|
| 189 |
</p></blockquote></div> |
| 190 |
<pre class="programlisting"><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> |
| 191 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rc</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</span><span class="special">)</span> |
| 192 |
|
| 193 |
<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> |
| 194 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rc</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</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> |
| 195 |
</pre> |
| 196 |
<p> |
| 197 |
Returns Carlson's elliptic integral R<sub>C</sub>: |
| 198 |
</p> |
| 199 |
<div class="blockquote"><blockquote class="blockquote"><p> |
| 200 |
<span class="inlinemediaobject"><img src="../../../equations/ellint12.svg"></span> |
| 201 |
|
| 202 |
</p></blockquote></div> |
| 203 |
<p> |
| 204 |
Requires that <span class="emphasis"><em>x > 0</em></span> and that <span class="emphasis"><em>y != 0</em></span>. |
| 205 |
Otherwise returns the result of <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a>. |
| 206 |
</p> |
| 207 |
<p> |
| 208 |
The final <a class="link" href="../../policy.html" title="Chapter 22. Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can |
| 209 |
be used to control the behaviour of the function: how it handles errors, |
| 210 |
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 |
| 211 |
documentation for more details</a>. |
| 212 |
</p> |
| 213 |
<p> |
| 214 |
When <span class="emphasis"><em>y < 0</em></span> the function returns the <a href="http://mathworld.wolfram.com/CauchyPrincipalValue.html" target="_top">Cauchy |
| 215 |
principal value</a> using the relation: |
| 216 |
</p> |
| 217 |
<div class="blockquote"><blockquote class="blockquote"><p> |
| 218 |
<span class="inlinemediaobject"><img src="../../../equations/ellint18.svg"></span> |
| 219 |
|
| 220 |
</p></blockquote></div> |
| 221 |
<pre class="programlisting"><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> <span class="identifier">T3</span><span class="special">></span> |
| 222 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rg</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">z</span><span class="special">)</span> |
| 223 |
|
| 224 |
<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> <span class="identifier">T3</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> |
| 225 |
<a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ellint_rg</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">y</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">z</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> |
| 226 |
</pre> |
| 227 |
<p> |
| 228 |
Returns Carlson's elliptic integral <span class="emphasis"><em>R<sub>G</sub>:</em></span> |
| 229 |
</p> |
| 230 |
<div class="blockquote"><blockquote class="blockquote"><p> |
| 231 |
<span class="inlinemediaobject"><img src="../../../equations/ellint27.svg"></span> |
| 232 |
|
| 233 |
</p></blockquote></div> |
| 234 |
<p> |
| 235 |
Requires that x and y are non-negative, otherwise returns the result of |
| 236 |
<a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a>. |
| 237 |
</p> |
| 238 |
<p> |
| 239 |
The final <a class="link" href="../../policy.html" title="Chapter 22. Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can |
| 240 |
be used to control the behaviour of the function: how it handles errors, |
| 241 |
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 |
| 242 |
documentation for more details</a>. |
| 243 |
</p> |
| 244 |
<h5> |
| 245 |
<a name="math_toolkit.ellint.ellint_carlson.h2"></a> |
| 246 |
<span class="phrase"><a name="math_toolkit.ellint.ellint_carlson.testing"></a></span><a class="link" href="ellint_carlson.html#math_toolkit.ellint.ellint_carlson.testing">Testing</a> |
| 247 |
</h5> |
| 248 |
<p> |
| 249 |
There are two sets of tests. |
| 250 |
</p> |
| 251 |
<p> |
| 252 |
Spot tests compare selected values with test data given in: |
| 253 |
</p> |
| 254 |
<div class="blockquote"><blockquote class="blockquote"><p> |
| 255 |
B. C. Carlson, <span class="emphasis"><em><a href="http://arxiv.org/abs/math.CA/9409227" target="_top">Numerical |
| 256 |
computation of real or complex elliptic integrals</a></em></span>. Numerical |
| 257 |
Algorithms, Volume 10, Number 1 / March, 1995, pp 13-26. |
| 258 |
</p></blockquote></div> |
| 259 |
<p> |
| 260 |
Random test data generated using NTL::RR at 1000-bit precision and our implementation |
| 261 |
checks for rounding-errors and/or regressions. |
| 262 |
</p> |
| 263 |
<p> |
| 264 |
There are also sanity checks that use the inter-relations between the integrals |
| 265 |
to verify their correctness: see the above Carlson paper for details. |
| 266 |
</p> |
| 267 |
<h5> |
| 268 |
<a name="math_toolkit.ellint.ellint_carlson.h3"></a> |
| 269 |
<span class="phrase"><a name="math_toolkit.ellint.ellint_carlson.accuracy"></a></span><a class="link" href="ellint_carlson.html#math_toolkit.ellint.ellint_carlson.accuracy">Accuracy</a> |
| 270 |
</h5> |
| 271 |
<p> |
| 272 |
These functions are computed using only basic arithmetic operations, so there |
| 273 |
isn't much variation in accuracy over differing platforms. Note that only |
| 274 |
results for the widest floating-point type on the system are given as narrower |
| 275 |
types have <a class="link" href="../relative_error.html#math_toolkit.relative_error.zero_error">effectively |
| 276 |
zero error</a>. All values are relative errors in units of epsilon. |
| 277 |
</p> |
| 278 |
<div class="table"> |
| 279 |
<a name="math_toolkit.ellint.ellint_carlson.table_ellint_rc"></a><p class="title"><b>Table 8.58. Error rates for ellint_rc</b></p> |
| 280 |
<div class="table-contents"><table class="table" summary="Error rates for ellint_rc"> |
| 281 |
<colgroup> |
| 282 |
<col> |
| 283 |
<col> |
| 284 |
<col> |
| 285 |
<col> |
| 286 |
</colgroup> |
| 287 |
<thead><tr> |
| 288 |
<th> |
| 289 |
</th> |
| 290 |
<th> |
| 291 |
<p> |
| 292 |
GNU C++ version 7.1.0<br> linux<br> double |
| 293 |
</p> |
| 294 |
</th> |
| 295 |
<th> |
| 296 |
<p> |
| 297 |
GNU C++ version 7.1.0<br> linux<br> long double |
| 298 |
</p> |
| 299 |
</th> |
| 300 |
<th> |
| 301 |
<p> |
| 302 |
Microsoft Visual C++ version 14.1<br> Win32<br> double |
| 303 |
</p> |
| 304 |
</th> |
| 305 |
</tr></thead> |
| 306 |
<tbody><tr> |
| 307 |
<td> |
| 308 |
<p> |
| 309 |
RC: Random data |
| 310 |
</p> |
| 311 |
</td> |
| 312 |
<td> |
| 313 |
<p> |
| 314 |
<span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL |
| 315 |
2.1:</em></span> Max = 2.4ε (Mean = 0.624ε)) |
| 316 |
</p> |
| 317 |
</td> |
| 318 |
<td> |
| 319 |
<p> |
| 320 |
<span class="blue">Max = 0.995ε (Mean = 0.433ε)</span> |
| 321 |
</p> |
| 322 |
</td> |
| 323 |
<td> |
| 324 |
<p> |
| 325 |
<span class="blue">Max = 0.962ε (Mean = 0.407ε)</span> |
| 326 |
</p> |
| 327 |
</td> |
| 328 |
</tr></tbody> |
| 329 |
</table></div> |
| 330 |
</div> |
| 331 |
<br class="table-break"><div class="table"> |
| 332 |
<a name="math_toolkit.ellint.ellint_carlson.table_ellint_rd"></a><p class="title"><b>Table 8.59. Error rates for ellint_rd</b></p> |
| 333 |
<div class="table-contents"><table class="table" summary="Error rates for ellint_rd"> |
| 334 |
<colgroup> |
| 335 |
<col> |
| 336 |
<col> |
| 337 |
<col> |
| 338 |
<col> |
| 339 |
</colgroup> |
| 340 |
<thead><tr> |
| 341 |
<th> |
| 342 |
</th> |
| 343 |
<th> |
| 344 |
<p> |
| 345 |
GNU C++ version 7.1.0<br> linux<br> double |
| 346 |
</p> |
| 347 |
</th> |
| 348 |
<th> |
| 349 |
<p> |
| 350 |
GNU C++ version 7.1.0<br> linux<br> long double |
| 351 |
</p> |
| 352 |
</th> |
| 353 |
<th> |
| 354 |
<p> |
| 355 |
Microsoft Visual C++ version 14.1<br> Win32<br> double |
| 356 |
</p> |
| 357 |
</th> |
| 358 |
</tr></thead> |
| 359 |
<tbody> |
| 360 |
<tr> |
| 361 |
<td> |
| 362 |
<p> |
| 363 |
RD: Random data |
| 364 |
</p> |
| 365 |
</td> |
| 366 |
<td> |
| 367 |
<p> |
| 368 |
<span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL |
| 369 |
2.1:</em></span> Max = 2.59ε (Mean = 0.878ε)) |
| 370 |
</p> |
| 371 |
</td> |
| 372 |
<td> |
| 373 |
<p> |
| 374 |
<span class="blue">Max = 2.73ε (Mean = 0.831ε)</span> |
| 375 |
</p> |
| 376 |
</td> |
| 377 |
<td> |
| 378 |
<p> |
| 379 |
<span class="blue">Max = 2.16ε (Mean = 0.803ε)</span> |
| 380 |
</p> |
| 381 |
</td> |
| 382 |
</tr> |
| 383 |
<tr> |
| 384 |
<td> |
| 385 |
<p> |
| 386 |
RD: y = z |
| 387 |
</p> |
| 388 |
</td> |
| 389 |
<td> |
| 390 |
<p> |
| 391 |
<span class="blue">Max = 0.896ε (Mean = 0.022ε)</span><br> <br> |
| 392 |
(<span class="emphasis"><em>GSL 2.1:</em></span> Max = 2.88ε (Mean = 0.839ε)) |
| 393 |
</p> |
| 394 |
</td> |
| 395 |
<td> |
| 396 |
<p> |
| 397 |
<span class="blue">Max = 2.65ε (Mean = 0.82ε)</span> |
| 398 |
</p> |
| 399 |
</td> |
| 400 |
<td> |
| 401 |
<p> |
| 402 |
<span class="blue">Max = 16.5ε (Mean = 0.843ε)</span> |
| 403 |
</p> |
| 404 |
</td> |
| 405 |
</tr> |
| 406 |
<tr> |
| 407 |
<td> |
| 408 |
<p> |
| 409 |
RD: x = y |
| 410 |
</p> |
| 411 |
</td> |
| 412 |
<td> |
| 413 |
<p> |
| 414 |
<span class="blue">Max = 0.824ε (Mean = 0.0272ε)</span><br> |
| 415 |
<br> (<span class="emphasis"><em>GSL 2.1:</em></span> Max = 3.74ε (Mean = 0.84ε)) |
| 416 |
</p> |
| 417 |
</td> |
| 418 |
<td> |
| 419 |
<p> |
| 420 |
<span class="blue">Max = 2.85ε (Mean = 0.865ε)</span> |
| 421 |
</p> |
| 422 |
</td> |
| 423 |
<td> |
| 424 |
<p> |
| 425 |
<span class="blue">Max = 3.51ε (Mean = 0.816ε)</span> |
| 426 |
</p> |
| 427 |
</td> |
| 428 |
</tr> |
| 429 |
<tr> |
| 430 |
<td> |
| 431 |
<p> |
| 432 |
RD: x = 0, y = z |
| 433 |
</p> |
| 434 |
</td> |
| 435 |
<td> |
| 436 |
<p> |
| 437 |
<span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL |
| 438 |
2.1:</em></span> Max = 2ε (Mean = 0.656ε)) |
| 439 |
</p> |
| 440 |
</td> |
| 441 |
<td> |
| 442 |
<p> |
| 443 |
<span class="blue">Max = 1.19ε (Mean = 0.522ε)</span> |
| 444 |
</p> |
| 445 |
</td> |
| 446 |
<td> |
| 447 |
<p> |
| 448 |
<span class="blue">Max = 1.16ε (Mean = 0.497ε)</span> |
| 449 |
</p> |
| 450 |
</td> |
| 451 |
</tr> |
| 452 |
<tr> |
| 453 |
<td> |
| 454 |
<p> |
| 455 |
RD: x = y = z |
| 456 |
</p> |
| 457 |
</td> |
| 458 |
<td> |
| 459 |
<p> |
| 460 |
<span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL |
| 461 |
2.1:</em></span> Max = 1.03ε (Mean = 0.418ε)) |
| 462 |
</p> |
| 463 |
</td> |
| 464 |
<td> |
| 465 |
<p> |
| 466 |
<span class="blue">Max = 0.998ε (Mean = 0.387ε)</span> |
| 467 |
</p> |
| 468 |
</td> |
| 469 |
<td> |
| 470 |
<p> |
| 471 |
<span class="blue">Max = 1.03ε (Mean = 0.418ε)</span> |
| 472 |
</p> |
| 473 |
</td> |
| 474 |
</tr> |
| 475 |
<tr> |
| 476 |
<td> |
| 477 |
<p> |
| 478 |
RD: x = 0 |
| 479 |
</p> |
| 480 |
</td> |
| 481 |
<td> |
| 482 |
<p> |
| 483 |
<span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL |
| 484 |
2.1:</em></span> Max = 2.85ε (Mean = 0.781ε)) |
| 485 |
</p> |
| 486 |
</td> |
| 487 |
<td> |
| 488 |
<p> |
| 489 |
<span class="blue">Max = 2.79ε (Mean = 0.883ε)</span> |
| 490 |
</p> |
| 491 |
</td> |
| 492 |
<td> |
| 493 |
<p> |
| 494 |
<span class="blue">Max = 2.64ε (Mean = 0.894ε)</span> |
| 495 |
</p> |
| 496 |
</td> |
| 497 |
</tr> |
| 498 |
</tbody> |
| 499 |
</table></div> |
| 500 |
</div> |
| 501 |
<br class="table-break"><div class="table"> |
| 502 |
<a name="math_toolkit.ellint.ellint_carlson.table_ellint_rg"></a><p class="title"><b>Table 8.60. Error rates for ellint_rg</b></p> |
| 503 |
<div class="table-contents"><table class="table" summary="Error rates for ellint_rg"> |
| 504 |
<colgroup> |
| 505 |
<col> |
| 506 |
<col> |
| 507 |
<col> |
| 508 |
<col> |
| 509 |
</colgroup> |
| 510 |
<thead><tr> |
| 511 |
<th> |
| 512 |
</th> |
| 513 |
<th> |
| 514 |
<p> |
| 515 |
GNU C++ version 7.1.0<br> linux<br> double |
| 516 |
</p> |
| 517 |
</th> |
| 518 |
<th> |
| 519 |
<p> |
| 520 |
GNU C++ version 7.1.0<br> linux<br> long double |
| 521 |
</p> |
| 522 |
</th> |
| 523 |
<th> |
| 524 |
<p> |
| 525 |
Microsoft Visual C++ version 14.1<br> Win32<br> double |
| 526 |
</p> |
| 527 |
</th> |
| 528 |
</tr></thead> |
| 529 |
<tbody> |
| 530 |
<tr> |
| 531 |
<td> |
| 532 |
<p> |
| 533 |
RG: Random Data |
| 534 |
</p> |
| 535 |
</td> |
| 536 |
<td> |
| 537 |
<p> |
| 538 |
<span class="blue">Max = 0.983ε (Mean = 0.0172ε)</span><br> |
| 539 |
<br> (<span class="emphasis"><em>GSL 2.1:</em></span> Max = 0.983ε (Mean = 0.0172ε)) |
| 540 |
</p> |
| 541 |
</td> |
| 542 |
<td> |
| 543 |
<p> |
| 544 |
<span class="blue">Max = 3.95ε (Mean = 0.951ε)</span> |
| 545 |
</p> |
| 546 |
</td> |
| 547 |
<td> |
| 548 |
<p> |
| 549 |
<span class="blue">Max = 3.65ε (Mean = 0.929ε)</span> |
| 550 |
</p> |
| 551 |
</td> |
| 552 |
</tr> |
| 553 |
<tr> |
| 554 |
<td> |
| 555 |
<p> |
| 556 |
RG: two values 0 |
| 557 |
</p> |
| 558 |
</td> |
| 559 |
<td> |
| 560 |
<p> |
| 561 |
<span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL |
| 562 |
2.1:</em></span> Max = 0ε (Mean = 0ε)) |
| 563 |
</p> |
| 564 |
</td> |
| 565 |
<td> |
| 566 |
<p> |
| 567 |
<span class="blue">Max = 0ε (Mean = 0ε)</span> |
| 568 |
</p> |
| 569 |
</td> |
| 570 |
<td> |
| 571 |
<p> |
| 572 |
<span class="blue">Max = 0ε (Mean = 0ε)</span> |
| 573 |
</p> |
| 574 |
</td> |
| 575 |
</tr> |
| 576 |
<tr> |
| 577 |
<td> |
| 578 |
<p> |
| 579 |
RG: All values the same or zero |
| 580 |
</p> |
| 581 |
</td> |
| 582 |
<td> |
| 583 |
<p> |
| 584 |
<span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL |
| 585 |
2.1:</em></span> Max = 0ε (Mean = 0ε)) |
| 586 |
</p> |
| 587 |
</td> |
| 588 |
<td> |
| 589 |
<p> |
| 590 |
<span class="blue">Max = 0.992ε (Mean = 0.288ε)</span> |
| 591 |
</p> |
| 592 |
</td> |
| 593 |
<td> |
| 594 |
<p> |
| 595 |
<span class="blue">Max = 1.06ε (Mean = 0.348ε)</span> |
| 596 |
</p> |
| 597 |
</td> |
| 598 |
</tr> |
| 599 |
<tr> |
| 600 |
<td> |
| 601 |
<p> |
| 602 |
RG: two values the same |
| 603 |
</p> |
| 604 |
</td> |
| 605 |
<td> |
| 606 |
<p> |
| 607 |
<span class="blue">Max = 0.594ε (Mean = 0.0103ε)</span><br> |
| 608 |
<br> (<span class="emphasis"><em>GSL 2.1:</em></span> Max = 0.594ε (Mean = 0.0103ε)) |
| 609 |
</p> |
| 610 |
</td> |
| 611 |
<td> |
| 612 |
<p> |
| 613 |
<span class="blue">Max = 1.51ε (Mean = 0.404ε)</span> |
| 614 |
</p> |
| 615 |
</td> |
| 616 |
<td> |
| 617 |
<p> |
| 618 |
<span class="blue">Max = 1.96ε (Mean = 0.374ε)</span> |
| 619 |
</p> |
| 620 |
</td> |
| 621 |
</tr> |
| 622 |
<tr> |
| 623 |
<td> |
| 624 |
<p> |
| 625 |
RG: one value zero |
| 626 |
</p> |
| 627 |
</td> |
| 628 |
<td> |
| 629 |
<p> |
| 630 |
<span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL |
| 631 |
2.1:</em></span> Max = 0ε (Mean = 0ε)) |
| 632 |
</p> |
| 633 |
</td> |
| 634 |
<td> |
| 635 |
<p> |
| 636 |
<span class="blue">Max = 2.14ε (Mean = 0.722ε)</span> |
| 637 |
</p> |
| 638 |
</td> |
| 639 |
<td> |
| 640 |
<p> |
| 641 |
<span class="blue">Max = 1.96ε (Mean = 0.674ε)</span> |
| 642 |
</p> |
| 643 |
</td> |
| 644 |
</tr> |
| 645 |
</tbody> |
| 646 |
</table></div> |
| 647 |
</div> |
| 648 |
<br class="table-break"><div class="table"> |
| 649 |
<a name="math_toolkit.ellint.ellint_carlson.table_ellint_rf"></a><p class="title"><b>Table 8.61. Error rates for ellint_rf</b></p> |
| 650 |
<div class="table-contents"><table class="table" summary="Error rates for ellint_rf"> |
| 651 |
<colgroup> |
| 652 |
<col> |
| 653 |
<col> |
| 654 |
<col> |
| 655 |
<col> |
| 656 |
</colgroup> |
| 657 |
<thead><tr> |
| 658 |
<th> |
| 659 |
</th> |
| 660 |
<th> |
| 661 |
<p> |
| 662 |
GNU C++ version 7.1.0<br> linux<br> double |
| 663 |
</p> |
| 664 |
</th> |
| 665 |
<th> |
| 666 |
<p> |
| 667 |
GNU C++ version 7.1.0<br> linux<br> long double |
| 668 |
</p> |
| 669 |
</th> |
| 670 |
<th> |
| 671 |
<p> |
| 672 |
Microsoft Visual C++ version 14.1<br> Win32<br> double |
| 673 |
</p> |
| 674 |
</th> |
| 675 |
</tr></thead> |
| 676 |
<tbody> |
| 677 |
<tr> |
| 678 |
<td> |
| 679 |
<p> |
| 680 |
RF: Random data |
| 681 |
</p> |
| 682 |
</td> |
| 683 |
<td> |
| 684 |
<p> |
| 685 |
<span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL |
| 686 |
2.1:</em></span> Max = 2.73ε (Mean = 0.804ε)) |
| 687 |
</p> |
| 688 |
</td> |
| 689 |
<td> |
| 690 |
<p> |
| 691 |
<span class="blue">Max = 2.54ε (Mean = 0.674ε)</span> |
| 692 |
</p> |
| 693 |
</td> |
| 694 |
<td> |
| 695 |
<p> |
| 696 |
<span class="blue">Max = 2.02ε (Mean = 0.677ε)</span> |
| 697 |
</p> |
| 698 |
</td> |
| 699 |
</tr> |
| 700 |
<tr> |
| 701 |
<td> |
| 702 |
<p> |
| 703 |
RF: x = y = z |
| 704 |
</p> |
| 705 |
</td> |
| 706 |
<td> |
| 707 |
<p> |
| 708 |
<span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL |
| 709 |
2.1:</em></span> Max = 0.999ε (Mean = 0.34ε)) |
| 710 |
</p> |
| 711 |
</td> |
| 712 |
<td> |
| 713 |
<p> |
| 714 |
<span class="blue">Max = 0.991ε (Mean = 0.345ε)</span> |
| 715 |
</p> |
| 716 |
</td> |
| 717 |
<td> |
| 718 |
<p> |
| 719 |
<span class="blue">Max = 0.999ε (Mean = 0.34ε)</span> |
| 720 |
</p> |
| 721 |
</td> |
| 722 |
</tr> |
| 723 |
<tr> |
| 724 |
<td> |
| 725 |
<p> |
| 726 |
RF: x = y or y = z or x = z |
| 727 |
</p> |
| 728 |
</td> |
| 729 |
<td> |
| 730 |
<p> |
| 731 |
<span class="blue">Max = 0.536ε (Mean = 0.00658ε)</span><br> |
| 732 |
<br> (<span class="emphasis"><em>GSL 2.1:</em></span> Max = 2.89ε (Mean = 0.749ε)) |
| 733 |
</p> |
| 734 |
</td> |
| 735 |
<td> |
| 736 |
<p> |
| 737 |
<span class="blue">Max = 1.95ε (Mean = 0.418ε)</span> |
| 738 |
</p> |
| 739 |
</td> |
| 740 |
<td> |
| 741 |
<p> |
| 742 |
<span class="blue">Max = 1.21ε (Mean = 0.394ε)</span> |
| 743 |
</p> |
| 744 |
</td> |
| 745 |
</tr> |
| 746 |
<tr> |
| 747 |
<td> |
| 748 |
<p> |
| 749 |
RF: x = 0, y = z |
| 750 |
</p> |
| 751 |
</td> |
| 752 |
<td> |
| 753 |
<p> |
| 754 |
<span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL |
| 755 |
2.1:</em></span> Max = 1.29ε (Mean = 0.527ε)) |
| 756 |
</p> |
| 757 |
</td> |
| 758 |
<td> |
| 759 |
<p> |
| 760 |
<span class="blue">Max = 0.894ε (Mean = 0.338ε)</span> |
| 761 |
</p> |
| 762 |
</td> |
| 763 |
<td> |
| 764 |
<p> |
| 765 |
<span class="blue">Max = 0.999ε (Mean = 0.407ε)</span> |
| 766 |
</p> |
| 767 |
</td> |
| 768 |
</tr> |
| 769 |
<tr> |
| 770 |
<td> |
| 771 |
<p> |
| 772 |
RF: z = 0 |
| 773 |
</p> |
| 774 |
</td> |
| 775 |
<td> |
| 776 |
<p> |
| 777 |
<span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL |
| 778 |
2.1:</em></span> Max = 2.54ε (Mean = 0.781ε)) |
| 779 |
</p> |
| 780 |
</td> |
| 781 |
<td> |
| 782 |
<p> |
| 783 |
<span class="blue">Max = 1.7ε (Mean = 0.539ε)</span> |
| 784 |
</p> |
| 785 |
</td> |
| 786 |
<td> |
| 787 |
<p> |
| 788 |
<span class="blue">Max = 1.89ε (Mean = 0.587ε)</span> |
| 789 |
</p> |
| 790 |
</td> |
| 791 |
</tr> |
| 792 |
</tbody> |
| 793 |
</table></div> |
| 794 |
</div> |
| 795 |
<br class="table-break"><div class="table"> |
| 796 |
<a name="math_toolkit.ellint.ellint_carlson.table_ellint_rj"></a><p class="title"><b>Table 8.62. Error rates for ellint_rj</b></p> |
| 797 |
<div class="table-contents"><table class="table" summary="Error rates for ellint_rj"> |
| 798 |
<colgroup> |
| 799 |
<col> |
| 800 |
<col> |
| 801 |
<col> |
| 802 |
<col> |
| 803 |
</colgroup> |
| 804 |
<thead><tr> |
| 805 |
<th> |
| 806 |
</th> |
| 807 |
<th> |
| 808 |
<p> |
| 809 |
GNU C++ version 7.1.0<br> linux<br> double |
| 810 |
</p> |
| 811 |
</th> |
| 812 |
<th> |
| 813 |
<p> |
| 814 |
GNU C++ version 7.1.0<br> linux<br> long double |
| 815 |
</p> |
| 816 |
</th> |
| 817 |
<th> |
| 818 |
<p> |
| 819 |
Microsoft Visual C++ version 14.1<br> Win32<br> double |
| 820 |
</p> |
| 821 |
</th> |
| 822 |
</tr></thead> |
| 823 |
<tbody> |
| 824 |
<tr> |
| 825 |
<td> |
| 826 |
<p> |
| 827 |
RJ: Random data |
| 828 |
</p> |
| 829 |
</td> |
| 830 |
<td> |
| 831 |
<p> |
| 832 |
<span class="blue">Max = 0.52ε (Mean = 0.0184ε)</span><br> <br> |
| 833 |
(<span class="emphasis"><em>GSL 2.1:</em></span> Max = 3.57ε (Mean = 0.704ε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_7_1_0_linux_double_ellint_rj_GSL_2_1_RJ_Random_data">And |
| 834 |
other failures.</a>) |
| 835 |
</p> |
| 836 |
</td> |
| 837 |
<td> |
| 838 |
<p> |
| 839 |
<span class="blue">Max = 186ε (Mean = 6.67ε)</span> |
| 840 |
</p> |
| 841 |
</td> |
| 842 |
<td> |
| 843 |
<p> |
| 844 |
<span class="blue">Max = 215ε (Mean = 7.66ε)</span> |
| 845 |
</p> |
| 846 |
</td> |
| 847 |
</tr> |
| 848 |
<tr> |
| 849 |
<td> |
| 850 |
<p> |
| 851 |
RJ: 4 Equal Values |
| 852 |
</p> |
| 853 |
</td> |
| 854 |
<td> |
| 855 |
<p> |
| 856 |
<span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL |
| 857 |
2.1:</em></span> Max = 1.03ε (Mean = 0.418ε)) |
| 858 |
</p> |
| 859 |
</td> |
| 860 |
<td> |
| 861 |
<p> |
| 862 |
<span class="blue">Max = 0.998ε (Mean = 0.387ε)</span> |
| 863 |
</p> |
| 864 |
</td> |
| 865 |
<td> |
| 866 |
<p> |
| 867 |
<span class="blue">Max = 1.03ε (Mean = 0.418ε)</span> |
| 868 |
</p> |
| 869 |
</td> |
| 870 |
</tr> |
| 871 |
<tr> |
| 872 |
<td> |
| 873 |
<p> |
| 874 |
RJ: 3 Equal Values |
| 875 |
</p> |
| 876 |
</td> |
| 877 |
<td> |
| 878 |
<p> |
| 879 |
<span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL |
| 880 |
2.1:</em></span> Max = 3.96ε (Mean = 1.06ε)) |
| 881 |
</p> |
| 882 |
</td> |
| 883 |
<td> |
| 884 |
<p> |
| 885 |
<span class="blue">Max = 20.8ε (Mean = 0.986ε)</span> |
| 886 |
</p> |
| 887 |
</td> |
| 888 |
<td> |
| 889 |
<p> |
| 890 |
<span class="blue">Max = 39.9ε (Mean = 1.17ε)</span> |
| 891 |
</p> |
| 892 |
</td> |
| 893 |
</tr> |
| 894 |
<tr> |
| 895 |
<td> |
| 896 |
<p> |
| 897 |
RJ: 2 Equal Values |
| 898 |
</p> |
| 899 |
</td> |
| 900 |
<td> |
| 901 |
<p> |
| 902 |
<span class="blue">Max = 0.6ε (Mean = 0.0228ε)</span><br> <br> |
| 903 |
(<span class="emphasis"><em>GSL 2.1:</em></span> Max = 2.57ε (Mean = 0.754ε)) |
| 904 |
</p> |
| 905 |
</td> |
| 906 |
<td> |
| 907 |
<p> |
| 908 |
<span class="blue">Max = 220ε (Mean = 6.64ε)</span> |
| 909 |
</p> |
| 910 |
</td> |
| 911 |
<td> |
| 912 |
<p> |
| 913 |
<span class="blue">Max = 214ε (Mean = 5.28ε)</span> |
| 914 |
</p> |
| 915 |
</td> |
| 916 |
</tr> |
| 917 |
<tr> |
| 918 |
<td> |
| 919 |
<p> |
| 920 |
RJ: Equal z and p |
| 921 |
</p> |
| 922 |
</td> |
| 923 |
<td> |
| 924 |
<p> |
| 925 |
<span class="blue">Max = 0.742ε (Mean = 0.0166ε)</span><br> |
| 926 |
<br> (<span class="emphasis"><em>GSL 2.1:</em></span> Max = 2.62ε (Mean = 0.699ε)) |
| 927 |
</p> |
| 928 |
</td> |
| 929 |
<td> |
| 930 |
<p> |
| 931 |
<span class="blue">Max = 17.2ε (Mean = 1.16ε)</span> |
| 932 |
</p> |
| 933 |
</td> |
| 934 |
<td> |
| 935 |
<p> |
| 936 |
<span class="blue">Max = 16.1ε (Mean = 1.14ε)</span> |
| 937 |
</p> |
| 938 |
</td> |
| 939 |
</tr> |
| 940 |
</tbody> |
| 941 |
</table></div> |
| 942 |
</div> |
| 943 |
<br class="table-break"><h5> |
| 944 |
<a name="math_toolkit.ellint.ellint_carlson.h4"></a> |
| 945 |
<span class="phrase"><a name="math_toolkit.ellint.ellint_carlson.implementation"></a></span><a class="link" href="ellint_carlson.html#math_toolkit.ellint.ellint_carlson.implementation">Implementation</a> |
| 946 |
</h5> |
| 947 |
<p> |
| 948 |
The key of Carlson's algorithm [<a class="link" href="ellint_intro.html#ellint_ref_carlson79">Carlson79</a>] |
| 949 |
is the duplication theorem: |
| 950 |
</p> |
| 951 |
<div class="blockquote"><blockquote class="blockquote"><p> |
| 952 |
<span class="inlinemediaobject"><img src="../../../equations/ellint13.svg"></span> |
| 953 |
|
| 954 |
</p></blockquote></div> |
| 955 |
<p> |
| 956 |
By applying it repeatedly, <span class="emphasis"><em>x</em></span>, <span class="emphasis"><em>y</em></span>, |
| 957 |
<span class="emphasis"><em>z</em></span> get closer and closer. When they are nearly equal, |
| 958 |
the special case equation |
| 959 |
</p> |
| 960 |
<div class="blockquote"><blockquote class="blockquote"><p> |
| 961 |
<span class="inlinemediaobject"><img src="../../../equations/ellint16.svg"></span> |
| 962 |
|
| 963 |
</p></blockquote></div> |
| 964 |
<p> |
| 965 |
is used. More specifically, <span class="emphasis"><em>[R F]</em></span> is evaluated from |
| 966 |
a Taylor series expansion to the fifth order. The calculations of the other |
| 967 |
three integrals are analogous, except for R<sub>C</sub> which can be computed from elementary |
| 968 |
functions. |
| 969 |
</p> |
| 970 |
<p> |
| 971 |
For <span class="emphasis"><em>p < 0</em></span> in <span class="emphasis"><em>R<sub>J</sub>(x, y, z, p)</em></span> |
| 972 |
and <span class="emphasis"><em>y < 0</em></span> in <span class="emphasis"><em>R<sub>C</sub>(x, y)</em></span>, the integrals |
| 973 |
are singular and their <a href="http://mathworld.wolfram.com/CauchyPrincipalValue.html" target="_top">Cauchy |
| 974 |
principal values</a> are returned via the relations: |
| 975 |
</p> |
| 976 |
<div class="blockquote"><blockquote class="blockquote"><p> |
| 977 |
<span class="inlinemediaobject"><img src="../../../equations/ellint17.svg"></span> |
| 978 |
|
| 979 |
</p></blockquote></div> |
| 980 |
<div class="blockquote"><blockquote class="blockquote"><p> |
| 981 |
<span class="inlinemediaobject"><img src="../../../equations/ellint18.svg"></span> |
| 982 |
|
| 983 |
</p></blockquote></div> |
| 984 |
</div> |
| 985 |
<div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland, |
| 986 |
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno |
| 987 |
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde, |
| 988 |
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle |
| 989 |
Walker and Xiaogang Zhang<p> |
| 990 |
Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 991 |
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>) |
| 992 |
</p> |
| 993 |
</div> |
| 994 |
<hr> |
| 995 |
<div class="spirit-nav"> |
| 996 |
<a accesskey="p" href="ellint_intro.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ellint.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="ellint_1.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> |
| 997 |
</div> |
| 998 |
</body> |
| 999 |
</html> |