]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <html> |
2 | <head> | |
3 | <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> | |
4 | <title>powm1</title> | |
5 | <link rel="stylesheet" href="../../math.css" type="text/css"> | |
6 | <meta name="generator" content="DocBook XSL Stylesheets V1.77.1"> | |
7 | <link rel="home" href="../../index.html" title="Math Toolkit 2.5.1"> | |
8 | <link rel="up" href="../powers.html" title="Basic Functions"> | |
9 | <link rel="prev" href="sqrt1pm1.html" title="sqrt1pm1"> | |
10 | <link rel="next" href="hypot.html" title="hypot"> | |
11 | </head> | |
12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> | |
13 | <table cellpadding="2" width="100%"><tr> | |
14 | <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td> | |
15 | <td align="center"><a href="../../../../../../index.html">Home</a></td> | |
16 | <td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td> | |
17 | <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> | |
18 | <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> | |
19 | <td align="center"><a href="../../../../../../more/index.htm">More</a></td> | |
20 | </tr></table> | |
21 | <hr> | |
22 | <div class="spirit-nav"> | |
23 | <a accesskey="p" href="sqrt1pm1.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="hypot.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> | |
24 | </div> | |
25 | <div class="section"> | |
26 | <div class="titlepage"><div><div><h3 class="title"> | |
27 | <a name="math_toolkit.powers.powm1"></a><a class="link" href="powm1.html" title="powm1">powm1</a> | |
28 | </h3></div></div></div> | |
29 | <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">special_functions</span><span class="special">/</span><span class="identifier">powm1</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> | |
30 | </pre> | |
31 | <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> | |
32 | ||
33 | <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">></span> | |
34 | <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> | |
35 | ||
36 | <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">></span> | |
37 | <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 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&);</span> | |
38 | ||
39 | <span class="special">}}</span> <span class="comment">// namespaces</span> | |
40 | </pre> | |
41 | <p> | |
42 | Returns x<sup>y </sup> - 1. | |
43 | </p> | |
44 | <p> | |
45 | 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 | |
46 | type calculation rules</em></span></a> when T1 and T2 are dufferent types. | |
47 | </p> | |
48 | <p> | |
49 | The final <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can | |
50 | be used to control the behaviour of the function: how it handles errors, | |
51 | what level of precision to use etc. Refer to the <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">policy | |
52 | documentation for more details</a>. | |
53 | </p> | |
54 | <p> | |
55 | There are two domains where this is useful: when y is very small, or when | |
56 | x is close to 1. | |
57 | </p> | |
58 | <p> | |
59 | Implemented in terms of <code class="computeroutput"><span class="identifier">expm1</span></code>. | |
60 | </p> | |
61 | <p> | |
62 | The following graph illustrates the behaviour of powm1: | |
63 | </p> | |
64 | <p> | |
65 | <span class="inlinemediaobject"><img src="../../../graphs/powm1.svg" align="middle"></span> | |
66 | </p> | |
67 | <h5> | |
68 | <a name="math_toolkit.powers.powm1.h0"></a> | |
69 | <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> | |
70 | </h5> | |
71 | <p> | |
72 | Should have approximately 2-3 epsilon accuracy. | |
73 | </p> | |
74 | <div class="table"> | |
75 | <a name="math_toolkit.powers.powm1.table_powm1"></a><p class="title"><b>Table 6.82. Error rates for powm1</b></p> | |
76 | <div class="table-contents"><table class="table" summary="Error rates for powm1"> | |
77 | <colgroup> | |
78 | <col> | |
79 | <col> | |
80 | <col> | |
81 | <col> | |
82 | <col> | |
83 | </colgroup> | |
84 | <thead><tr> | |
85 | <th> | |
86 | </th> | |
87 | <th> | |
88 | <p> | |
89 | Microsoft Visual C++ version 12.0<br> Win32<br> double | |
90 | </p> | |
91 | </th> | |
92 | <th> | |
93 | <p> | |
94 | GNU C++ version 5.1.0<br> linux<br> double | |
95 | </p> | |
96 | </th> | |
97 | <th> | |
98 | <p> | |
99 | GNU C++ version 5.1.0<br> linux<br> long double | |
100 | </p> | |
101 | </th> | |
102 | <th> | |
103 | <p> | |
104 | Sun compiler version 0x5130<br> Sun Solaris<br> long double | |
105 | </p> | |
106 | </th> | |
107 | </tr></thead> | |
108 | <tbody><tr> | |
109 | <td> | |
110 | <p> | |
111 | powm1 | |
112 | </p> | |
113 | </td> | |
114 | <td> | |
115 | <p> | |
116 | <span class="blue">Max = 1.99ε (Mean = 0.461ε)</span> | |
117 | </p> | |
118 | </td> | |
119 | <td> | |
120 | <p> | |
121 | <span class="blue">Max = 1.26ε (Mean = 0.428ε)</span> | |
122 | </p> | |
123 | </td> | |
124 | <td> | |
125 | <p> | |
126 | <span class="blue">Max = 2.04ε (Mean = 0.521ε)</span> | |
127 | </p> | |
128 | </td> | |
129 | <td> | |
130 | <p> | |
131 | <span class="blue">Max = 2.14ε (Mean = 0.498ε)</span> | |
132 | </p> | |
133 | </td> | |
134 | </tr></tbody> | |
135 | </table></div> | |
136 | </div> | |
137 | <br class="table-break"><h5> | |
138 | <a name="math_toolkit.powers.powm1.h1"></a> | |
139 | <span class="phrase"><a name="math_toolkit.powers.powm1.testing"></a></span><a class="link" href="powm1.html#math_toolkit.powers.powm1.testing">Testing</a> | |
140 | </h5> | |
141 | <p> | |
142 | A selection of random high precision test values calculated using NTL::RR | |
143 | at 1000-bit precision. | |
144 | </p> | |
145 | </div> | |
146 | <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> | |
147 | <td align="left"></td> | |
148 | <td align="right"><div class="copyright-footer">Copyright © 2006-2010, 2012-2014 Nikhar Agrawal, | |
149 | Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert | |
150 | Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan Råde, Gautam Sewani, | |
151 | Benjamin Sobotta, Thijs van den Berg, Daryle Walker and Xiaogang Zhang<p> | |
152 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
153 | 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>) | |
154 | </p> | |
155 | </div></td> | |
156 | </tr></table> | |
157 | <hr> | |
158 | <div class="spirit-nav"> | |
159 | <a accesskey="p" href="sqrt1pm1.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="hypot.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> | |
160 | </div> | |
161 | </body> | |
162 | </html> |