Skip to content

Commit d99ec12

Browse files
committed
Add citations to docstrings
1 parent dd2a8ea commit d99ec12

File tree

7 files changed

+35
-68
lines changed

7 files changed

+35
-68
lines changed

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+
```

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)](@citet blair_1976)
440430
combined with Newton iterations for `BigFloat`.
441431
"""
442432
erfcinv(x::Real) = _erfcinv(float(x))

src/gamma_inc.jl

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,8 @@ and ``P(a,x)/x^a`` is given by:
504504
(1 - J) / \Gamma(a+1)
505505
```
506506
resulting from term-by-term integration of `gamma_inc(a,x,ind)`.
507-
This is used when `a < 1` and `x < 1.1` - Refer Eqn (9) in the paper.
507+
This is used when `a < 1` and `x < 1.1` - Refer Eqn (9) in the
508+
[paper by DiDonato & Morris (1986)](@cite didonato_1986).
508509
509510
See also: [`gamma_inc(a,x,ind)`](@ref SpecialFunctions.gamma_inc)
510511
"""
@@ -553,8 +554,8 @@ T(a,\lambda) = \sum_{0}^{N} c_{k}(z)a^{-k}
553554
This is a higher accuracy approximation of Temme expansion, which deals with
554555
the region near `a ≈ x` with `a` large.
555556
Refer Appendix F in the paper for the extensive set of coefficients calculated
556-
using Brent's multiple precision arithmetic(set at 50 digits) in
557-
> Brent, R. P. A Fortran multiple-precision arithmetic package, ACM Trans. Math. Softw. 4(1978), 57-70, doi: 10.1145/355769.355775.
557+
using Brent's multiple precision arithmetic (set at 50 digits) in
558+
[Brent (1978)](@cite brent_1978).
558559
559560
External links: [DLMF 8.12.8](https://dlmf.nist.gov/8.12.8)
560561
@@ -700,7 +701,7 @@ end
700701
701702
Compute using Finite Sums for ``Q(a,x)`` when `a >= 1 && 2a` is integer.
702703
Used when `a <= x <= x0` and `a = n/2`.
703-
Refer Eqn (14) in the paper.
704+
Refer Eqn (14) in the [paper by DiDonato and Morris (1986)](@cite didonato_1986).
704705
705706
See also: [`gamma_inc(a,x,ind)`](@ref SpecialFunctions.gamma_inc)
706707
"""
@@ -820,10 +821,8 @@ function gamma_inc_inv_alarge(a::Float64, minpq::Float64, pcase::Bool)
820821
fp = -sqrt(inv2π*a)*exp(-0.5*a*eta*eta)/gammax(a)
821822
return (x0, fp)
822823
end
823-
# Reference : 'Computation of the incomplete gamma function ratios and their inverse' by Armido R DiDonato, Alfred H Morris.
824-
# Published in Journal: ACM Transactions on Mathematical Software (TOMS)
825-
# Volume 12 Issue 4, Dec. 1986 Pages 377-393
826-
# doi>10.1145/22721.23109
824+
# Reference: # DiDonato & Morris (1986), doi: 10.1145/22721.23109,
825+
# citation key: didonato_1986
827826

828827
@doc raw"""
829828
gamma_inc(a,x,IND=0)
@@ -841,8 +840,10 @@ In terms of these, the lower incomplete gamma function is
841840
``\gamma(a,x) = P(a,x) \Gamma(a)`` and the upper incomplete
842841
gamma function is ``\Gamma(a,x) = Q(a,x) \Gamma(a)``.
843842
844-
`IND ∈ [0,1,2]` sets accuracy: `IND=0` means 14 significant digits accuracy,
845-
`IND=1` means 6 significant digit, and `IND=2` means only 3 digit accuracy.
843+
`IND ∈ [0,1,2]` sets accuracy:
844+
- `IND=0` means 14 significant digits accuracy,
845+
- `IND=1` means 6 significant digit, and
846+
- `IND=2` means only 3 digit accuracy.
846847
847848
External links:
848849
[DLMF 8.2.4](https://dlmf.nist.gov/8.2.4),

src/sincosint.jl

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,7 @@ External links:
245245
See also: [`cosint(x)`](@ref SpecialFunctions.cosint).
246246
247247
# Implementation
248-
Using the rational approximants tabulated in:
249-
> A.J. MacLeod,
250-
> "Rational approximations, software and test methods for sine and cosine integrals",
251-
> Numer. Algor. 12, pp. 259--272 (1996).
252-
> <https://doi.org/10.1007/BF02142806>,
253-
> <https://link.springer.com/article/10.1007/BF02142806>.
248+
Using the rational approximants tabulated in [MacLeod (1996)](@cite macleod_1996).
254249
255250
Note: the second zero of ``\text{Ci}(x)`` has a typo that is fixed:
256251
``r_1 = 3.38418 0422\mathbf{8} 51186 42639 78511 46402`` in the article, but is in fact:
@@ -278,12 +273,7 @@ External links:
278273
See also: [`sinint(x)`](@ref SpecialFunctions.sinint).
279274
280275
# Implementation
281-
Using the rational approximants tabulated in:
282-
> A.J. MacLeod,
283-
> "Rational approximations, software and test methods for sine and cosine integrals",
284-
> Numer. Algor. 12, pp. 259--272 (1996).
285-
> <https://doi.org/10.1007/BF02142806>,
286-
> <https://link.springer.com/article/10.1007/BF02142806>.
276+
Using the rational approximants tabulated in [MacLeod (1996)](@cite macleod_1996).
287277
288278
Note: the second zero of ``\text{Ci}(x)`` has a typo that is fixed:
289279
``r_1 = 3.38418 0422\mathbf{8} 51186 42639 78511 46402`` in the article, but is in fact:

0 commit comments

Comments
 (0)