<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.10.0">
+<link rel="home" href="../../index.html" title="Math Toolkit 2.11.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">
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></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"><</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 19. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">></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 19. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&);</span>
+<span class="keyword">template</span> <span class="special"><</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 20. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">></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 20. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&);</span>
<span class="special">}}</span> <span class="comment">// namespaces</span>
</pre>
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 19. Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can
+ The final <a class="link" href="../../policy.html" title="Chapter 20. 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 19. 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 20. 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ɛ).
+ 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>
<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>
should have approximately 1 epsilon accuracy.
</p>
<div class="table">
-<a name="math_toolkit.powers.expm1.table_expm1"></a><p class="title"><b>Table 7.82. 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>