File: math.qbk

package info (click to toggle)
boost1.35 1.35.0-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 203,856 kB
  • ctags: 337,867
  • sloc: cpp: 938,683; xml: 56,847; ansic: 41,589; python: 18,999; sh: 11,566; makefile: 664; perl: 494; yacc: 456; asm: 353; csh: 6
file content (413 lines) | stat: -rw-r--r-- 18,093 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
[article Math Toolkit
    [quickbook 1.4]
    [copyright 2006-2007 John Maddock, Paul A. Bristow, Hubert Holin and Xiaogang Zhang]
    [purpose ISBN 0-9504833-2-X  978-0-9504833-2-0, Classification 519.2-dc22]
    [license
        Distributed under the Boost Software License, Version 1.0.
        (See accompanying file LICENSE_1_0.txt or copy at
        [@http://www.boost.org/LICENSE_1_0.txt])
    ]
    [authors [Maddock, John], [Bristow, Paul A.], [Holin, Hubert], [Zhang, Xiaogang]]
    [category math]
    [purpose mathematics]
    [/last-revision $Date: 2008-02-21 07:14:40 -0500 (Thu, 21 Feb 2008) $]
]

[template equation[name]  '''<inlinemediaobject>
<imageobject role="html">
<imagedata fileref="../equations/'''[name]'''.png"></imagedata>
</imageobject>
<imageobject role="print">
<imagedata fileref="../equations/'''[name]'''.svg"></imagedata>
</imageobject>
</inlinemediaobject>''']

[include html4_symbols.qbk] [/ just for testing]
[/include latin1_symbols.qbk] [/ just for testing]
[include common_overviews.qbk][/ overviews that appear in more than one place!]
[include roadmap.qbk] [/ for history]

[def __effects [*Effects: ]]
[def __formula [*Formula: ]]
[def __exm1 '''<code>e<superscript>x</superscript> - 1</code>''']
[def __ex '''<code>e<superscript>x</superscript></code>''']
[def __te '''2&#x025B;''']  [/small Latin letter open e]

[def __ceilR '''&#x2309;''']
[def __ceilL '''&#2308;''']
[def __floorR '''&#x230B;''']
[def __floorL '''&#x230A;''']
[def __infin '''&#8734;''']
[def __integral '''&#8747;''']
[def __aacute '''&#225;''']
[def __eacute '''&#233;''']
[def __quarter '''&#x00BC;''']
[def __nearequal '''&#x224A;''']
[def __quarter '''&#x00BC;''']
[def __space '''&#8203;''']

[def __NTL_RR [@http://shoup.net/ntl/doc/RR.txt NTL::RR]]
[def __NTL_quad_float [@http://shoup.net/ntl/doc/quad_float.txt NTL::quad_float]]

[def __godfrey [link godfrey Godfrey]]
[def __pugh [link pugh Pugh]]

[def __caution This is now an official Boost library, but remains a library under 
               construction, the code is fully functional and robust, but 
               interfaces, library structure, and function and distribution names
               may still be changed without notice.]
               
[template tr1[] [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf Technical Report on C++ Library Extensions]]
[template jm_rationals[] [link math_toolkit.backgrounders.implementation.rational_approximations_used devised by JM]]
[def __domain_error [link domain_error domain_error]]
[def __pole_error [link pole_error pole_error]]
[def __overflow_error [link overflow_error overflow_error]]
[def __underflow_error [link underflow_error underflow_error]]
[def __denorm_error [link denorm_error denorm_error]]
[def __evaluation_error [link evaluation_error evaluation_error]]
[def __checked_narrowing_cast [link checked_narrowing_cast checked_narrowing_cast]]

[def __arg_pomotion_rules [link math_toolkit.main_overview.result_type ['result type calculation rules]]]
[def __sf_result [link math_toolkit.main_overview.result_type ['calculated-result-type]]]

[/ The following macros expand to links to the various special functions
and use the function's name as the link text]

[/Misc]
[def __lanczos [link math_toolkit.backgrounders.lanczos Lanczos approximation]]
[def __zero_error [link zero_error effectively zero error]]
[def __relative_error [link math_toolkit.backgrounders.relative_error relative zero error]]

[/gammas]
[def __lgamma [link math_toolkit.special.sf_gamma.lgamma lgamma]]
[def __digamma [link math_toolkit.special.sf_gamma.digamma digamma]]
[def __tgamma_ratio [link math_toolkit.special.sf_gamma.gamma_ratios tgamma_ratio]]
[def __tgamma_delta_ratio [link math_toolkit.special.sf_gamma.gamma_ratios tgamma_delta_ratio]]
[def __tgamma [link math_toolkit.special.sf_gamma.tgamma tgamma]]
[def __tgamma1pm1 [link math_toolkit.special.sf_gamma.tgamma tgamma1pm1]]
[def __tgamma_lower [link math_toolkit.special.sf_gamma.igamma tgamma_lower]]
[def __gamma_p [link math_toolkit.special.sf_gamma.igamma gamma_p]]
[def __gamma_q [link math_toolkit.special.sf_gamma.igamma gamma_q]]
[def __gamma_q_inv [link math_toolkit.special.sf_gamma.igamma_inv gamma_q_inv]]
[def __gamma_p_inv [link math_toolkit.special.sf_gamma.igamma_inv gamma_p_inv]]
[def __gamma_q_inva [link math_toolkit.special.sf_gamma.igamma_inv gamma_q_inva]]
[def __gamma_p_inva [link math_toolkit.special.sf_gamma.igamma_inv gamma_p_inva]]
[def __gamma_p_derivative [link math_toolkit.special.sf_gamma.gamma_derivatives gamma_p_derivative]]

[/factorials]
[def __factorial [link math_toolkit.special.factorials.sf_factorial factorial]]
[def __unchecked_factorial [link math_toolkit.special.factorials.sf_factorial unchecked_factorial]]
[def __max_factorial [link math_toolkit.special.factorials.sf_factorial max_factorial]]
[def __double_factorial [link math_toolkit.special.factorials.sf_double_factorial double_factorial]]
[def __rising_factorial [link math_toolkit.special.factorials.sf_rising_factorial rising_factorial]]
[def __falling_factorial [link math_toolkit.special.factorials.sf_falling_factorial falling_factorial]]

[/error functions]
[def __erf [link math_toolkit.special.sf_erf.error_function erf]]
[def __erfc [link math_toolkit.special.sf_erf.error_function erfc]]
[def __erf_inv [link math_toolkit.special.sf_erf.error_inv erf_inv]]
[def __erfc_inv [link math_toolkit.special.sf_erf.error_inv erfc_inv]]

[/beta functions]
[def __beta  [link math_toolkit.special.sf_beta.beta_function beta]]
[def __beta3 [link math_toolkit.special.sf_beta.ibeta_function beta]]
[def __betac [link math_toolkit.special.sf_beta.ibeta_function betac]]
[def __ibeta [link math_toolkit.special.sf_beta.ibeta_function ibeta]]
[def __ibetac [link math_toolkit.special.sf_beta.ibeta_function ibetac]]
[def __ibeta_inv [link math_toolkit.special.sf_beta.ibeta_inv_function ibeta_inv]]
[def __ibetac_inv [link math_toolkit.special.sf_beta.ibeta_inv_function ibetac_inv]]
[def __ibeta_inva [link math_toolkit.special.sf_beta.ibeta_inv_function ibeta_inva]]
[def __ibetac_inva [link math_toolkit.special.sf_beta.ibeta_inv_function ibetac_inva]]
[def __ibeta_invb [link math_toolkit.special.sf_beta.ibeta_inv_function ibeta_invb]]
[def __ibetac_invb [link math_toolkit.special.sf_beta.ibeta_inv_function ibetac_invb]]
[def __ibeta_derivative [link math_toolkit.special.sf_beta.beta_derivative ibeta_derivative]]

[/elliptic integrals]
[def __ellint_rj  [link math_toolkit.special.ellint.ellint_carlson ellint_rj]]
[def __ellint_rf  [link math_toolkit.special.ellint.ellint_carlson ellint_rf]]
[def __ellint_rc  [link math_toolkit.special.ellint.ellint_carlson ellint_rc]]
[def __ellint_rd  [link math_toolkit.special.ellint.ellint_carlson ellint_rd]]
[def __ellint_1  [link math_toolkit.special.ellint.ellint_1 ellint_1]]
[def __ellint_2  [link math_toolkit.special.ellint.ellint_2 ellint_2]]
[def __ellint_3  [link math_toolkit.special.ellint.ellint_3 ellint_3]]

[/Bessel functions]
[def __cyl_bessel_j  [link math_toolkit.special.bessel.bessel cyl_bessel_j]]
[def __cyl_neumann  [link math_toolkit.special.bessel.bessel cyl_neumann]]
[def __cyl_bessel_i  [link math_toolkit.special.bessel.mbessel cyl_bessel_i]]
[def __cyl_bessel_k  [link math_toolkit.special.bessel.mbessel cyl_bessel_k]]
[def __sph_bessel  [link math_toolkit.special.bessel.sph_bessel sph_bessel]]
[def __sph_neumann  [link math_toolkit.special.bessel.sph_bessel sph_neumann]]

[/sinus cardinals]
[def __sinc_pi  [link math_toolkit.special.sinc.sinc_pi sinc_pi]]
[def __sinhc_pi  [link math_toolkit.special.sinc.sinhc_pi sinhc_pi]]

[/Inverse hyperbolics]
[def __acosh  [link math_toolkit.special.inv_hyper.acosh acosh]]
[def __asinh  [link math_toolkit.special.inv_hyper.asinh asinh]]
[def __atanh  [link math_toolkit.special.inv_hyper.atanh atanh]]

[/classify]
[def __fpclassify [link math_toolkit.special.fpclass fpclassify]]
[def __isfinite [link math_toolkit.special.fpclass isfinite]]
[def __isnan [link math_toolkit.special.fpclass isnan]]
[def __isinf [link math_toolkit.special.fpclass isinf]]
[def __isnormal [link math_toolkit.special.fpclass isnormal]]

[/powers etc]
[def __expm1 [link math_toolkit.special.powers.expm1 expm1]]
[def __log1p [link math_toolkit.special.powers.log1p log1p]]
[def __cbrt [link math_toolkit.special.powers.cbrt cbrt]]
[def __sqrt1pm1 [link math_toolkit.special.powers.sqrt1pm1 sqrt1pm1]]
[def __powm1 [link math_toolkit.special.powers.powm1 powm1]]
[def __hypot [link math_toolkit.special.powers.hypot hypot]]

[/ distribution non-members]
[def __cdf [link math.dist.cdf Cumulative Distribution Function]]
[def __pdf [link math.dist.pdf Probability Density Function]]
[def __ccdf [link math.dist.ccdf Complement of the Cumulative Distribution Function]]
[def __quantile [link math.dist.quantile Quantile]]
[def __quantile_c [link math.dist.quantile_c Quantile from the complement of the probability]]
[def __mean [link math.dist.mean mean]]
[def __median [link math.dist.median median]]
[def __mode [link math.dist.mode mode]]
[def __skewness [link math.dist.skewness skewness]]
[def __kurtosis [link math.dist.kurtosis kurtosis]]
[def __kurtosis_excess [link math.dist.kurtosis_excess kurtosis_excess]]
[def __variance [link math.dist.variance variance]]
[def __sd [link math.dist.sd standard deviation]]
[def __hazard [link math.dist.hazard Hazard Function]]
[def __chf [link math.dist.chf Cumulative Hazard Function]]
[def __range [link math.dist.range range]]
[def __support [link math.dist.support support]]

[/ distribution def names end in distrib to avoid clashes]
[def __beta_distrib [link math_toolkit.dist.dist_ref.dists.beta_dist Beta Distribution]]
[def __binomial_distrib [link math_toolkit.dist.dist_ref.dists.binomial_dist Binomial Distribution]]
[def __cauchy_distrib [link math_toolkit.dist.dist_ref.dists.cauchy_dist Cauchy Distribution]]
[def __chi_squared_distrib [link math_toolkit.dist.dist_ref.dists.chi_squared_dist Chi Squared Distribution]]
[def __exp_distrib [link math_toolkit.dist.dist_ref.dists.exp_dist Exponential Distribution]]
[def __F_distrib [link math_toolkit.dist.dist_ref.dists.f_dist Fisher F Distribution]]
[def __gamma_distrib [link math_toolkit.dist.dist_ref.dists.gamma_dist Gamma Distribution]]
[def __lognormal_distrib [link math_toolkit.dist.dist_ref.dists.lognormal_dist Log-normal Distribution]]
[def __negative_binomial_distrib [link math_toolkit.dist.dist_ref.dists.negative_binomial_dist Negative Binomial Distribution]]
[def __normal_distrib [link math_toolkit.dist.dist_ref.dists.normal_dist Normal Distribution]]
[def __poisson_distrib [link math_toolkit.dist.dist_ref.dists.poisson_dist Poisson Distribution]]
[def __students_t_distrib [link math_toolkit.dist.dist_ref.dists.students_t_dist Students t Distribution]]
[def __weibull_distrib [link math_toolkit.dist.dist_ref.dists.weibull Weibull Distribution]]

[/links to policy]
[def __Policy [link math_toolkit.policy Policy]] [/ Used in distribution template specifications]
[def __policy_section [link math_toolkit.policy Policies]] [/ Used in text to refer too.]
[def __policy_class [link math_toolkit.policy.pol_ref.pol_ref_ref policies::policy<>]]
[def __math_undefined [link math_toolkit.policy.pol_ref.assert_undefined mathematically undefined function]]
[def __policy_ref [link math_toolkit.policy.pol_ref policy reference]]
[def __math_discrete [link math_toolkit.policy.pol_ref.discrete_quant_ref discrete functions]]
[def __error_policy [link math_toolkit.policy.pol_ref.error_handling_policies error handling policies]]
[def __changing_policy_defaults [link math_toolkit.policy.pol_ref.policy_defaults changing policies defaults]]
[def __user_error_handling [link math_toolkit.policy.pol_tutorial.user_def_err_pol user error handling]]

[def __usual_accessors __cdf, __pdf, __quantile, __hazard, 
   __chf, __mean, __median, __mode, __variance, __sd, __skewness, 
   __kurtosis, __kurtosis_excess, __range and __support]

[def __gsl [@http://www.gnu.org/software/gsl/ GSL-1.9]]
[def __glibc [@http://www.gnu.org/software/libc/ GNU C Lib]]
[def __hpc [@http://docs.hp.com/en/B9106-90010/index.html HP-UX C Library]]
[def __cephes [@http://www.netlib.org/cephes/ Cephes]]


[def __why_complements [link why_complements why complements?]]
[def __complements [link complements complements]]

[/ Some composite templates]
[template super[x]'''<superscript>'''[x]'''</superscript>''']
[template sub[x]'''<subscript>'''[x]'''</subscript>''']
[template floor[x]'''&#x230A;'''[x]'''&#x230B;''']
[template floorlr[x][lfloor][x][rfloor]]
[template ceil[x] '''&#x2308;'''[x]'''&#x2309;''']

[template header_file[file] [@../../../../../[file] [file]]]

[template optional_policy[] 
The final __Policy 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 
[link math_toolkit.policy policy documentation for more details].]

[template discrete_quantile_warning[NAME]
[caution
The [NAME] distribution is a discrete distribution: internally
functions like the `cdf` and `pdf` are treated "as if" they are continuous 
functions, but in reality the results returned from these functions
only have meaning if an integer value is provided for the random variate 
argument.

The quantile function will by default return an integer result that has been
/rounded outwards/.  That is to say lower quantiles (where the probability is
less than 0.5) are rounded downward, and upper quantiles (where the probability
is greater than 0.5) are rounded upwards.  This behaviour
ensures that if an X% quantile is requested, then /at least/ the requested
coverage will be present in the central region, and /no more than/
the requested coverage will be present in the tails.

This behaviour can be changed so that the quantile functions are rounded
differently, or even return a real-valued result using 
[link math_toolkit.policy.pol_overview Policies].  It is strongly
recommended that you read the tutorial 
[link math_toolkit.policy.pol_tutorial.understand_dis_quant
Understanding Quantiles of Discrete Distributions] before
using the quantile function on the [NAME] distribution.  The
[link math_toolkit.policy.pol_ref.discrete_quant_ref reference docs] 
describe how to change the rounding policy
for these distributions.
] [/ caution]
] [/ template discrete_quantile_warning]

This manual is also available in 
[@http:svn.boost.org/svn/boost/sandbox/pdf/math/release/math.pdf 
printer friendly PDF format].

[section:main_overview Overview]

[include overview.qbk]
[include structure.qbk] [/getting about]

[include result_type_calc.qbk]
[include error_handling.qbk]

[section:compilers_overview Compilers]
[compilers_overview]
[endsect]
[section:pol_overview Configuration and Policies]
[policy_overview]
[endsect]

[include thread_safety.qbk]

[section:perf_over Performance]
[performance_overview]
[endsect]
[section:history1 History and What's New]
[history]
[endsect]
[include contact_info.qbk]

[endsect] [/section:main_overview Overview]

[section:dist Statistical Distributions and Functions]
[include dist_tutorial.qbk]
[include dist_reference.qbk]
[endsect] [/section:dist Statistical Distributions and Functions]

[section:special Special Functions]

[section:sf_gamma Gamma Functions]
[include tgamma.qbk]
[include lgamma.qbk]
[include digamma.qbk]
[include gamma_ratios.qbk]
[include igamma.qbk]
[include igamma_inv.qbk]
[include gamma_derivatives.qbk]
[endsect] [/section:sf_gamma Gamma Functions]

[include factorials.qbk]

[section:sf_beta Beta Functions]
[include beta.qbk]
[include ibeta.qbk]
[include ibeta_inv.qbk]
[include beta_derivative.qbk]
[endsect] [/section:sf_beta Beta Functions]

[section:sf_erf Error Functions]
[include erf.qbk]
[include erf_inv.qbk]
[endsect] [/section:sf_erf Error Functions]

[section:sf_poly Polynomials]
[include legendre.qbk]
[include laguerre.qbk]
[include hermite.qbk]
[include spherical_harmonic.qbk]
[endsect] [/section:sf_poly Polynomials]

[section:bessel Bessel Functions]
[include bessel_introduction.qbk]
[include bessel_jy.qbk]
[include bessel_ik.qbk]
[include bessel_spherical.qbk]
[endsect] [/section:bessel Bessel Functions]

[section:ellint Elliptic Integrals]
[include ellint_introduction.qbk]
[include ellint_carlson.qbk]
[include ellint_legendre.qbk]
[endsect] [/section:ellint Elliptic Integrals]

[include powers.qbk]
[include sinc.qbk]
[include inv_hyper.qbk]
[include fpclassify.qbk]
[endsect] [/section:special Special Functions]

[section:toolkit Internal Details and Tools (Experimental)]

[include internals_overview.qbk]

[section:internals1 Reused Utilities]
[include series.qbk]
[include fraction.qbk]
[include rational.qbk]
[include roots.qbk]
[include roots_without_derivatives.qbk]
[include minima.qbk]
[endsect] [/section:internals1 Reused Utilities]

[section:internals2 Testing and Development]
[include polynomial.qbk]
[include minimax.qbk]
[include relative_error.qbk]
[include test_data.qbk]
[endsect] [/section:internals2 Testing and Development]

[endsect] [/section:toolkit Toolkit]

[section:using_udt Use with User Defined Floating-Point Types]
[include concepts.qbk]
[endsect] [/section:using_udt Use with User Defined Floating-Point Types]

[include policy.qbk]

[include performance.qbk]

[section:backgrounders Backgrounders]
[include implementation.qbk]
[include error.qbk] [/relative error NOT handling]
[include lanczos.qbk]
[include remez.qbk]
[include references.qbk]
[endsect] [/section:backgrounds Backgrounders]

[section:status Library Status]
[section:history1 History and What's New]
[history]
[endsect]
[section:compilers Compilers]
[compilers_overview]
[endsect]
[include issues.qbk]
[include credits.qbk]
[/include test_HTML4_symbols.qbk]
[/include test_Latin1_symbols.qbk]

[endsect] [/section:status Status and Roadmap] 

[/ math.qbk
  Copyright 2006 John Maddock and Paul A. Bristow.
  Distributed under the Boost Software License, Version 1.0.
  (See accompanying file LICENSE_1_0.txt or copy at
  http://www.boost.org/LICENSE_1_0.txt).
]