]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/math/doc/sf/gamma_ratios.qbk
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / math / doc / sf / gamma_ratios.qbk
CommitLineData
7c673cae
FG
1[section:gamma_ratios Ratios of Gamma Functions]
2
3``
4#include <boost/math/special_functions/gamma.hpp>
5``
6
7 namespace boost{ namespace math{
8
9 template <class T1, class T2>
10 ``__sf_result`` tgamma_ratio(T1 a, T2 b);
11
12 template <class T1, class T2, class ``__Policy``>
13 ``__sf_result`` tgamma_ratio(T1 a, T2 b, const ``__Policy``&);
14
15 template <class T1, class T2>
16 ``__sf_result`` tgamma_delta_ratio(T1 a, T2 delta);
17
18 template <class T1, class T2, class Policy>
19 ``__sf_result`` tgamma_delta_ratio(T1 a, T2 delta, const ``__Policy``&);
20
21 }} // namespaces
22
23[h4 Description]
24
25 template <class T1, class T2>
26 ``__sf_result`` tgamma_ratio(T1 a, T2 b);
27
28 template <class T1, class T2, class ``__Policy``>
29 ``__sf_result`` tgamma_ratio(T1 a, T2 b, const ``__Policy``&);
30
31Returns the ratio of gamma functions:
32
33[equation gamma_ratio0]
34
35[optional_policy]
36
37Internally this just calls `tgamma_delta_ratio(a, b-a)`.
38
39 template <class T1, class T2>
40 ``__sf_result`` tgamma_delta_ratio(T1 a, T2 delta);
41
42 template <class T1, class T2, class ``__Policy``>
43 ``__sf_result`` tgamma_delta_ratio(T1 a, T2 delta, const ``__Policy``&);
44
45Returns the ratio of gamma functions:
46
47[equation gamma_ratio1]
48
49[optional_policy]
50
51Note that the result is calculated accurately even when /delta/ is
52small compared to /a/: indeed even if /a+delta ~ a/. The function is
53typically used when /a/ is large and /delta/ is very small.
54
55The return type of these functions is computed using the __arg_promotion_rules
56when T1 and T2 are different types, otherwise the result type is simple T1.
57
58[graph tgamma_delta_ratio]
59
60[h4 Accuracy]
61
62The following table shows the peak errors (in units of epsilon)
63found on various platforms with various floating point types.
64Unless otherwise specified any floating point type that is narrower
65than the one shown will have __zero_error.
66
67[table_tgamma_delta_ratio]
68
69[table_tgamma_ratio]
70
71[h4 Testing]
72
73Accuracy tests use data generated at very high precision
74(with [@http://shoup.net/ntl/doc/RR.txt NTL RR class]
75set at 1000-bit precision: about 300 decimal digits)
76and a deliberately naive calculation of [Gamma](x)/[Gamma](y).
77
78[h4 Implementation]
79
80The implementation of these functions is very similar to that of
81__beta, and is based on combining similar power terms
82to improve accuracy and avoid spurious overflow/underflow.
83
84In addition there are optimisations for the situation where /delta/
85is a small integer: in which case this function is basically
86the reciprocal of a rising factorial, or where both arguments
87are smallish integers: in which case table lookup of factorials
88can be used to calculate the ratio.
89
90[endsect][/section:gamma_ratios Ratios of Gamma Functions]
91
92[/
93 Copyright 2006 John Maddock and Paul A. Bristow.
94 Distributed under the Boost Software License, Version 1.0.
95 (See accompanying file LICENSE_1_0.txt or copy at
96 http://www.boost.org/LICENSE_1_0.txt).
97]
98