Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DocumenterCitations.jl to manage dependencies #486

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"

[sources]
SpecialFunctions = {path = ".."}

[compat]
Documenter = "~0.27"
Documenter = "1"
10 changes: 9 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
using SpecialFunctions, Documenter
using DocumenterCitations

# `using SpecialFunctions` for all doctests
DocMeta.setdocmeta!(SpecialFunctions, :DocTestSetup, :(using SpecialFunctions); recursive=true)

bib = CitationBibliography(
joinpath(@__DIR__, "src", "refs.bib");
style = :authoryear,
)

makedocs(modules=[SpecialFunctions],
sitename="SpecialFunctions.jl",
authors="Jeff Bezanson, Stefan Karpinski, Viral B. Shah, et al.",
format = Documenter.HTML(; assets = String[]),
pages=["Home" => "index.md",
"Overview" => "functions_overview.md",
"Reference" => "functions_list.md"],
#warnonly=[:missing_docs],
plugins=[bib],
checkdocs=:exports,
)

deploydocs(repo="github.com/JuliaMath/SpecialFunctions.jl.git")
4 changes: 4 additions & 0 deletions docs/src/functions_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,7 @@ ellipe
eta
zeta
```

## Citations
```@bibliography
```
10 changes: 5 additions & 5 deletions docs/src/functions_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ Here the *Special Functions* are listed according to the structure of [NIST Digi
| [`digamma(x)`](@ref SpecialFunctions.digamma) | [digamma function](https://en.wikipedia.org/wiki/Digamma_function) (i.e. the derivative of `loggamma` at `x`) |
| [`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) |
| [`trigamma(x)`](@ref SpecialFunctions.trigamma) | [trigamma function](https://en.wikipedia.org/wiki/Trigamma_function) (i.e the logarithmic second derivative of `gamma` at `x`) |
| [`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`) |
| [`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`) |
| [`gamma(a,z)`](@ref SpecialFunctions.gamma(::Number,::Number)) | [upper incomplete gamma function ``\Gamma(a,z)``](https://en.wikipedia.org/wiki/Incomplete_gamma_function) |
| [`loggamma(a,z)`](@ref SpecialFunctions.loggamma(::Number,::Number)) | accurate `log(gamma(a,x))` for large arguments |
| [`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)) |
| [`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) |
| [`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)) |
| [`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``) |
| [`beta(x,y)`](@ref SpecialFunctions.beta) | [beta function](https://en.wikipedia.org/wiki/Beta_function) at `x,y` |
| [`logbeta(x,y)`](@ref SpecialFunctions.logbeta) | accurate `log(beta(x,y))` for large `x` or `y` |
| [`logabsbeta(x,y)`](@ref SpecialFunctions.logabsbeta) | accurate `log(abs(beta(x,y)))` for large `x` or `y` |
| [`logabsbinomial(x,y)`](@ref SpecialFunctions.logabsbinomial) | accurate `log(abs(binomial(n,k)))` for large `n` and `k` near `n/2` |
| [`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)) |
| [`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``) |
| [`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)) |
| [`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``) |


## Exponential and Trigonometric Integrals
Expand Down
171 changes: 171 additions & 0 deletions docs/src/refs.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
@article{berry_1990,
title = {Algorithm AS R83: A Remark on Algorithm AS 109: Inverse of the Incomplete Beta Function Ratio},
ISSN = {00359254, 14679876},
URL = {http://www.jstor.org/stable/2347779},
author = {K. J. Berry and P. W. Mielke and G. W. Cran},
journal = {Journal of the Royal Statistical Society. Series C (Applied Statistics)},
number = {2},
pages = {309--310},
publisher = {Royal Statistical Society, Oxford University Press},
volume = {39},
year = {1990}
}

@article{blair_1976,
title = {Rational Chebyshev Approximations for the Inverse of the Error Function},
author = {Blair, J. M. and Edwards, C. A. and Johnson, J. H.},
date = {1976},
year = {1976},
journal = {Mathematics of Computation},
shortjournal = {Math. Comp.},
volume = {30},
number = {136},
pages = {827--830},
issn = {0025-5718, 1088-6842},
doi = {10.1090/S0025-5718-1976-0421040-7},
url = {https://www.ams.org/mcom/1976-30-136/S0025-5718-1976-0421040-7/},
langid = {english}
}

@article{brent_1978,
title = {A Fortran Multiple-Precision Arithmetic Package},
author = {Brent, Richard P.},
date = {1978-03},
year = {1978},
journal = {ACM Transactions on Mathematical Software},
shortjournal = {ACM Trans. Math. Softw.},
volume = {4},
number = {1},
pages = {57--70},
issn = {0098-3500, 1557-7295},
doi = {10.1145/355769.355775},
url = {https://dl.acm.org/doi/10.1145/355769.355775},
langid = {english}
}

@article{cran_1977,
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},
author = {Cran, G. W. and Martin, K. J. and Thomas, G. E.},
journal = {Journal of the Royal Statistical Society. Series C (Applied Statistics)},
number = {1},
issn = {00359254, 14679876},
url = {http://www.jstor.org/stable/2346887},
pages = {111--114},
publisher = {Royal Statistical Society, Oxford University Press},
volume = {26},
year = {1977}
}

@article{chattamvelli_1997,
title = {Computing the Non-Central Beta Distribution Function},
author = {Chattamvelli, R. and Shanmugam, F.},
date = {1997-03-01},
year = {1997},
journal = {Journal of the Royal Statistical Society Series C: Applied Statistics},
volume = {46},
number = {1},
pages = {146--156},
issn = {0035-9254, 1467-9876},
doi = {10.1111/1467-9876.00055},
url = {https://academic.oup.com/jrsssc/article/46/1/146/6990591},
langid = {english}
}

@article{didonato_1986,
title = {Computation of the incomplete gamma function ratios and their inverse},
author = {DiDonato, Armido R and Morris, Alfred H},
volume = {12},
issn = {0098-3500, 1557-7295},
url = {https://dl.acm.org/doi/10.1145/22721.23109},
doi = {10.1145/22721.23109},
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$.},
language = {en},
number = {4},
urldate = {2025-03-08},
journal = {ACM Transactions on Mathematical Software},
month = dec,
year = {1986},
pages = {377--393},
}


@article{didonato_1992,
title = {Algorithm 708: Significant Digit Computation of the Incomplete Beta Function Ratios},
shorttitle = {Algorithm 708},
author = {Didonato, Armido R. and Morris, Alfred H.},
date = {1992-09},
year = {1992},
journal = {ACM Transactions on Mathematical Software},
shortjournal = {ACM Trans. Math. Softw.},
volume = {18},
number = {3},
pages = {360--373},
issn = {0098-3500, 1557-7295},
doi = {10.1145/131766.131776},
url = {https://dl.acm.org/doi/10.1145/131766.131776},
langid = {english}
}

@article{fukushima_2009,
title = {Fast Computation of Complete Elliptic Integrals and Jacobian Elliptic Functions},
author = {Fukushima, Toshio},
date = {2009-12},
year = {2009},
journal = {Celestial Mechanics and Dynamical Astronomy},
shortjournal = {Celest. Mech. Dyn. Astr.},
volume = {105},
number = {4},
pages = {305--328},
issn = {0923-2958, 1572-9478},
doi = {10.1007/s10569-009-9228-z},
url = {http://link.springer.com/10.1007/s10569-009-9228-z},
langid = {english}
}

@article{fukushima_2015,
title = {Precise and Fast Computation of Complete Elliptic Integrals by Piecewise Minimax Rational Function Approximation},
author = {Fukushima, Toshio},
date = {2015-07},
year = {2015},
journal = {Journal of Computational and Applied Mathematics},
volume = {282},
pages = {71--76},
issn = {03770427},
doi = {10.1016/j.cam.2014.12.038},
url = {https://www.sciencedirect.com/science/article/pii/S0377042715000023},
langid = {english}
}

@article{lenth_1987,
title = {Algorithm AS 226: Computing Noncentral Beta Probabilities},
shorttitle = {Algorithm AS 226},
author = {Lenth, Russell V.},
date = {1987},
year = {1987},
journal = {Applied Statistics},
volume = {36},
number = {2},
eprint = {10.2307/2347558},
eprinttype = {jstor},
pages = {241},
issn = {00359254},
doi = {10.2307/2347558},
url = {https://www.jstor.org/stable/10.2307/2347558?origin=crossref},
urldate = {2025-02-19}
}

@article{macleod_1996,
title = {Rational Approximations, Software and Test Methods for Sine and Cosine Integrals},
author = {MacLeod, Allan J.},
date = {1996-09},
year = {1996},
journal = {Numerical Algorithms},
shortjournal = {Numer. Algor.},
volume = {12},
number = {2},
pages = {259--272},
issn = {1017-1398, 1572-9265},
doi = {10.1007/BF02142806},
url = {http://link.springer.com/10.1007/BF02142806},
langid = {english}
}
4 changes: 2 additions & 2 deletions src/bessel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ end
"""
sphericalbesselj(nu, x)

Spherical bessel function of the first kind at order `nu`, ``j_ν(x)``. This is the non-singular
Spherical Bessel function of the first kind at order `nu`, ``j_ν(x)``. This is the non-singular
solution to the radial part of the Helmholz equation in spherical coordinates.
"""
function sphericalbesselj(nu, x::T) where {T}
Expand All @@ -775,7 +775,7 @@ end
"""
sphericalbessely(nu, x)

Spherical bessel function of the second kind at order `nu`, ``y_ν(x)``. This is
Spherical Bessel function of the second kind at order `nu`, ``y_ν(x)``. This is
the singular solution to the radial part of the Helmholz equation in spherical
coordinates. Sometimes known as a spherical Neumann function.
"""
Expand Down
10 changes: 5 additions & 5 deletions src/beta_inc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ External links:
See also: [`beta_inc`](@ref)

# Implementation
`BFRAC(A,B,X,Y,LAMBDA,EPS)` from Didonato and Morris (1982)
`BFRAC(A,B,X,Y,LAMBDA,EPS)` from [Didonato and Morris (1992)](@cite didonato_1992)
"""
function beta_inc_cont_fraction(a::Float64, b::Float64, x::Float64, y::Float64, lambda::Float64, epps::Float64)
@assert a > 1.0
Expand Down Expand Up @@ -260,7 +260,7 @@ External links:
See also: [`beta_inc`](@ref)

# Implementation
`BASYM(A,B,LAMBDA,EPS)` from Didonato and Morris (1982)
`BASYM(A,B,LAMBDA,EPS)` from [Didonato and Morris (1992)](@cite didonato_1992)
"""
function beta_inc_asymptotic_symmetric(a::Float64, b::Float64, lambda::Float64, epps::Float64)
@assert a >= 15.0
Expand Down Expand Up @@ -443,7 +443,7 @@ External links:
See also: [`beta_inc`](@ref)

# Implementation
`FPSER(A,B,X,EPS)` from Didonato and Morris (1982)
`FPSER(A,B,X,EPS)` from [Didonato and Morris (1992)](@cite didonato_1992)
"""
function beta_inc_power_series2(a::Float64, b::Float64, x::Float64, epps::Float64)
@assert b < epps*min(1.0, a)
Expand Down Expand Up @@ -489,7 +489,7 @@ External links:
See also: [`beta_inc`](@ref)

# Implementation
`APSER(A,B,X,EPS)` from Didonato and Morris (1982)
`APSER(A,B,X,EPS)` from [Didonato and Morris (1992)](@cite didonato_1992)
"""
function beta_inc_power_series1(a::Float64, b::Float64, x::Float64, epps::Float64)
@assert a <= epps*min(1.0, b)
Expand Down Expand Up @@ -534,7 +534,7 @@ External links:
See also: [`beta_inc`](@ref)

# Implementation
`BPSER(A,B,X,EPS)` from Didonato and Morris (1982)
`BPSER(A,B,X,EPS)` from [Didonato and Morris (1992)](@cite didonato_1992)
"""
function beta_inc_power_series(a::Float64, b::Float64, x::Float64, epps::Float64)
@assert b <= 1.0 || b*x <= 0.7
Expand Down
4 changes: 2 additions & 2 deletions src/betanc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ Compute the CDF of the noncentral beta distribution given by
```math
I_{x}(a,b; \lambda) = \sum_{j=0}^{\infty} q(\lambda/2,j) I_{x}(a+j,b;0)
```
For ``\lambda < 54`` : algorithm suggested by Lenth(1987) in `ncbeta_tail(a,b,lambda,x)`.
Else for ``\lambda \geq 54``: modification in Chattamvelli(1997) in
For ``\lambda < 54``: algorithm suggested by [Lenth (1987)](@cite lenth_1987) in `ncbeta_tail(a,b,lambda,x)`.
Else for ``\lambda \geq 54``: modification in [Chattamvelli (1997)](@cite chattamvelli_1997) in
`ncbeta_poisson(a,b,lambda,x)` by using both forward and backward recurrences.
"""
function ncbeta(a::Float64, b::Float64, lambda::Float64, x::Float64)
Expand Down
34 changes: 8 additions & 26 deletions src/ellip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,10 @@ See also: [`ellipe(m)`](@ref SpecialFunctions.ellipe).
``\alpha`` by ``k = \sin \alpha``.

# Implementation
Using piecewise approximation polynomial as given in
> 'Fast Computation of Complete Elliptic Integrals and Jacobian Elliptic Functions',
> Fukushima, Toshio. (2014). F09-FastEI. Celest Mech Dyn Astr,
> DOI 10.1007/s10569-009-9228-z,
> <https://pdfs.semanticscholar.org/8112/c1f56e833476b61fc54d41e194c962fbe647.pdf>

For ``m<0``, followed by
> Fukushima, Toshio. (2014).
> 'Precise, compact, and fast computation of complete elliptic integrals by piecewise
> minimax rational function approximation'.
> Journal of Computational and Applied Mathematics. 282.
> DOI 10.13140/2.1.1946.6245.,
> <https://www.researchgate.net/publication/267330394>
Using piecewise approximation polynomial as given in [fukushima_2009](@citet).

For ``m < 0``, followed by [fukushima_2015](@citet).

As suggested in this paper, the domain is restricted to ``(-\infty,1]``.
"""
ellipk(m::Real) = _ellipk(float(m))
Expand Down Expand Up @@ -207,19 +198,10 @@ See also: [`ellipk(m)`](@ref SpecialFunctions.ellipk).
``\alpha`` by ``k=\sin \alpha``.

# Implementation
Using piecewise approximation polynomial as given in
> 'Fast Computation of Complete Elliptic Integrals and Jacobian Elliptic Functions',
> Fukushima, Toshio. (2014). F09-FastEI. Celest Mech Dyn Astr,
> DOI 10.1007/s10569-009-9228-z,
> <https://pdfs.semanticscholar.org/8112/c1f56e833476b61fc54d41e194c962fbe647.pdf>

For ``m<0``, followed by
> Fukushima, Toshio. (2014).
> 'Precise, compact, and fast computation of complete elliptic integrals by piecewise
> minimax rational function approximation'.
> Journal of Computational and Applied Mathematics. 282.
> DOI 10.13140/2.1.1946.6245.,
> <https://www.researchgate.net/publication/267330394>
Using piecewise approximation polynomial as given in [fukushima_2015](@citet)

For ``m<0``, followed by [fukushima_2015](@citet).

As suggested in this paper, the domain is restricted to ``(-\infty,1]``.
"""
ellipe(m::Real) = _ellipe(float(m))
Expand Down
16 changes: 3 additions & 13 deletions src/erf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,8 @@ External links:
See also: [`erf(x)`](@ref erf).

# Implementation
Using the rational approximants tabulated in:
> J. M. Blair, C. A. Edwards, and J. H. Johnson,
> "Rational Chebyshev approximations for the inverse of the error function",
> Math. Comp. 30, pp. 827--830 (1976).
> <https://doi.org/10.1090/S0025-5718-1976-0421040-7>,
> <http://www.jstor.org/stable/2005402>
combined with Newton iterations for `BigFloat`.
Using the rational approximants tabulated in [Blair (1976)](@cite blair_1976) combined with
Newton iterations for `BigFloat`.
"""
erfinv(x::Real) = _erfinv(float(x))

Expand Down Expand Up @@ -431,12 +426,7 @@ External links:
See also: [`erfc(x)`](@ref erfc).

# Implementation
Using the rational approximants tabulated in:
> J. M. Blair, C. A. Edwards, and J. H. Johnson,
> "Rational Chebyshev approximations for the inverse of the error function",
> Math. Comp. 30, pp. 827--830 (1976).
> <https://doi.org/10.1090/S0025-5718-1976-0421040-7>,
> <http://www.jstor.org/stable/2005402>
Using the rational approximants tabulated in [Blair (1976)](@cite blair_1976)
combined with Newton iterations for `BigFloat`.
"""
erfcinv(x::Real) = _erfcinv(float(x))
Expand Down
Loading
Loading