[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

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>cbrt</title>
<link rel="stylesheet" href="../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../powers.html" title="Basic Functions">
<link rel="prev" href="expm1.html" title="expm1">
<link rel="next" href="sqrt1pm1.html" title="sqrt1pm1">
@@ -33,13 +33,13 @@
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</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">cbrt</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</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> <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><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">cbrt</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><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> <a class="link" href="../../policy.html" title="Chapter 21. Policies: Controlling Precision, Error Handling etc">Policy</a><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">cbrt</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter 21. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&amp;);</span>
<span class="special">}}</span> <span class="comment">// namespaces</span>
</pre>
<p>
Returns the cubed root of x: x<sup>1/3</sup>.
Returns the cubed root of x: x<sup>1/3</sup> or ∛x.
</p>
<p>
The return type of this function is computed using the <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>result
@@ -47,9 +47,9 @@
when <span class="emphasis"><em>x</em></span> is an integer type and T otherwise.
</p>
<p>
The final <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can
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&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">policy
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>
@@ -58,9 +58,10 @@
<p>
The following graph illustrates the behaviour of cbrt:
</p>
<p>
<span class="inlinemediaobject"><img src="../../../graphs/cbrt.svg" align="middle"></span>
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/cbrt.svg" align="middle"></span>
</p></blockquote></div>
<h5>
<a name="math_toolkit.powers.cbrt.h0"></a>
<span class="phrase"><a name="math_toolkit.powers.cbrt.accuracy"></a></span><a class="link" href="cbrt.html#math_toolkit.powers.cbrt.accuracy">Accuracy</a>
@@ -70,7 +71,7 @@
should have approximately 2 epsilon accuracy.
</p>
<div class="table">
<a name="math_toolkit.powers.cbrt.table_cbrt"></a><p class="title"><b>Table&#160;6.80.&#160;Error rates for cbrt</b></p>
<a name="math_toolkit.powers.cbrt.table_cbrt"></a><p class="title"><b>Table 8.83. Error rates for cbrt</b></p>
<div class="table-contents"><table class="table" summary="Error rates for cbrt">
<colgroup>
<col>
@@ -84,22 +85,22 @@
</th>
<th>
<p>
Microsoft Visual C++ version 12.0<br> Win32<br> double
GNU C++ version 7.1.0<br> linux<br> double
</p>
</th>
<th>
<p>
GNU C++ version 5.1.0<br> linux<br> double
GNU C++ version 7.1.0<br> linux<br> long double
</p>
</th>
<th>
<p>
GNU C++ version 5.1.0<br> linux<br> long double
Sun compiler version 0x5150<br> Sun Solaris<br> long double
</p>
</th>
<th>
<p>
Sun compiler version 0x5130<br> Sun Solaris<br> long double
Microsoft Visual C++ version 14.1<br> Win32<br> double
</p>
</th>
</tr></thead>
@@ -111,27 +112,26 @@
</td>
<td>
<p>
<span class="blue">Max = 1.7&#949; (Mean = 0.565&#949;)</span><br> <br>
(<span class="emphasis"><em>&lt;math.h&gt;:</em></span> Max = 1.7&#949; (Mean = 0.565&#949;))
<span class="blue">Max = 0ε (Mean = 0ε)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 0&#949; (Mean = 0&#949;)</span><br> <br> (<span class="emphasis"><em>Cephes:</em></span>
Max = 0&#949; (Mean = 0&#949;))
<span class="blue">Max = 1.34ε (Mean = 0.471ε)</span><br> <br>
(<span class="emphasis"><em>&lt;cmath&gt;:</em></span> Max = 1.34ε (Mean = 0.471ε))<br>
(<span class="emphasis"><em>&lt;math.h&gt;:</em></span> Max = 1.34ε (Mean = 0.471ε))
</p>
</td>
<td>
<p>
<span class="blue">Max = 1.34&#949; (Mean = 0.471&#949;)</span><br> <br>
(<span class="emphasis"><em>&lt;tr1/cmath&gt;:</em></span> Max = 1.34&#949; (Mean = 0.471&#949;))<br>
(<span class="emphasis"><em>&lt;math.h&gt;:</em></span> Max = 1.34&#949; (Mean = 0.471&#949;))
<span class="blue">Max = 1.34ε (Mean = 0.471ε)</span><br> <br>
(<span class="emphasis"><em>&lt;math.h&gt;:</em></span> Max = 1.34ε (Mean = 0.471ε))
</p>
</td>
<td>
<p>
<span class="blue">Max = 1.11&#949; (Mean = 0.424&#949;)</span><br> <br>
(<span class="emphasis"><em>&lt;math.h&gt;:</em></span> Max = 1.11&#949; (Mean = 0.424&#949;))
<span class="blue">Max = 1. (Mean = 0.565ε)</span><br> <br>
(<span class="emphasis"><em>&lt;math.h&gt;:</em></span> Max = 1. (Mean = 0.565ε))
</p>
</td>
</tr></tbody>
@@ -148,11 +148,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<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>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>cos_pi</title>
<link rel="stylesheet" href="../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../powers.html" title="Basic Functions">
<link rel="prev" href="sin_pi.html" title="sin_pi">
<link rel="next" href="log1p.html" title="log1p">
@@ -33,13 +33,13 @@
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</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">cos_pi</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</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> <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><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">cos_pi</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><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> <a class="link" href="../../policy.html" title="Chapter 21. Policies: Controlling Precision, Error Handling etc">Policy</a><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">cos_pi</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter 21. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&amp;);</span>
<span class="special">}}</span> <span class="comment">// namespaces</span>
</pre>
<p>
Returns the cosine of <span class="emphasis"><em>&#960;x</em></span>.
Returns the cosine of <span class="emphasis"><em>π x</em></span>.
</p>
<p>
The return type of this function is computed using the <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>result
@@ -47,17 +47,17 @@
when <span class="emphasis"><em>x</em></span> is an integer type and T otherwise.
</p>
<p>
The final <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can
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&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">policy
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>
This function performs exact all-integer arithmetic argument reduction before
computing the cosine of <span class="emphasis"><em>&#960;x</em></span>.
computing the cosine of <span class="emphasis"><em>π·x</em></span>.
</p>
<div class="table">
<a name="math_toolkit.powers.cos_pi.table_cos_pi"></a><p class="title"><b>Table&#160;6.77.&#160;Error rates for cos_pi</b></p>
<a name="math_toolkit.powers.cos_pi.table_cos_pi"></a><p class="title"><b>Table 8.80. Error rates for cos_pi</b></p>
<div class="table-contents"><table class="table" summary="Error rates for cos_pi">
<colgroup>
<col>
@@ -71,22 +71,22 @@
</th>
<th>
<p>
Microsoft Visual C++ version 12.0<br> Win32<br> double
GNU C++ version 7.1.0<br> linux<br> double
</p>
</th>
<th>
<p>
GNU C++ version 5.1.0<br> linux<br> double
GNU C++ version 7.1.0<br> linux<br> long double
</p>
</th>
<th>
<p>
GNU C++ version 5.1.0<br> linux<br> long double
Sun compiler version 0x5150<br> Sun Solaris<br> long double
</p>
</th>
<th>
<p>
Sun compiler version 0x5130<br> Sun Solaris<br> long double
Microsoft Visual C++ version 14.1<br> Win32<br> double
</p>
</th>
</tr></thead>
@@ -99,22 +99,22 @@
</td>
<td>
<p>
<span class="blue">Max = 0.996&#949; (Mean = 0.281&#949;)</span>
<span class="blue">Max = 0ε (Mean = 0ε)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 0&#949; (Mean = 0&#949;)</span>
<span class="blue">Max = 0.991ε (Mean = 0.302ε)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 0.991&#949; (Mean = 0.302&#949;)</span>
<span class="blue">Max = 0.991ε (Mean = 0.302ε)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 0.991&#949; (Mean = 0.302&#949;)</span>
<span class="blue">Max = 0.99 (Mean = 0.284ε)</span>
</p>
</td>
</tr>
@@ -126,22 +126,22 @@
</td>
<td>
<p>
<span class="blue">Max = 0.996&#949; (Mean = 0.298&#949;)</span>
<span class="blue">Max = 0ε (Mean = 0ε)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 0&#949; (Mean = 0&#949;)</span>
<span class="blue">Max = 0.976ε (Mean = 0.28ε)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 0.976&#949; (Mean = 0.28&#949;)</span>
<span class="blue">Max = 0.976ε (Mean = 0.28ε)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 0.976&#949; (Mean = 0.28&#949;)</span>
<span class="blue">Max = 0.996ε (Mean = 0.298ε)</span>
</p>
</td>
</tr>
@@ -152,11 +152,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<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>

View File

@@ -1,13 +1,13 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Compile Time Power of a Runtime Base</title>
<link rel="stylesheet" href="../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../powers.html" title="Basic Functions">
<link rel="prev" href="hypot.html" title="hypot">
<link rel="next" href="../sinc.html" title="Sinus Cardinal and Hyperbolic Sinus Cardinal Functions">
<link rel="next" href="rsqrt.html" title="Reciprocal square root">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="hypot.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../powers.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="../sinc.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
<a accesskey="p" href="hypot.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../powers.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="rsqrt.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
@@ -41,10 +41,10 @@
<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">int</span> <span class="identifier">N</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T</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">pow</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">base</span><span class="special">);</span>
<span class="keyword">constexpr</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">pow</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">base</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">int</span> <span class="identifier">N</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T</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">pow</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">base</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Policy</span><span class="special">&amp;</span> <span class="identifier">policy</span><span class="special">);</span>
<span class="keyword">constexpr</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">pow</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">base</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Policy</span><span class="special">&amp;</span> <span class="identifier">policy</span><span class="special">);</span>
<span class="special">}}</span>
</pre>
@@ -70,8 +70,9 @@
non-optimal in terms of performance.
</p>
<p>
The pow function of Boost.Math helps writing this kind expression along with
solving all the problems listed above:
The <code class="computeroutput"><span class="identifier">pow</span></code> function of Boost.Math
helps writing this kind expression along with solving all the problems listed
above:
</p>
<pre class="programlisting"><span class="comment">// 8th power of a 'base' variable using math::pow</span>
<span class="keyword">double</span> <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">pow</span><span class="special">&lt;</span><span class="number">8</span><span class="special">&gt;(</span><span class="identifier">base</span><span class="special">);</span>
@@ -113,16 +114,24 @@
</ul></div>
<h5>
<a name="math_toolkit.powers.ct_pow.h3"></a>
<span class="phrase"><a name="math_toolkit.powers.ct_pow.policies"></a></span><a class="link" href="ct_pow.html#math_toolkit.powers.ct_pow.policies">Policies</a>
<span class="phrase"><a name="math_toolkit.powers.ct_pow.constexpr"></a></span><a class="link" href="ct_pow.html#math_toolkit.powers.ct_pow.constexpr">constexpr</a>
</h5>
<p>
The final <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can
be used to control the behaviour of the function: how it handles errors,
what level of precision to use etc. Refer to the <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">policy
documentation for more details</a>.
This function is usable in <code class="computeroutput"><span class="keyword">constexpr</span></code>
contexts from C++14 onwards.
</p>
<h5>
<a name="math_toolkit.powers.ct_pow.h4"></a>
<span class="phrase"><a name="math_toolkit.powers.ct_pow.policies"></a></span><a class="link" href="ct_pow.html#math_toolkit.powers.ct_pow.policies">Policies</a>
</h5>
<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.powers.ct_pow.h5"></a>
<span class="phrase"><a name="math_toolkit.powers.ct_pow.error_handling"></a></span><a class="link" href="ct_pow.html#math_toolkit.powers.ct_pow.error_handling">Error
Handling</a>
</h5>
@@ -227,18 +236,18 @@
<span class="keyword">double</span> <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">pow</span><span class="special">&lt;-</span><span class="number">5</span><span class="special">&gt;(</span><span class="identifier">base</span><span class="special">);</span>
</pre>
<h5>
<a name="math_toolkit.powers.ct_pow.h5"></a>
<a name="math_toolkit.powers.ct_pow.h6"></a>
<span class="phrase"><a name="math_toolkit.powers.ct_pow.acknowledgements"></a></span><a class="link" href="ct_pow.html#math_toolkit.powers.ct_pow.acknowledgements">Acknowledgements</a>
</h5>
<p>
Bruno Lalande submitted this addition to Boost.Math.
</p>
<p>
Thanks to Joaqu&#237;n L&#243;pez Mu&#241;oz and Scott McMurray for their help in
Thanks to Joaquín López Muñoz and Scott McMurray for their help in
improving the implementation.
</p>
<h5>
<a name="math_toolkit.powers.ct_pow.h6"></a>
<a name="math_toolkit.powers.ct_pow.h7"></a>
<span class="phrase"><a name="math_toolkit.powers.ct_pow.references"></a></span><a class="link" href="ct_pow.html#math_toolkit.powers.ct_pow.references">References</a>
</h5>
<p>
@@ -248,11 +257,11 @@ improving the implementation.
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<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>
@@ -260,7 +269,7 @@ improving the implementation.
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="hypot.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../powers.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="../sinc.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
<a accesskey="p" href="hypot.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../powers.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="rsqrt.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>expm1</title>
<link rel="stylesheet" href="../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../powers.html" title="Basic Functions">
<link rel="prev" href="log1p.html" title="log1p">
<link rel="next" href="cbrt.html" title="cbrt">
@@ -33,8 +33,8 @@
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</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">expm1</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</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> <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><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">expm1</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><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> <a class="link" href="../../policy.html" title="Chapter 21. Policies: Controlling Precision, Error Handling etc">Policy</a><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">expm1</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter 21. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&amp;);</span>
<span class="special">}}</span> <span class="comment">// namespaces</span>
</pre>
@@ -47,17 +47,17 @@
when <span class="emphasis"><em>x</em></span> is an integer type and T otherwise.
</p>
<p>
The final <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can
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&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">policy
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>
For small x, then <code class="computeroutput">e<sup>x</sup></code> is very close to 1, as a result calculating <code class="computeroutput">e<sup>x</sup> - 1</code> results in
catastrophic cancellation errors when x is small. <code class="computeroutput"><span class="identifier">expm1</span></code>
calculates <code class="computeroutput">e<sup>x</sup> - 1</code> using rational approximations (for up to 128-bit long doubles),
otherwise via a series expansion when x is small (giving an accuracy of less
than 2&#603;).
For small <span class="emphasis"><em>x</em></span>, then <code class="computeroutput">e<sup>x</sup></code> is very close to 1, as a result calculating
<code class="computeroutput">e<sup>x</sup> - 1</code> results in catastrophic cancellation errors when <span class="emphasis"><em>x</em></span> is
small. <code class="computeroutput"><span class="identifier">expm1</span></code> calculates <code class="computeroutput">e<sup>x</sup> - 1</code> using
rational approximations (for up to 128-bit long doubles), otherwise via a
series expansion when x is small (giving an accuracy of less than 2ɛ).
</p>
<p>
Finally when BOOST_HAS_EXPM1 is defined then the <code class="computeroutput"><span class="keyword">float</span><span class="special">/</span><span class="keyword">double</span><span class="special">/</span><span class="keyword">long</span> <span class="keyword">double</span></code>
@@ -67,9 +67,10 @@
<p>
The following graph illustrates the behaviour of expm1:
</p>
<p>
<span class="inlinemediaobject"><img src="../../../graphs/expm1.svg" align="middle"></span>
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/expm1.svg" align="middle"></span>
</p></blockquote></div>
<h5>
<a name="math_toolkit.powers.expm1.h0"></a>
<span class="phrase"><a name="math_toolkit.powers.expm1.accuracy"></a></span><a class="link" href="expm1.html#math_toolkit.powers.expm1.accuracy">Accuracy</a>
@@ -79,7 +80,7 @@
should have approximately 1 epsilon accuracy.
</p>
<div class="table">
<a name="math_toolkit.powers.expm1.table_expm1"></a><p class="title"><b>Table&#160;6.79.&#160;Error rates for expm1</b></p>
<a name="math_toolkit.powers.expm1.table_expm1"></a><p class="title"><b>Table 8.82. Error rates for expm1</b></p>
<div class="table-contents"><table class="table" summary="Error rates for expm1">
<colgroup>
<col>
@@ -93,22 +94,22 @@
</th>
<th>
<p>
Microsoft Visual C++ version 12.0<br> Win32<br> double
GNU C++ version 7.1.0<br> linux<br> long double
</p>
</th>
<th>
<p>
GNU C++ version 5.1.0<br> linux<br> double
GNU C++ version 7.1.0<br> linux<br> double
</p>
</th>
<th>
<p>
GNU C++ version 5.1.0<br> linux<br> long double
Sun compiler version 0x5150<br> Sun Solaris<br> long double
</p>
</th>
<th>
<p>
Sun compiler version 0x5130<br> Sun Solaris<br> long double
Microsoft Visual C++ version 14.1<br> Win32<br> double
</p>
</th>
</tr></thead>
@@ -120,30 +121,27 @@
</td>
<td>
<p>
<span class="blue">Max = 0.996&#949; (Mean = 0.283&#949;)</span><br> <br>
(<span class="emphasis"><em>&lt;math.h&gt;:</em></span> Max = 1.31&#949; (Mean = 0.496&#949;))
<span class="blue">Max = 0.99 (Mean = 0.402ε)</span><br> <br>
(<span class="emphasis"><em>&lt;cmath&gt;:</em></span> Max = 0.992ε (Mean = 0.402ε))<br>
(<span class="emphasis"><em>&lt;math.h&gt;:</em></span> Max = 0.992ε (Mean = 0.402ε))
</p>
</td>
<td>
<p>
<span class="blue">Max = 0.793&#949; (Mean = 0.126&#949;)</span><br> <br>
(<span class="emphasis"><em>Rmath 3.0.2:</em></span> Max = 0.793&#949; (Mean = 0.126&#949;))<br>
(<span class="emphasis"><em>Cephes:</em></span> Max = 1.53&#949; (Mean = 0.535&#949;))
<span class="blue">Max = 0.793ε (Mean = 0.126ε)</span><br> <br>
(<span class="emphasis"><em>Rmath 3.2.3:</em></span> Max = 0.793ε (Mean = 0.126ε))
</p>
</td>
<td>
<p>
<span class="blue">Max = 0.992&#949; (Mean = 0.402&#949;)</span><br> <br>
(<span class="emphasis"><em>&lt;tr1/cmath&gt;:</em></span> <span class="red">Max
= 1.26e+19&#949; (Mean = 4.89e+18&#949;) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_long_double_expm1__tr1_cmath__Random_test_data">And
other failures.</a>)</span><br> (<span class="emphasis"><em>&lt;math.h&gt;:</em></span>
Max = 0.992&#949; (Mean = 0.402&#949;))
<span class="blue">Max = 1.31ε (Mean = 0.428ε)</span><br> <br>
(<span class="emphasis"><em>&lt;math.h&gt;:</em></span> Max = 0.996ε (Mean = 0.426ε))
</p>
</td>
<td>
<p>
<span class="blue">Max = 1.31&#949; (Mean = 0.406&#949;)</span><br> <br>
(<span class="emphasis"><em>&lt;math.h&gt;:</em></span> Max = 0.996&#949; (Mean = 0.426&#949;))
<span class="blue">Max = 1.31ε (Mean = 0.496ε)</span><br> <br>
(<span class="emphasis"><em>&lt;math.h&gt;:</em></span> Max = 1.31ε (Mean = 0.496ε))
</p>
</td>
</tr></tbody>
@@ -160,11 +158,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<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>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>hypot</title>
<link rel="stylesheet" href="../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../powers.html" title="Basic Functions">
<link rel="prev" href="powm1.html" title="powm1">
<link rel="next" href="ct_pow.html" title="Compile Time Power of a Runtime Base">
@@ -29,13 +29,18 @@
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</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">&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">hypot</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">template</span> <span class="special">&lt;</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&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><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">hypot</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&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&amp;);</span>
<span class="keyword">template</span> <span class="special">&lt;</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 21. Policies: Controlling Precision, Error Handling etc">Policy</a><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">hypot</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 21. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&amp;);</span>
</pre>
<p>
<span class="bold"><strong>Effects: </strong></span> computes <span class="inlinemediaobject"><img src="../../../equations/hypot.svg"></span>
in such a way
as to avoid undue underflow and overflow.
<span class="bold"><strong>Effects: </strong></span> computes
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/hypot.svg"></span>
</p></blockquote></div>
<p>
in such a way as to avoid undue underflow and overflow.
</p>
<p>
The return type of this function is computed using the <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>result
@@ -43,42 +48,49 @@ in such a way
types.
</p>
<p>
The final <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can
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&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">policy
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>
When calculating <span class="inlinemediaobject"><img src="../../../equations/hypot.svg"></span> it's quite easy for the intermediate terms to
either overflow or underflow, even though the result is in fact perfectly
representable.
When calculating
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/hypot.svg"></span>
</p></blockquote></div>
<p>
it's quite easy for the intermediate terms to either overflow or underflow,
even though the result is in fact perfectly representable.
</p>
<h5>
<a name="math_toolkit.powers.hypot.h0"></a>
<span class="phrase"><a name="math_toolkit.powers.hypot.implementation"></a></span><a class="link" href="hypot.html#math_toolkit.powers.hypot.implementation">Implementation</a>
</h5>
<p>
The function is even and symmetric in x and y, so first take assume <span class="emphasis"><em>x,y
&gt; 0</em></span> and <span class="emphasis"><em>x &gt; y</em></span> (we can permute the arguments
if this is not the case).
The function is even and symmetric in <span class="emphasis"><em>x</em></span> and <span class="emphasis"><em>y</em></span>,
so first take assume <span class="emphasis"><em>x,y &gt; 0</em></span> and <span class="emphasis"><em>x &gt;
y</em></span> (we can permute the arguments if this is not the case).
</p>
<p>
Then if <span class="emphasis"><em>x * &#949; &#160; &gt;= y</em></span> we can simply return <span class="emphasis"><em>x</em></span>.
Then if <span class="emphasis"><em>x * ε &gt;= y</em></span> we can simply return <span class="emphasis"><em>x</em></span>.
</p>
<p>
Otherwise the result is given by:
</p>
<p>
<span class="inlinemediaobject"><img src="../../../equations/hypot2.svg"></span>
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../equations/hypot2.svg"></span>
</p></blockquote></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 &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<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>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>log1p</title>
<link rel="stylesheet" href="../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../powers.html" title="Basic Functions">
<link rel="prev" href="cos_pi.html" title="cos_pi">
<link rel="next" href="expm1.html" title="expm1">
@@ -33,13 +33,13 @@
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</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">log1p</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</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> <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><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">log1p</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><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> <a class="link" href="../../policy.html" title="Chapter 21. Policies: Controlling Precision, Error Handling etc">Policy</a><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">log1p</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter 21. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&amp;);</span>
<span class="special">}}</span> <span class="comment">// namespaces</span>
</pre>
<p>
Returns the natural logarithm of <code class="computeroutput"><span class="identifier">x</span><span class="special">+</span><span class="number">1</span></code>.
Returns the natural logarithm of <span class="emphasis"><em>x+1</em></span>.
</p>
<p>
The return type of this function is computed using the <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>result
@@ -47,25 +47,25 @@
when <span class="emphasis"><em>x</em></span> is an integer type and T otherwise.
</p>
<p>
The final <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can
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&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">policy
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>
There are many situations where it is desirable to compute <code class="computeroutput"><span class="identifier">log</span><span class="special">(</span><span class="identifier">x</span><span class="special">+</span><span class="number">1</span><span class="special">)</span></code>.
However, for small <code class="computeroutput"><span class="identifier">x</span></code> then
<code class="computeroutput"><span class="identifier">x</span><span class="special">+</span><span class="number">1</span></code> suffers from catastrophic cancellation errors
so that <code class="computeroutput"><span class="identifier">x</span><span class="special">+</span><span class="number">1</span> <span class="special">==</span> <span class="number">1</span></code>
and <code class="computeroutput"><span class="identifier">log</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="special">==</span> <span class="number">0</span></code>,
when in fact for very small x, the best approximation to <code class="computeroutput"><span class="identifier">log</span><span class="special">(</span><span class="identifier">x</span><span class="special">+</span><span class="number">1</span><span class="special">)</span></code> would be
<code class="computeroutput"><span class="identifier">x</span></code>. <code class="computeroutput"><span class="identifier">log1p</span></code>
calculates the best approximation to <code class="computeroutput"><span class="identifier">log</span><span class="special">(</span><span class="number">1</span><span class="special">+</span><span class="identifier">x</span><span class="special">)</span></code> using
a Taylor series expansion for accuracy (less than 2&#603;). Alternatively note that
there are faster methods available, for example using the equivalence:
However, for small <span class="emphasis"><em>x</em></span> then <span class="emphasis"><em>x+1</em></span> suffers
from catastrophic cancellation errors so that <span class="emphasis"><em>x+1 == 1</em></span>
and <span class="emphasis"><em>log(x+1) == 0</em></span>, when in fact for very small x, the
best approximation to <span class="emphasis"><em>log(x+1)</em></span> would be <span class="emphasis"><em>x</em></span>.
<code class="computeroutput"><span class="identifier">log1p</span></code> calculates the best
approximation to <code class="computeroutput"><span class="identifier">log</span><span class="special">(</span><span class="number">1</span><span class="special">+</span><span class="identifier">x</span><span class="special">)</span></code> using a Taylor series expansion for accuracy
(less than 2ɛ). Alternatively note that there are faster methods available,
for example using the equivalence:
</p>
<pre class="programlisting"><span class="identifier">log</span><span class="special">(</span><span class="number">1</span><span class="special">+</span><span class="identifier">x</span><span class="special">)</span> <span class="special">==</span> <span class="special">(</span><span class="identifier">log</span><span class="special">(</span><span class="number">1</span><span class="special">+</span><span class="identifier">x</span><span class="special">)</span> <span class="special">*</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">/</span> <span class="special">((</span><span class="number">1</span><span class="special">+</span><span class="identifier">x</span><span class="special">)</span> <span class="special">-</span> <span class="number">1</span><span class="special">)</span>
</pre>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="emphasis"><em>log(1+x) == (log(1+x) * x) / ((1+x) - 1)</em></span>
</p></blockquote></div>
<p>
However, experience has shown that these methods tend to fail quite spectacularly
once the compiler's optimizations are turned on, consequently they are used
@@ -74,26 +74,28 @@
errors.
</p>
<p>
Finally when BOOST_HAS_LOG1P is defined then the <code class="computeroutput"><span class="keyword">float</span><span class="special">/</span><span class="keyword">double</span><span class="special">/</span><span class="keyword">long</span> <span class="keyword">double</span></code>
Finally when macro BOOST_HAS_LOG1P is defined then the <code class="computeroutput"><span class="keyword">float</span><span class="special">/</span><span class="keyword">double</span><span class="special">/</span><span class="keyword">long</span> <span class="keyword">double</span></code>
specializations of this template simply forward to the platform's native
(POSIX) implementation of this function.
</p>
<p>
The following graph illustrates the behaviour of log1p:
</p>
<p>
<span class="inlinemediaobject"><img src="../../../graphs/log1p.svg" align="middle"></span>
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/log1p.svg" align="middle"></span>
</p></blockquote></div>
<h5>
<a name="math_toolkit.powers.log1p.h0"></a>
<span class="phrase"><a name="math_toolkit.powers.log1p.accuracy"></a></span><a class="link" href="log1p.html#math_toolkit.powers.log1p.accuracy">Accuracy</a>
</h5>
<p>
For built in floating point types <code class="computeroutput"><span class="identifier">log1p</span></code>
should have approximately 1 epsilon accuracy.
should have approximately 1 <a href="http://en.wikipedia.org/wiki/Machine_epsilon" target="_top">machine
epsilon</a> accuracy.
</p>
<div class="table">
<a name="math_toolkit.powers.log1p.table_log1p"></a><p class="title"><b>Table&#160;6.78.&#160;Error rates for log1p</b></p>
<a name="math_toolkit.powers.log1p.table_log1p"></a><p class="title"><b>Table 8.81. Error rates for log1p</b></p>
<div class="table-contents"><table class="table" summary="Error rates for log1p">
<colgroup>
<col>
@@ -107,22 +109,22 @@
</th>
<th>
<p>
Microsoft Visual C++ version 12.0<br> Win32<br> double
GNU C++ version 7.1.0<br> linux<br> long double
</p>
</th>
<th>
<p>
GNU C++ version 5.1.0<br> linux<br> double
GNU C++ version 7.1.0<br> linux<br> double
</p>
</th>
<th>
<p>
GNU C++ version 5.1.0<br> linux<br> long double
Sun compiler version 0x5150<br> Sun Solaris<br> long double
</p>
</th>
<th>
<p>
Sun compiler version 0x5130<br> Sun Solaris<br> long double
Microsoft Visual C++ version 14.1<br> Win32<br> double
</p>
</th>
</tr></thead>
@@ -134,28 +136,27 @@
</td>
<td>
<p>
<span class="blue">Max = 0.509&#949; (Mean = 0.057&#949;)</span><br> <br>
(<span class="emphasis"><em>&lt;math.h&gt;:</em></span> Max = 0.509&#949; (Mean = 0.057&#949;))
<span class="blue">Max = 0.818ε (Mean = 0.227ε)</span><br> <br>
(<span class="emphasis"><em>&lt;cmath&gt;:</em></span> Max = 0.818ε (Mean = 0.227ε))<br>
(<span class="emphasis"><em>&lt;math.h&gt;:</em></span> Max = 0.818ε (Mean = 0.227ε))
</p>
</td>
<td>
<p>
<span class="blue">Max = 0.846&#949; (Mean = 0.153&#949;)</span><br> <br>
(<span class="emphasis"><em>Rmath 3.0.2:</em></span> Max = 0.846&#949; (Mean = 0.153&#949;))<br>
(<span class="emphasis"><em>Cephes:</em></span> Max = 0.799&#949; (Mean = 0.122&#949;))
<span class="blue">Max = 0.846ε (Mean = 0.153ε)</span><br> <br>
(<span class="emphasis"><em>Rmath 3.2.3:</em></span> Max = 0.846ε (Mean = 0.153ε))
</p>
</td>
<td>
<p>
<span class="blue">Max = 0.818&#949; (Mean = 0.227&#949;)</span><br> <br>
(<span class="emphasis"><em>&lt;tr1/cmath&gt;:</em></span> Max = 0.818&#949; (Mean = 0.227&#949;))<br>
(<span class="emphasis"><em>&lt;math.h&gt;:</em></span> Max = 0.818&#949; (Mean = 0.227&#949;))
<span class="blue">Max = 2.3ε (Mean = 0.66ε)</span><br> <br>
(<span class="emphasis"><em>&lt;math.h&gt;:</em></span> Max = 0.818ε (Mean = 0.249ε))
</p>
</td>
<td>
<p>
<span class="blue">Max = 1.53&#949; (Mean = 0.627&#949;)</span><br> <br>
(<span class="emphasis"><em>&lt;math.h&gt;:</em></span> Max = 0.818&#949; (Mean = 0.249&#949;))
<span class="blue">Max = 0.509ε (Mean = 0.057ε)</span><br> <br>
(<span class="emphasis"><em>&lt;math.h&gt;:</em></span> Max = 0.509ε (Mean = 0.057ε))
</p>
</td>
</tr></tbody>
@@ -172,11 +173,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<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>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>powm1</title>
<link rel="stylesheet" href="../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../powers.html" title="Basic Functions">
<link rel="prev" href="sqrt1pm1.html" title="sqrt1pm1">
<link rel="next" href="hypot.html" title="hypot">
@@ -28,13 +28,14 @@
</h3></div></div></div>
<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">powm1</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">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">&gt;</span>
<p>
namespace boost{ namespace math{
</p>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</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">&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">powm1</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">template</span> <span class="special">&lt;</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&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><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">powm1</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&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&amp;);</span>
<span class="keyword">template</span> <span class="special">&lt;</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 21. Policies: Controlling Precision, Error Handling etc">Policy</a><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">powm1</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 21. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&amp;);</span>
<span class="special">}}</span> <span class="comment">// namespaces</span>
</pre>
@@ -43,17 +44,17 @@
</p>
<p>
The return type of this function is computed using the <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>result
type calculation rules</em></span></a> when T1 and T2 are dufferent types.
type calculation rules</em></span></a> when T1 and T2 are different types.
</p>
<p>
The final <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can
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&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">policy
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>
There are two domains where this is useful: when y is very small, or when
x is close to 1.
There are two domains where this is useful: when <span class="emphasis"><em>y</em></span> is
very small, or when <span class="emphasis"><em>x</em></span> is close to 1.
</p>
<p>
Implemented in terms of <code class="computeroutput"><span class="identifier">expm1</span></code>.
@@ -61,9 +62,10 @@
<p>
The following graph illustrates the behaviour of powm1:
</p>
<p>
<span class="inlinemediaobject"><img src="../../../graphs/powm1.svg" align="middle"></span>
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/powm1.svg" align="middle"></span>
</p></blockquote></div>
<h5>
<a name="math_toolkit.powers.powm1.h0"></a>
<span class="phrase"><a name="math_toolkit.powers.powm1.accuracy"></a></span><a class="link" href="powm1.html#math_toolkit.powers.powm1.accuracy">Accuracy</a>
@@ -72,7 +74,7 @@
Should have approximately 2-3 epsilon accuracy.
</p>
<div class="table">
<a name="math_toolkit.powers.powm1.table_powm1"></a><p class="title"><b>Table&#160;6.82.&#160;Error rates for powm1</b></p>
<a name="math_toolkit.powers.powm1.table_powm1"></a><p class="title"><b>Table 8.85. Error rates for powm1</b></p>
<div class="table-contents"><table class="table" summary="Error rates for powm1">
<colgroup>
<col>
@@ -86,22 +88,22 @@
</th>
<th>
<p>
Microsoft Visual C++ version 12.0<br> Win32<br> double
GNU C++ version 7.1.0<br> linux<br> double
</p>
</th>
<th>
<p>
GNU C++ version 5.1.0<br> linux<br> double
GNU C++ version 7.1.0<br> linux<br> long double
</p>
</th>
<th>
<p>
GNU C++ version 5.1.0<br> linux<br> long double
Sun compiler version 0x5150<br> Sun Solaris<br> long double
</p>
</th>
<th>
<p>
Sun compiler version 0x5130<br> Sun Solaris<br> long double
Microsoft Visual C++ version 14.1<br> Win32<br> double
</p>
</th>
</tr></thead>
@@ -113,22 +115,22 @@
</td>
<td>
<p>
<span class="blue">Max = 1.99&#949; (Mean = 0.461&#949;)</span>
<span class="blue">Max = 1.06ε (Mean = 0.425ε)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 1.26&#949; (Mean = 0.428&#949;)</span>
<span class="blue">Max = 2.04ε (Mean = 0.493ε)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 2.04&#949; (Mean = 0.521&#949;)</span>
<span class="blue">Max = 1.88ε (Mean = 0.49ε)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 2.14&#949; (Mean = 0.498&#949;)</span>
<span class="blue">Max = 1.84ε (Mean = 0.486ε)</span>
</p>
</td>
</tr></tbody>
@@ -145,11 +147,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<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>

View File

@@ -0,0 +1,116 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Reciprocal square root</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="../powers.html" title="Basic Functions">
<link rel="prev" href="ct_pow.html" title="Compile Time Power of a Runtime Base">
<link rel="next" href="../sinc.html" title="Sinus Cardinal and Hyperbolic Sinus Cardinal Functions">
</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="ct_pow.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../powers.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="../sinc.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.powers.rsqrt"></a><a class="link" href="rsqrt.html" title="Reciprocal square root">Reciprocal square root</a>
</h3></div></div></div>
<h5>
<a name="math_toolkit.powers.rsqrt.h0"></a>
<span class="phrase"><a name="math_toolkit.powers.rsqrt.synopsis"></a></span><a class="link" href="rsqrt.html#math_toolkit.powers.rsqrt.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">rsqrt</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</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">Real</span><span class="special">&gt;</span>
<span class="identifier">Real</span> <span class="identifier">rsqrt</span><span class="special">(</span><span class="identifier">Real</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">x</span><span class="special">);</span>
<span class="special">}</span> <span class="comment">// namespaces</span>
</pre>
<p>
The function <code class="computeroutput"><span class="identifier">rsqrt</span></code> computes
the reciprocal square root 1/√<span class="emphasis"><em>x</em></span>. Those in the game programming
community might suspect this is a fast, low precision wrapper around the
<a href="https://www.felixcloutier.com/x86/rsqrtss" target="_top">rsqrtss</a> instruction.
This is not correct: We <span class="emphasis"><em>tried</em></span> this instruction, but
found no performance benefit to using it. However, the <span class="emphasis"><em>trick</em></span>
of computing a low precision reciprocal square root and then bootstrapping
to higher precision via Newton's method <span class="emphasis"><em>does</em></span> work, but
it only yields a performance benefit for quad and higher precision. We do
of course allow you to use <code class="computeroutput"><span class="identifier">rsqrt</span></code>
for <code class="computeroutput"><span class="keyword">float</span></code>, <code class="computeroutput"><span class="keyword">double</span></code>,
and <code class="computeroutput"><span class="keyword">long</span> <span class="keyword">double</span></code>,
but be aware there is no performance benefit to doing so. However, the savings
for quad precision and higher are very significant.
</p>
<p>
The use is
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">multiprecision</span><span class="special">::</span><span class="identifier">float128</span><span class="special">;</span>
<span class="identifier">float128</span> <span class="identifier">x</span> <span class="special">=</span> <span class="number">0.1</span><span class="identifier">Q</span><span class="special">;</span>
<span class="identifier">float128</span> <span class="identifier">y</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">rsqrt</span><span class="special">(</span><span class="identifier">x</span><span class="special">);</span>
</pre>
<p>
The reciprocal square root of +∞ is zero, and the reciprocal square
root of a NaN is a NaN.
</p>
<p>
<span class="inlinemediaobject"><object type="image/svg+xml" data="../../../graphs/rsqrt_quad_0_100.svg"></object></span>
</p>
<p>
Performance:
</p>
<pre class="programlisting"><span class="identifier">Running</span> <span class="special">./</span><span class="identifier">reporting</span><span class="special">/</span><span class="identifier">performance</span><span class="special">/</span><span class="identifier">rsqrt_performance</span><span class="special">.</span><span class="identifier">x</span>
<span class="identifier">Run</span> <span class="identifier">on</span> <span class="special">(</span><span class="number">16</span> <span class="identifier">X</span> <span class="number">4300</span> <span class="identifier">MHz</span> <span class="identifier">CPU</span> <span class="identifier">s</span><span class="special">)</span>
<span class="identifier">CPU</span> <span class="identifier">Caches</span><span class="special">:</span>
<span class="identifier">L1</span> <span class="identifier">Data</span> <span class="number">32</span> <span class="identifier">KiB</span> <span class="special">(</span><span class="identifier">x8</span><span class="special">)</span>
<span class="identifier">L1</span> <span class="identifier">Instruction</span> <span class="number">32</span> <span class="identifier">KiB</span> <span class="special">(</span><span class="identifier">x8</span><span class="special">)</span>
<span class="identifier">L2</span> <span class="identifier">Unified</span> <span class="number">1024</span> <span class="identifier">KiB</span> <span class="special">(</span><span class="identifier">x8</span><span class="special">)</span>
<span class="identifier">L3</span> <span class="identifier">Unified</span> <span class="number">11264</span> <span class="identifier">KiB</span> <span class="special">(</span><span class="identifier">x1</span><span class="special">)</span>
<span class="identifier">Load</span> <span class="identifier">Average</span><span class="special">:</span> <span class="number">0.43</span><span class="special">,</span> <span class="number">0.49</span><span class="special">,</span> <span class="number">0.46</span>
<span class="special">----------------------------------------------------------------------------------</span>
<span class="identifier">Benchmark</span> <span class="identifier">Time</span> <span class="identifier">CPU</span> <span class="identifier">Iterations</span>
<span class="special">----------------------------------------------------------------------------------</span>
<span class="identifier">Rsqrt</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;</span> <span class="number">1.35</span> <span class="identifier">ns</span> <span class="number">1.35</span> <span class="identifier">ns</span> <span class="number">503364351</span>
<span class="identifier">Rsqrt</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="number">2.25</span> <span class="identifier">ns</span> <span class="number">2.25</span> <span class="identifier">ns</span> <span class="number">309753242</span>
<span class="identifier">Rsqrt</span><span class="special">&lt;</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">&gt;</span> <span class="number">2.68</span> <span class="identifier">ns</span> <span class="number">2.68</span> <span class="identifier">ns</span> <span class="number">261382652</span>
<span class="identifier">Rsqrt</span><span class="special">&lt;</span><span class="identifier">float128</span><span class="special">&gt;</span> <span class="number">182</span> <span class="identifier">ns</span> <span class="number">182</span> <span class="identifier">ns</span> <span class="number">3756956</span>
<span class="identifier">Rsqrt</span><span class="special">&lt;</span><span class="identifier">number</span><span class="special">&lt;</span><span class="identifier">mpfr_float_backend</span><span class="special">&lt;</span><span class="number">100</span><span class="special">&gt;&gt;&gt;</span> <span class="number">299</span> <span class="identifier">ns</span> <span class="number">299</span> <span class="identifier">ns</span> <span class="number">2494027</span>
<span class="identifier">Rsqrt</span><span class="special">&lt;</span><span class="identifier">number</span><span class="special">&lt;</span><span class="identifier">mpfr_float_backend</span><span class="special">&lt;</span><span class="number">200</span><span class="special">&gt;&gt;&gt;</span> <span class="number">412</span> <span class="identifier">ns</span> <span class="number">412</span> <span class="identifier">ns</span> <span class="number">1589284</span>
<span class="identifier">Rsqrt</span><span class="special">&lt;</span><span class="identifier">number</span><span class="special">&lt;</span><span class="identifier">mpfr_float_backend</span><span class="special">&lt;</span><span class="number">300</span><span class="special">&gt;&gt;&gt;</span> <span class="number">617</span> <span class="identifier">ns</span> <span class="number">617</span> <span class="identifier">ns</span> <span class="number">1067473</span>
<span class="identifier">Rsqrt</span><span class="special">&lt;</span><span class="identifier">number</span><span class="special">&lt;</span><span class="identifier">mpfr_float_backend</span><span class="special">&lt;</span><span class="number">400</span><span class="special">&gt;&gt;&gt;</span> <span class="number">812</span> <span class="identifier">ns</span> <span class="number">812</span> <span class="identifier">ns</span> <span class="number">830564</span>
<span class="identifier">Rsqrt</span><span class="special">&lt;</span><span class="identifier">number</span><span class="special">&lt;</span><span class="identifier">mpfr_float_backend</span><span class="special">&lt;</span><span class="number">1000</span><span class="special">&gt;&gt;&gt;</span> <span class="number">3183</span> <span class="identifier">ns</span> <span class="number">3183</span> <span class="identifier">ns</span> <span class="number">221079</span>
<span class="identifier">Rsqrt</span><span class="special">&lt;</span><span class="identifier">cpp_bin_float_50</span><span class="special">&gt;</span> <span class="number">4321</span> <span class="identifier">ns</span> <span class="number">4321</span> <span class="identifier">ns</span> <span class="number">163243</span>
<span class="identifier">Rsqrt</span><span class="special">&lt;</span><span class="identifier">cpp_bin_float_100</span><span class="special">&gt;</span> <span class="number">9393</span> <span class="identifier">ns</span> <span class="number">9393</span> <span class="identifier">ns</span> <span class="number">72967</span>
</pre>
</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="ct_pow.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../powers.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="../sinc.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>sin_pi</title>
<link rel="stylesheet" href="../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../powers.html" title="Basic Functions">
<link rel="prev" href="../powers.html" title="Basic Functions">
<link rel="next" href="cos_pi.html" title="cos_pi">
@@ -33,13 +33,13 @@
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</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">sin_pi</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</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> <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><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">sin_pi</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><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> <a class="link" href="../../policy.html" title="Chapter 21. Policies: Controlling Precision, Error Handling etc">Policy</a><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">sin_pi</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter 21. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&amp;);</span>
<span class="special">}}</span> <span class="comment">// namespaces</span>
</pre>
<p>
Returns the sine of <span class="emphasis"><em>&#960;x</em></span>.
Returns the sine of <span class="emphasis"><em>π x</em></span>.
</p>
<p>
The return type of this function is computed using the <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>result
@@ -47,17 +47,17 @@
when <span class="emphasis"><em>x</em></span> is an integer type and T otherwise.
</p>
<p>
The final <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can
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&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">policy
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>
This function performs exact all-integer arithmetic argument reduction before
computing the sine of <span class="emphasis"><em>&#960;x</em></span>.
computing the sine of <span class="emphasis"><em>π⋅x</em></span>.
</p>
<div class="table">
<a name="math_toolkit.powers.sin_pi.table_sin_pi"></a><p class="title"><b>Table&#160;6.76.&#160;Error rates for sin_pi</b></p>
<a name="math_toolkit.powers.sin_pi.table_sin_pi"></a><p class="title"><b>Table 8.79. Error rates for sin_pi</b></p>
<div class="table-contents"><table class="table" summary="Error rates for sin_pi">
<colgroup>
<col>
@@ -71,22 +71,22 @@
</th>
<th>
<p>
Microsoft Visual C++ version 12.0<br> Win32<br> double
GNU C++ version 7.1.0<br> linux<br> double
</p>
</th>
<th>
<p>
GNU C++ version 5.1.0<br> linux<br> double
GNU C++ version 7.1.0<br> linux<br> long double
</p>
</th>
<th>
<p>
GNU C++ version 5.1.0<br> linux<br> long double
Sun compiler version 0x5150<br> Sun Solaris<br> long double
</p>
</th>
<th>
<p>
Sun compiler version 0x5130<br> Sun Solaris<br> long double
Microsoft Visual C++ version 14.1<br> Win32<br> double
</p>
</th>
</tr></thead>
@@ -99,22 +99,22 @@
</td>
<td>
<p>
<span class="blue">Max = 0.99&#949; (Mean = 0.328&#949;)</span>
<span class="blue">Max = 0ε (Mean = 0ε)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 0&#949; (Mean = 0&#949;)</span>
<span class="blue">Max = 0.996ε (Mean = 0.335ε)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 0.996&#949; (Mean = 0.335&#949;)</span>
<span class="blue">Max = 0.996ε (Mean = 0.33)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 0.996&#949; (Mean = 0.336&#949;)</span>
<span class="blue">Max = 0.99ε (Mean = 0.328ε)</span>
</p>
</td>
</tr>
@@ -126,22 +126,22 @@
</td>
<td>
<p>
<span class="blue">Max = 0.996&#949; (Mean = 0.343&#949;)</span>
<span class="blue">Max = 0ε (Mean = 0ε)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 0&#949; (Mean = 0&#949;)</span>
<span class="blue">Max = 0.976ε (Mean = 0.293ε)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 0.976&#949; (Mean = 0.293&#949;)</span>
<span class="blue">Max = 0.976ε (Mean = 0.293ε)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 0.976&#949; (Mean = 0.293&#949;)</span>
<span class="blue">Max = 0.996ε (Mean = 0.343ε)</span>
</p>
</td>
</tr>
@@ -152,11 +152,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<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>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>sqrt1pm1</title>
<link rel="stylesheet" href="../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../powers.html" title="Basic Functions">
<link rel="prev" href="cbrt.html" title="cbrt">
<link rel="next" href="powm1.html" title="powm1">
@@ -28,13 +28,14 @@
</h3></div></div></div>
<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">sqrt1pm1</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">&gt;</span>
<p>
namespace boost{ namespace math{
</p>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</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">sqrt1pm1</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</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> <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><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">sqrt1pm1</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><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> <a class="link" href="../../policy.html" title="Chapter 21. Policies: Controlling Precision, Error Handling etc">Policy</a><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">sqrt1pm1</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter 21. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&amp;);</span>
<span class="special">}}</span> <span class="comment">// namespaces</span>
</pre>
@@ -44,17 +45,17 @@
<p>
The return type of this function is computed using the <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>result
type calculation rules</em></span></a>: the return is <code class="computeroutput"><span class="keyword">double</span></code>
when <span class="emphasis"><em>x</em></span> is an integer type and T otherwise.
when <span class="emphasis"><em>x</em></span> is an integer-type and T otherwise.
</p>
<p>
The final <a class="link" href="../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can
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&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">policy
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>
This function is useful when you need the difference between sqrt(x) and
1, when x is itself close to 1.
This function is useful when you need the difference between <code class="computeroutput"><span class="identifier">sqrt</span><span class="special">(</span><span class="identifier">x</span><span class="special">)</span></code> and 1, when <span class="emphasis"><em>x</em></span> is itself
close to 1.
</p>
<p>
Implemented in terms of <code class="computeroutput"><span class="identifier">log1p</span></code>
@@ -63,9 +64,10 @@
<p>
The following graph illustrates the behaviour of sqrt1pm1:
</p>
<p>
<span class="inlinemediaobject"><img src="../../../graphs/sqrt1pm1.svg" align="middle"></span>
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../graphs/sqrt1pm1.svg" align="middle"></span>
</p></blockquote></div>
<h5>
<a name="math_toolkit.powers.sqrt1pm1.h0"></a>
<span class="phrase"><a name="math_toolkit.powers.sqrt1pm1.accuracy"></a></span><a class="link" href="sqrt1pm1.html#math_toolkit.powers.sqrt1pm1.accuracy">Accuracy</a>
@@ -75,7 +77,7 @@
should have approximately 3 epsilon accuracy.
</p>
<div class="table">
<a name="math_toolkit.powers.sqrt1pm1.table_sqrt1pm1"></a><p class="title"><b>Table&#160;6.81.&#160;Error rates for sqrt1pm1</b></p>
<a name="math_toolkit.powers.sqrt1pm1.table_sqrt1pm1"></a><p class="title"><b>Table 8.84. Error rates for sqrt1pm1</b></p>
<div class="table-contents"><table class="table" summary="Error rates for sqrt1pm1">
<colgroup>
<col>
@@ -89,22 +91,22 @@
</th>
<th>
<p>
Microsoft Visual C++ version 12.0<br> Win32<br> double
GNU C++ version 7.1.0<br> linux<br> double
</p>
</th>
<th>
<p>
GNU C++ version 5.1.0<br> linux<br> double
GNU C++ version 7.1.0<br> linux<br> long double
</p>
</th>
<th>
<p>
GNU C++ version 5.1.0<br> linux<br> long double
Sun compiler version 0x5150<br> Sun Solaris<br> long double
</p>
</th>
<th>
<p>
Sun compiler version 0x5130<br> Sun Solaris<br> long double
Microsoft Visual C++ version 14.1<br> Win32<br> double
</p>
</th>
</tr></thead>
@@ -116,22 +118,22 @@
</td>
<td>
<p>
<span class="blue">Max = 1.36&#949; (Mean = 0.44&#949;)</span>
<span class="blue">Max = 1.3ε (Mean = 0.404ε)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 1.3&#949; (Mean = 0.404&#949;)</span>
<span class="blue">Max = 1.3 (Mean = 0.404ε)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 1.33&#949; (Mean = 0.409&#949;)</span>
<span class="blue">Max = 1.54ε (Mean = 0.563ε)</span>
</p>
</td>
<td>
<p>
<span class="blue">Max = 1.54&#949; (Mean = 0.568&#949;)</span>
<span class="blue">Max = 1.35ε (Mean = 0.497ε)</span>
</p>
</td>
</tr></tbody>
@@ -148,11 +150,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<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>