Skip to content

Commit

Permalink
Merge pull request #89 from goggle/typos01
Browse files Browse the repository at this point in the history
Correct some typos
  • Loading branch information
heltonmc authored Apr 8, 2023
2 parents a94bb7f + 1802c2e commit 6a3eed7
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion docs/src/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ In general, Bessels.jl aims to provide highly accurate implementations. We do no

Even if the function isn't quite to those error tolerances, please open a pull request to discuss further. It might be good for a single precision implementation or there might be opportunities to improve the errors of the existing implementation. Though, there are fairly strict criteria that the function should be non-allocating and type stable.

**2. Improving exisiting function**
**2. Improving existing function**

Improving the accuracy or speed of any implementation would be a great contribution. There are plenty of opportunities so please open an issue if you are interested and we can point you to a good function to work with. Accuracy improvements are always welcome whereas any speed improvements would also need to maintain the current level of accuracy. Ideally, implementations could trend to more accurate and faster but there will always be some tradeoff.

Expand Down
4 changes: 2 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

Bessels.jl is a collection of mathematical algorithms to compute special functions written entirely in the Julia programming language. It is focused on providing high quality implementations of mathematical functions that are accurate and highly performant. Since it contains only Julia code and has no external dependencies, it is a lightweight package that can be used in any high performance application while taking advatnage of the dynamism of the Julia language.

Bessels.jl contains numerous definitions of special functions important in many fields of mathematical physics. Available functions include Bessel, Modified Bessel, Spherical Bessel, Airy, Hankel, and Gamma functions. A full list of availabe functions can be found in the API section of this documentation. Initial development has focused on providing implementations for real arguments, however, some functions (e.g., Airy) also accept complex numbers as input.
Bessels.jl contains numerous definitions of special functions important in many fields of mathematical physics. Available functions include Bessel, Modified Bessel, Spherical Bessel, Airy, Hankel, and Gamma functions. A full list of available functions can be found in the API section of this documentation. Initial development has focused on providing implementations for real arguments, however, some functions (e.g., Airy) also accept complex numbers as input.

## Scope

Bessels.jl started simply as a package to compute just the Bessel function of the first kind and zero order, but it has quickly grown to include several Bessel type functions. As mentioned earlier, Bessels.jl contains algorithms for computing Bessel, Modified Bessel, Spherical Bessel, Airy, and Hankel functions. These functions are contained in Chapters 9 and 10 of the [NIST Digitial Library of Mathematical Functions](https://dlmf.nist.gov/). However, there exists other types of related functions such as the Struve and Weber type functions contained in Chapters 11 and 12. In general, these are special cases of the confuent hypergeometric functions $_0F_1, _1F_1$, and $_1F_2$. Additionally, several other special functions such as the gamma functions are also needed to compute these types of functions.
Bessels.jl started simply as a package to compute just the Bessel function of the first kind and zero order, but it has quickly grown to include several Bessel type functions. As mentioned earlier, Bessels.jl contains algorithms for computing Bessel, Modified Bessel, Spherical Bessel, Airy, and Hankel functions. These functions are contained in Chapters 9 and 10 of the [NIST Digital Library of Mathematical Functions](https://dlmf.nist.gov/). However, there exists other types of related functions such as the Struve and Weber type functions contained in Chapters 11 and 12. In general, these are special cases of the confuent hypergeometric functions $_0F_1, _1F_1$, and $_1F_2$. Additionally, several other special functions such as the gamma functions are also needed to compute these types of functions.

Therefore, Bessels.jl seeks to be home to any Bessel or related functions (see the section provided by [mpmath](https://mpmath.org/doc/current/functions/bessel.html)) which are typically contained in Chapters 9-12 of the NIST Digital library or to any other related function required to compute Bessel type functions.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Bessels requires Julia v1.6 or later but it is recommended to use the latest sta

### Installation

Install Julia by [downloading](https://julialang.org/downloads/) the latest version from the offical site and follow the [platform specific installations](https://julialang.org/downloads/platform/).
Install Julia by [downloading](https://julialang.org/downloads/) the latest version from the official site and follow the [platform specific installations](https://julialang.org/downloads/platform/).

You can add Bessels using Julia's package manager by typing `] add Bessels` in the Julia prompt.

Expand Down
6 changes: 3 additions & 3 deletions docs/src/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ A nice list of Bessel and related functions is provided by [mpmath](https://mpma

### Develop higher precision routines

Current development has focused on single and double precison routine (`Float32` and `Float64`). We intend to also provide support for higher precision types such as double-double (`Double64`) and/or quadruple (`Float128`) precision in the future.
Current development has focused on single and double precision routine (`Float32` and `Float64`). We intend to also provide support for higher precision types such as double-double (`Double64`) and/or quadruple (`Float128`) precision in the future.

### Derivatives through automatic differentiation

Typically, the derivatives of certain special functions with respect to argument can be obtained through definitions. However, derivative with respect to the order usually does not have a simple expression. Automatic differentiation could be a powerful tool to quickly compute higher order derivatives using native Julia code. This is not an immediate goal but would be a welcome contribution.

### Accuracy and Peformance improvements
### Accuracy and Performance improvements

Speed improvements are beneficial in most cases as these low level functions are typically called many times. Performance gains can come from using better algorithms or through better support for parallelization (e.g., vectorization, SIMD). In general, any speed improvements will only be incoporated that maintain the current relative accuracy. Accuracy improvements may come at the cost of a slightly longer runtime. These type of improvements will come on a more ad-hoc basis.
Speed improvements are beneficial in most cases as these low level functions are typically called many times. Performance gains can come from using better algorithms or through better support for parallelization (e.g., vectorization, SIMD). In general, any speed improvements will only be incorporated that maintain the current relative accuracy. Accuracy improvements may come at the cost of a slightly longer runtime. These type of improvements will come on a more ad-hoc basis.
12 changes: 6 additions & 6 deletions src/asymptotics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@ end
# 20 terms gives ~2e-16 relative error when x > 2*nu
# 15 terms gives ~5e-18 relative error when x > 3*nu
# 10 terms gives ~3e-18 relative error when x > 5*nu
# 5 terms give ~5e-15 relative erros when x > 20*nu
# 3 terms give ~5e-15 relative erros when x > 50*nu
# 2 terms give ~5e-15 relative erros when x > 500*nu
# 5 terms give ~5e-15 relative errors when x > 20*nu
# 3 terms give ~5e-15 relative errors when x > 50*nu
# 2 terms give ~5e-15 relative errors when x > 500*nu

# Float32
# can only use for x > 15.0
# 30 terms gives ~2e-8 relative error when x > 1.2*nu
# 20 terms gives ~8e-8 relative error when x > 1.3*nu
# 15 terms gives ~8e-8 relative error when x > 1.4*nu
# 10 terms gives ~3e-8 relative error when x > 1.8*nu
# 5 terms give ~8e-8 relative erros when x > 4*nu
# 3 terms give ~2e-8 relative erros when x > 8*nu
# 5 terms give ~8e-8 relative errors when x > 4*nu
# 3 terms give ~2e-8 relative errors when x > 8*nu

# Float128
# can only use for x > 40.0
Expand All @@ -80,7 +80,7 @@ end
# 15 terms gives ~6e-34 relative error when x > 8.5*nu
# 10 terms gives ~3e-34 relative error when x > 30*nu

# can fit a rational function to trend (numer of terms on y axis; x/nu on x axis)
# can fit a rational function to trend (number of terms on y axis; x/nu on x axis)
# to get the number of terms needed for desired precision as function of x/nu
# terms = a / (x/nu) + b / (x/nu)^2 + c
#
Expand Down
2 changes: 1 addition & 1 deletion src/besseli.jl
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ end
# using K0 and K1 as starting values then forward recurrence up till nu
# then using the wronskian to getting I_{nu}
# in general this method is slow and depends on starting values of K0 and K1
# which is not very flexible for arbitary orders
# which is not very flexible for arbitrary orders
function _besseli_continued_fractions(nu, x::T) where T
S = promote_type(T, Float64)
Expand Down
4 changes: 2 additions & 2 deletions src/besselk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#
# K_{nu+1} = (2*nu/x)*K_{nu} + K_{nu-1}
#
# When nu is large, a large amount of recurrence is necesary.
# When nu is large, a large amount of recurrence is necessary.
# We consider uniform asymptotic expansion for large orders to more efficiently
# compute besselk(nu, x) when nu is larger than 100 (Let's double check this cutoff)
# The boundary should be carefully determined for accuracy and machine roundoff.
Expand Down Expand Up @@ -312,7 +312,7 @@ besselk_underflow_check(nu, x::T) where T = nu < T(1.45)*(x - 780) + 45*Base.Mat
"""
besselk_positive_args(x::T) where T <: Union{Float32, Float64}
Modified Bessel function of the second kind of order nu, ``K_{nu}(x)`` valid for postive arguments and orders.
Modified Bessel function of the second kind of order nu, ``K_{nu}(x)`` valid for positive arguments and orders.
"""
function besselk_positive_args(nu, x::T) where T <: Union{Float32, Float64}
iszero(x) && return T(Inf)
Expand Down
6 changes: 3 additions & 3 deletions src/bessely.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# where r1 and r2 are zeros of J0
# and P3 and Q8 are a 3 and 8 degree polynomial respectively
# Polynomial coefficients are from [1] which is based on [2].
# For tiny arugments the power series expansion is used.
# For tiny arguments the power series expansion is used.
#
# Branch 2: 5.0 < x < 25.0
# bessely0 = sqrt(2/(pi*x))*(sin(x - pi/4)*R7(x) - cos(x - pi/4)*R8(x))
Expand Down Expand Up @@ -429,7 +429,7 @@ end
Computes ``Y_{nu}(x)`` using the power series when nu is not an integer.
In general, this is most accurate for small arguments and when nu > x.
Outpus both (Y_{nu}(x), J_{nu}(x)).
Outputs both (Y_{nu}(x), J_{nu}(x)).
"""
function bessely_power_series(v, x::T) where T
MaxIter = 3000
Expand Down Expand Up @@ -550,7 +550,7 @@ const bessely_cheb_weights = (

#=
### don't quite have this right (issue with signs)
# probably not needed because we should use debye exapnsion for large nu
# probably not needed because we should use debye expansion for large nu
function log_bessely_power_series(v, x::T) where T
MaxIter = 2000
out = zero(T)
Expand Down
2 changes: 1 addition & 1 deletion test/hankel_test.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# most of the tests are contained in bessely_test and besselj_test which test the besseljy function
# which is called by hankelh1 and besselh
# here we will test just a few cases of the overal hankel function
# here we will test just a few cases of the overall hankel function
# focusing on negative arguments and reflection

v, x = 1.5, 1.3
Expand Down

0 comments on commit 6a3eed7

Please sign in to comment.