Skip to content

Commit be9d79b

Browse files
authored
Update README.md
1 parent 2210f68 commit be9d79b

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Numerical routines for computing Bessel functions and modified Bessel functions
66

77
The goal of the library is to provide high quality numerical implementations of Bessel functions with high accuracy without comprimising on computational time. In general, we try to match (and often exceed) the accuracy of other open source routines such as those provided by [SpecialFunctions.jl](https://github.com/JuliaMath/SpecialFunctions.jl). There are instances where we don't quite match that desired accuracy (within a digit or two) but in general will provide implementations that are 5-10x faster (see [benchmarks](https://github.com/heltonmc/Bessels.jl/edit/update_readme/README.md#benchmarks)).
88

9-
The library currently only supports Bessel functions and modified Bessel functions of the first and second kind for negative or positive real arguments and integer and noninteger orders. We plan to support complex arguments in the future. An unexported gamma function is also provided.
9+
The library currently only supports Bessel functions and modified Bessel functions of the first and second kind for positive real arguments and integer and noninteger orders. Negative arguments are also supported only if the return value is real. We plan to support complex arguments in the future. An unexported gamma function is also provided.
1010

1111
# Quick start
1212

@@ -119,26 +119,26 @@ julia> besselk1(x)
119119

120120
### Support for negative arguments
121121

122-
Support is also provided for negative arguments and orders. However, if you use negative arguments, **real arguments could produce complex outputs**. See https://github.com/heltonmc/Bessels.jl/issues/30 for more details.
122+
Support is provided for negative arguments and orders only if the return value is real. A domain error will be thrown if the return value is complex. See https://github.com/heltonmc/Bessels.jl/issues/30 for more details.
123123

124124
```julia
125-
julia> besselj(-1.4, 12.1)
126-
0.1208208567052962
127-
128-
julia> besselj(5.8, -12.1)
129-
-0.17685468273930427 + 0.12849244828700035im
130-
131-
julia> besselj(-2.8, -12.1)
132-
0.1785554860917274 + 0.1297281542543098im
133-
134-
julia> bessely(5.8, -12.1)
135-
-0.08847808383435121 - 0.41799245618068837im
136-
137-
julia> bessely(-2.8, -12.1)
138-
0.05892453605716959 + 0.31429979079493564im
139-
140-
julia> besselk(-2.8, -12.1)
141-
-2.188744151278995e-6 - 46775.597252033134im
125+
julia> (v,x) = 13.0, -1.0
126+
julia> besseli(v,x)
127+
-1.9956316782072008e-14
128+
129+
julia> (v, x) = -14.0, -9.9
130+
julia> besseli(v,x)
131+
0.2892290867115618
132+
133+
julia> (v,x) = 12.6, -3.0
134+
julia> besseli(v,x)
135+
ERROR: DomainError with -3.0:
136+
Complex result returned for real arguments. Complex arguments are currently not supported
137+
Stacktrace:
138+
[1] besseli(nu::Float64, x::Float64)
139+
@ Bessels ~/Documents/code/repos/Bessels.jl/src/besseli.jl:176
140+
[2] top-level scope
141+
@ REPL[9]:1
142142
```
143143
#### Gamma
144144
We also provide an unexported gamma function for real arguments that can be called with `Bessels.gamma(x)`.

0 commit comments

Comments
 (0)