Skip to content

Commit 31e3c1a

Browse files
authored
Use DocumenterCitations.jl to manage dependencies (#486)
* Add DocumenterCitations as doc dependency * Add citations to docstrings * Minor docstring fixes * Fix typo citet -> cite
1 parent 738435a commit 31e3c1a

File tree

13 files changed

+229
-79
lines changed

13 files changed

+229
-79
lines changed

docs/Project.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
34
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
45

6+
[sources]
7+
SpecialFunctions = {path = ".."}
8+
59
[compat]
6-
Documenter = "~0.27"
10+
Documenter = "1"

docs/make.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
using SpecialFunctions, Documenter
2+
using DocumenterCitations
23

34
# `using SpecialFunctions` for all doctests
45
DocMeta.setdocmeta!(SpecialFunctions, :DocTestSetup, :(using SpecialFunctions); recursive=true)
6+
7+
bib = CitationBibliography(
8+
joinpath(@__DIR__, "src", "refs.bib");
9+
style = :authoryear,
10+
)
11+
512
makedocs(modules=[SpecialFunctions],
613
sitename="SpecialFunctions.jl",
714
authors="Jeff Bezanson, Stefan Karpinski, Viral B. Shah, et al.",
815
format = Documenter.HTML(; assets = String[]),
916
pages=["Home" => "index.md",
1017
"Overview" => "functions_overview.md",
1118
"Reference" => "functions_list.md"],
12-
#warnonly=[:missing_docs],
19+
plugins=[bib],
20+
checkdocs=:exports,
1321
)
1422

1523
deploydocs(repo="github.com/JuliaMath/SpecialFunctions.jl.git")

docs/src/functions_list.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,7 @@ ellipe
151151
eta
152152
zeta
153153
```
154+
155+
## Citations
156+
```@bibliography
157+
```

docs/src/functions_overview.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ Here the *Special Functions* are listed according to the structure of [NIST Digi
1515
| [`digamma(x)`](@ref SpecialFunctions.digamma) | [digamma function](https://en.wikipedia.org/wiki/Digamma_function) (i.e. the derivative of `loggamma` at `x`) |
1616
| [`invdigamma(x)`](@ref SpecialFunctions.invdigamma) | [invdigamma function](http://bariskurt.com/calculating-the-inverse-of-digamma-function/) (i.e. inverse of `digamma` function at `x` using fixed-point iteration algorithm) |
1717
| [`trigamma(x)`](@ref SpecialFunctions.trigamma) | [trigamma function](https://en.wikipedia.org/wiki/Trigamma_function) (i.e the logarithmic second derivative of `gamma` at `x`) |
18-
| [`polygamma(m,x)`](@ref SpecialFunctions.polygamma) | [polygamma function](https://en.wikipedia.org/wiki/Polygamma_function) (i.e the (m+1)-th derivative of the `loggamma` function at `x`) |
18+
| [`polygamma(m,x)`](@ref SpecialFunctions.polygamma) | [polygamma function](https://en.wikipedia.org/wiki/Polygamma_function) (i.e the ``(m+1)``-th derivative of the `loggamma` function at `x`) |
1919
| [`gamma(a,z)`](@ref SpecialFunctions.gamma(::Number,::Number)) | [upper incomplete gamma function ``\Gamma(a,z)``](https://en.wikipedia.org/wiki/Incomplete_gamma_function) |
2020
| [`loggamma(a,z)`](@ref SpecialFunctions.loggamma(::Number,::Number)) | accurate `log(gamma(a,x))` for large arguments |
21-
| [`gamma_inc(a,x,IND)`](@ref SpecialFunctions.gamma_inc) | [incomplete gamma function ratio P(a,x) and Q(a,x)](https://en.wikipedia.org/wiki/Incomplete_gamma_function) (i.e evaluates P(a,x) and Q(a,x) for accuracy specified by IND and returns tuple (p,q)) |
22-
| [`gamma_inc_inv(a,p,q)`](@ref SpecialFunctions.gamma_inc_inv) | [inverse of incomplete gamma function ratio P(a,x) and Q(a,x)](https://en.wikipedia.org/wiki/Incomplete_gamma_function) (i.e evaluates x given P(a,x)=p and Q(a,x)=q) |
21+
| [`gamma_inc(a,x,IND)`](@ref SpecialFunctions.gamma_inc) | [incomplete gamma function ratio ``P(a,x)`` and ``Q(a,x)``](https://en.wikipedia.org/wiki/Incomplete_gamma_function) (i.e evaluates ``P(a,x)`` and ``Q(a,x)`` for accuracy specified by IND and returns tuple (p,q)) |
22+
| [`gamma_inc_inv(a,p,q)`](@ref SpecialFunctions.gamma_inc_inv) | [inverse of incomplete gamma function ratio ``P(a,x)`` and ``Q(a,x)``](https://en.wikipedia.org/wiki/Incomplete_gamma_function) (i.e evaluates x given ``P(a,x)=p`` and ``Q(a,x)=q``) |
2323
| [`beta(x,y)`](@ref SpecialFunctions.beta) | [beta function](https://en.wikipedia.org/wiki/Beta_function) at `x,y` |
2424
| [`logbeta(x,y)`](@ref SpecialFunctions.logbeta) | accurate `log(beta(x,y))` for large `x` or `y` |
2525
| [`logabsbeta(x,y)`](@ref SpecialFunctions.logabsbeta) | accurate `log(abs(beta(x,y)))` for large `x` or `y` |
2626
| [`logabsbinomial(x,y)`](@ref SpecialFunctions.logabsbinomial) | accurate `log(abs(binomial(n,k)))` for large `n` and `k` near `n/2` |
27-
| [`beta_inc(a,b,x,y)`](@ref SpecialFunctions.beta_inc) | [incomplete beta function ratio Ix(a,b) and Iy(a,b)](https://en.wikipedia.org/wiki/Beta_function#Incomplete_beta_function) (i.e evaluates Ix(a,b) and Iy(a,b) and returns tuple (p,q)) |
28-
| [`beta_inc_inv(a,b,p,q)`](@ref SpecialFunctions.beta_inc_inv) | Inverse of the incomplete beta function (i.e evaluates x given ``I_{x}(a, b) = p``) |
27+
| [`beta_inc(a,b,x,y)`](@ref SpecialFunctions.beta_inc) | [incomplete beta function ratio ``I_x(a,b)`` and ``I_y(a,b)``](https://en.wikipedia.org/wiki/Beta_function#Incomplete_beta_function) (i.e evaluates ``I_x(a,b)`` and ``I_y(a,b)`` and returns tuple (p,q)) |
28+
| [`beta_inc_inv(a,b,p,q)`](@ref SpecialFunctions.beta_inc_inv) | Inverse of the incomplete beta function (i.e evaluates ``x`` given ``I_{x}(a, b) = p``) |
2929

3030

3131
## Exponential and Trigonometric Integrals

docs/src/refs.bib

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
@article{berry_1990,
2+
title = {Algorithm AS R83: A Remark on Algorithm AS 109: Inverse of the Incomplete Beta Function Ratio},
3+
ISSN = {00359254, 14679876},
4+
URL = {http://www.jstor.org/stable/2347779},
5+
author = {K. J. Berry and P. W. Mielke and G. W. Cran},
6+
journal = {Journal of the Royal Statistical Society. Series C (Applied Statistics)},
7+
number = {2},
8+
pages = {309--310},
9+
publisher = {Royal Statistical Society, Oxford University Press},
10+
volume = {39},
11+
year = {1990}
12+
}
13+
14+
@article{blair_1976,
15+
title = {Rational Chebyshev Approximations for the Inverse of the Error Function},
16+
author = {Blair, J. M. and Edwards, C. A. and Johnson, J. H.},
17+
date = {1976},
18+
year = {1976},
19+
journal = {Mathematics of Computation},
20+
shortjournal = {Math. Comp.},
21+
volume = {30},
22+
number = {136},
23+
pages = {827--830},
24+
issn = {0025-5718, 1088-6842},
25+
doi = {10.1090/S0025-5718-1976-0421040-7},
26+
url = {https://www.ams.org/mcom/1976-30-136/S0025-5718-1976-0421040-7/},
27+
langid = {english}
28+
}
29+
30+
@article{brent_1978,
31+
title = {A Fortran Multiple-Precision Arithmetic Package},
32+
author = {Brent, Richard P.},
33+
date = {1978-03},
34+
year = {1978},
35+
journal = {ACM Transactions on Mathematical Software},
36+
shortjournal = {ACM Trans. Math. Softw.},
37+
volume = {4},
38+
number = {1},
39+
pages = {57--70},
40+
issn = {0098-3500, 1557-7295},
41+
doi = {10.1145/355769.355775},
42+
url = {https://dl.acm.org/doi/10.1145/355769.355775},
43+
langid = {english}
44+
}
45+
46+
@article{cran_1977,
47+
title = {Remark AS R19 and Algorithm AS 109: A Remark on Algorithms: AS 63: The Incomplete Beta Integral AS 64: Inverse of the Incomplete Beta Function Ratio},
48+
author = {Cran, G. W. and Martin, K. J. and Thomas, G. E.},
49+
journal = {Journal of the Royal Statistical Society. Series C (Applied Statistics)},
50+
number = {1},
51+
issn = {00359254, 14679876},
52+
url = {http://www.jstor.org/stable/2346887},
53+
pages = {111--114},
54+
publisher = {Royal Statistical Society, Oxford University Press},
55+
volume = {26},
56+
year = {1977}
57+
}
58+
59+
@article{chattamvelli_1997,
60+
title = {Computing the Non-Central Beta Distribution Function},
61+
author = {Chattamvelli, R. and Shanmugam, F.},
62+
date = {1997-03-01},
63+
year = {1997},
64+
journal = {Journal of the Royal Statistical Society Series C: Applied Statistics},
65+
volume = {46},
66+
number = {1},
67+
pages = {146--156},
68+
issn = {0035-9254, 1467-9876},
69+
doi = {10.1111/1467-9876.00055},
70+
url = {https://academic.oup.com/jrsssc/article/46/1/146/6990591},
71+
langid = {english}
72+
}
73+
74+
@article{didonato_1986,
75+
title = {Computation of the incomplete gamma function ratios and their inverse},
76+
author = {DiDonato, Armido R and Morris, Alfred H},
77+
volume = {12},
78+
issn = {0098-3500, 1557-7295},
79+
url = {https://dl.acm.org/doi/10.1145/22721.23109},
80+
doi = {10.1145/22721.23109},
81+
abstract = {An algorithm is given for computing the incomplete gamma function ratios $P(a, x)$ and $Q(a, x)$ for $a \geq 0$, $x \geq 0$, $a + x \neq 0$. Temme's uniform asymptotic expansions are used. The algorithm is robust; results accurate to 14 significant digits can be obtained. An' extensive set of coefficients for the Temme expansions is included. An algorithm, employing third-order Schröder iteration supported by Newton-Raphson iteration, is provided for computing $x$ when $a$, $P(a, x)$, and $Q(a, x)$ are given. Three iterations at most are required to obtain 10 significant digit accuracy for $x$.},
82+
language = {en},
83+
number = {4},
84+
urldate = {2025-03-08},
85+
journal = {ACM Transactions on Mathematical Software},
86+
month = dec,
87+
year = {1986},
88+
pages = {377--393},
89+
}
90+
91+
92+
@article{didonato_1992,
93+
title = {Algorithm 708: Significant Digit Computation of the Incomplete Beta Function Ratios},
94+
shorttitle = {Algorithm 708},
95+
author = {Didonato, Armido R. and Morris, Alfred H.},
96+
date = {1992-09},
97+
year = {1992},
98+
journal = {ACM Transactions on Mathematical Software},
99+
shortjournal = {ACM Trans. Math. Softw.},
100+
volume = {18},
101+
number = {3},
102+
pages = {360--373},
103+
issn = {0098-3500, 1557-7295},
104+
doi = {10.1145/131766.131776},
105+
url = {https://dl.acm.org/doi/10.1145/131766.131776},
106+
langid = {english}
107+
}
108+
109+
@article{fukushima_2009,
110+
title = {Fast Computation of Complete Elliptic Integrals and Jacobian Elliptic Functions},
111+
author = {Fukushima, Toshio},
112+
date = {2009-12},
113+
year = {2009},
114+
journal = {Celestial Mechanics and Dynamical Astronomy},
115+
shortjournal = {Celest. Mech. Dyn. Astr.},
116+
volume = {105},
117+
number = {4},
118+
pages = {305--328},
119+
issn = {0923-2958, 1572-9478},
120+
doi = {10.1007/s10569-009-9228-z},
121+
url = {http://link.springer.com/10.1007/s10569-009-9228-z},
122+
langid = {english}
123+
}
124+
125+
@article{fukushima_2015,
126+
title = {Precise and Fast Computation of Complete Elliptic Integrals by Piecewise Minimax Rational Function Approximation},
127+
author = {Fukushima, Toshio},
128+
date = {2015-07},
129+
year = {2015},
130+
journal = {Journal of Computational and Applied Mathematics},
131+
volume = {282},
132+
pages = {71--76},
133+
issn = {03770427},
134+
doi = {10.1016/j.cam.2014.12.038},
135+
url = {https://www.sciencedirect.com/science/article/pii/S0377042715000023},
136+
langid = {english}
137+
}
138+
139+
@article{lenth_1987,
140+
title = {Algorithm AS 226: Computing Noncentral Beta Probabilities},
141+
shorttitle = {Algorithm AS 226},
142+
author = {Lenth, Russell V.},
143+
date = {1987},
144+
year = {1987},
145+
journal = {Applied Statistics},
146+
volume = {36},
147+
number = {2},
148+
eprint = {10.2307/2347558},
149+
eprinttype = {jstor},
150+
pages = {241},
151+
issn = {00359254},
152+
doi = {10.2307/2347558},
153+
url = {https://www.jstor.org/stable/10.2307/2347558?origin=crossref},
154+
urldate = {2025-02-19}
155+
}
156+
157+
@article{macleod_1996,
158+
title = {Rational Approximations, Software and Test Methods for Sine and Cosine Integrals},
159+
author = {MacLeod, Allan J.},
160+
date = {1996-09},
161+
year = {1996},
162+
journal = {Numerical Algorithms},
163+
shortjournal = {Numer. Algor.},
164+
volume = {12},
165+
number = {2},
166+
pages = {259--272},
167+
issn = {1017-1398, 1572-9265},
168+
doi = {10.1007/BF02142806},
169+
url = {http://link.springer.com/10.1007/BF02142806},
170+
langid = {english}
171+
}

src/bessel.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ end
760760
"""
761761
sphericalbesselj(nu, x)
762762
763-
Spherical bessel function of the first kind at order `nu`, ``j_ν(x)``. This is the non-singular
763+
Spherical Bessel function of the first kind at order `nu`, ``j_ν(x)``. This is the non-singular
764764
solution to the radial part of the Helmholz equation in spherical coordinates.
765765
"""
766766
function sphericalbesselj(nu, x::T) where {T}
@@ -775,7 +775,7 @@ end
775775
"""
776776
sphericalbessely(nu, x)
777777
778-
Spherical bessel function of the second kind at order `nu`, ``y_ν(x)``. This is
778+
Spherical Bessel function of the second kind at order `nu`, ``y_ν(x)``. This is
779779
the singular solution to the radial part of the Helmholz equation in spherical
780780
coordinates. Sometimes known as a spherical Neumann function.
781781
"""

src/beta_inc.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ External links:
190190
See also: [`beta_inc`](@ref)
191191
192192
# Implementation
193-
`BFRAC(A,B,X,Y,LAMBDA,EPS)` from Didonato and Morris (1982)
193+
`BFRAC(A,B,X,Y,LAMBDA,EPS)` from [Didonato and Morris (1992)](@cite didonato_1992)
194194
"""
195195
function beta_inc_cont_fraction(a::Float64, b::Float64, x::Float64, y::Float64, lambda::Float64, epps::Float64)
196196
@assert a > 1.0
@@ -260,7 +260,7 @@ External links:
260260
See also: [`beta_inc`](@ref)
261261
262262
# Implementation
263-
`BASYM(A,B,LAMBDA,EPS)` from Didonato and Morris (1982)
263+
`BASYM(A,B,LAMBDA,EPS)` from [Didonato and Morris (1992)](@cite didonato_1992)
264264
"""
265265
function beta_inc_asymptotic_symmetric(a::Float64, b::Float64, lambda::Float64, epps::Float64)
266266
@assert a >= 15.0
@@ -443,7 +443,7 @@ External links:
443443
See also: [`beta_inc`](@ref)
444444
445445
# Implementation
446-
`FPSER(A,B,X,EPS)` from Didonato and Morris (1982)
446+
`FPSER(A,B,X,EPS)` from [Didonato and Morris (1992)](@cite didonato_1992)
447447
"""
448448
function beta_inc_power_series2(a::Float64, b::Float64, x::Float64, epps::Float64)
449449
@assert b < epps*min(1.0, a)
@@ -489,7 +489,7 @@ External links:
489489
See also: [`beta_inc`](@ref)
490490
491491
# Implementation
492-
`APSER(A,B,X,EPS)` from Didonato and Morris (1982)
492+
`APSER(A,B,X,EPS)` from [Didonato and Morris (1992)](@cite didonato_1992)
493493
"""
494494
function beta_inc_power_series1(a::Float64, b::Float64, x::Float64, epps::Float64)
495495
@assert a <= epps*min(1.0, b)
@@ -534,7 +534,7 @@ External links:
534534
See also: [`beta_inc`](@ref)
535535
536536
# Implementation
537-
`BPSER(A,B,X,EPS)` from Didonato and Morris (1982)
537+
`BPSER(A,B,X,EPS)` from [Didonato and Morris (1992)](@cite didonato_1992)
538538
"""
539539
function beta_inc_power_series(a::Float64, b::Float64, x::Float64, epps::Float64)
540540
@assert b <= 1.0 || b*x <= 0.7

src/betanc.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ Compute the CDF of the noncentral beta distribution given by
149149
```math
150150
I_{x}(a,b; \lambda) = \sum_{j=0}^{\infty} q(\lambda/2,j) I_{x}(a+j,b;0)
151151
```
152-
For ``\lambda < 54`` : algorithm suggested by Lenth(1987) in `ncbeta_tail(a,b,lambda,x)`.
153-
Else for ``\lambda \geq 54``: modification in Chattamvelli(1997) in
152+
For ``\lambda < 54``: algorithm suggested by [Lenth (1987)](@cite lenth_1987) in `ncbeta_tail(a,b,lambda,x)`.
153+
Else for ``\lambda \geq 54``: modification in [Chattamvelli (1997)](@cite chattamvelli_1997) in
154154
`ncbeta_poisson(a,b,lambda,x)` by using both forward and backward recurrences.
155155
"""
156156
function ncbeta(a::Float64, b::Float64, lambda::Float64, x::Float64)

src/ellip.jl

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,10 @@ See also: [`ellipe(m)`](@ref SpecialFunctions.ellipe).
2727
``\alpha`` by ``k = \sin \alpha``.
2828
2929
# Implementation
30-
Using piecewise approximation polynomial as given in
31-
> 'Fast Computation of Complete Elliptic Integrals and Jacobian Elliptic Functions',
32-
> Fukushima, Toshio. (2014). F09-FastEI. Celest Mech Dyn Astr,
33-
> DOI 10.1007/s10569-009-9228-z,
34-
> <https://pdfs.semanticscholar.org/8112/c1f56e833476b61fc54d41e194c962fbe647.pdf>
35-
36-
For ``m<0``, followed by
37-
> Fukushima, Toshio. (2014).
38-
> 'Precise, compact, and fast computation of complete elliptic integrals by piecewise
39-
> minimax rational function approximation'.
40-
> Journal of Computational and Applied Mathematics. 282.
41-
> DOI 10.13140/2.1.1946.6245.,
42-
> <https://www.researchgate.net/publication/267330394>
30+
Using piecewise approximation polynomial as given in [fukushima_2009](@citet).
31+
32+
For ``m < 0``, followed by [fukushima_2015](@citet).
33+
4334
As suggested in this paper, the domain is restricted to ``(-\infty,1]``.
4435
"""
4536
ellipk(m::Real) = _ellipk(float(m))
@@ -207,19 +198,10 @@ See also: [`ellipk(m)`](@ref SpecialFunctions.ellipk).
207198
``\alpha`` by ``k=\sin \alpha``.
208199
209200
# Implementation
210-
Using piecewise approximation polynomial as given in
211-
> 'Fast Computation of Complete Elliptic Integrals and Jacobian Elliptic Functions',
212-
> Fukushima, Toshio. (2014). F09-FastEI. Celest Mech Dyn Astr,
213-
> DOI 10.1007/s10569-009-9228-z,
214-
> <https://pdfs.semanticscholar.org/8112/c1f56e833476b61fc54d41e194c962fbe647.pdf>
215-
216-
For ``m<0``, followed by
217-
> Fukushima, Toshio. (2014).
218-
> 'Precise, compact, and fast computation of complete elliptic integrals by piecewise
219-
> minimax rational function approximation'.
220-
> Journal of Computational and Applied Mathematics. 282.
221-
> DOI 10.13140/2.1.1946.6245.,
222-
> <https://www.researchgate.net/publication/267330394>
201+
Using piecewise approximation polynomial as given in [fukushima_2015](@citet)
202+
203+
For ``m<0``, followed by [fukushima_2015](@citet).
204+
223205
As suggested in this paper, the domain is restricted to ``(-\infty,1]``.
224206
"""
225207
ellipe(m::Real) = _ellipe(float(m))

src/erf.jl

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,8 @@ External links:
244244
See also: [`erf(x)`](@ref erf).
245245
246246
# Implementation
247-
Using the rational approximants tabulated in:
248-
> J. M. Blair, C. A. Edwards, and J. H. Johnson,
249-
> "Rational Chebyshev approximations for the inverse of the error function",
250-
> Math. Comp. 30, pp. 827--830 (1976).
251-
> <https://doi.org/10.1090/S0025-5718-1976-0421040-7>,
252-
> <http://www.jstor.org/stable/2005402>
253-
combined with Newton iterations for `BigFloat`.
247+
Using the rational approximants tabulated in [Blair (1976)](@cite blair_1976) combined with
248+
Newton iterations for `BigFloat`.
254249
"""
255250
erfinv(x::Real) = _erfinv(float(x))
256251

@@ -431,12 +426,7 @@ External links:
431426
See also: [`erfc(x)`](@ref erfc).
432427
433428
# Implementation
434-
Using the rational approximants tabulated in:
435-
> J. M. Blair, C. A. Edwards, and J. H. Johnson,
436-
> "Rational Chebyshev approximations for the inverse of the error function",
437-
> Math. Comp. 30, pp. 827--830 (1976).
438-
> <https://doi.org/10.1090/S0025-5718-1976-0421040-7>,
439-
> <http://www.jstor.org/stable/2005402>
429+
Using the rational approximants tabulated in [Blair (1976)](@cite blair_1976)
440430
combined with Newton iterations for `BigFloat`.
441431
"""
442432
erfcinv(x::Real) = _erfcinv(float(x))

0 commit comments

Comments
 (0)