Skip to content

Commit ca873b8

Browse files
committed
comment unused code add test
1 parent 0a8076a commit ca873b8

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/asymptotics.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
besseljy_large_argument_min(::Type{Float32}) = 15.0f0
1+
#besseljy_large_argument_min(::Type{Float32}) = 15.0f0
22
besseljy_large_argument_min(::Type{Float64}) = 20.0
33
besseljy_large_argument_min(::Type{T}) where T <: AbstractFloat = 40.0
44

5-
besseljy_large_argument_cutoff(v, x::Float32) = (x > 1.2f0*v && x > besseljy_large_argument_min(Float32))
5+
#besseljy_large_argument_cutoff(v, x::Float32) = (x > 1.2f0*v && x > besseljy_large_argument_min(Float32))
66
besseljy_large_argument_cutoff(v, x::Float64) = (x > 1.65*v && x > besseljy_large_argument_min(Float64))
77
besseljy_large_argument_cutoff(v, x::T) where T = (x > 4*v && x > besseljy_large_argument_min(T))
88

@@ -39,6 +39,7 @@ function _α_αp_asymptotic(v, x::Float64)
3939
return _α_αp_poly_30(v, x)
4040
end
4141
end
42+
#=
4243
function _α_αp_asymptotic(v, x::Float32)
4344
if x > 4*v
4445
return _α_αp_poly_5(v, x)
@@ -48,7 +49,7 @@ function _α_αp_asymptotic(v, x::Float32)
4849
return _α_αp_poly_30(v, x)
4950
end
5051
end
51-
52+
=#
5253
# Float64
5354
# can only use for x > 20.0
5455
# 30 terms gives ~5e-16 relative error when x > 1.6*nu
@@ -83,6 +84,7 @@ end
8384
# a = 27.7479; b = 22.3588; c = 3.74567
8485
# this method requires significantly more terms when x gets closer to nu
8586
# so it becomes more efficient to use recurrence (or another algorithm) in this region
87+
#=
8688
function _α_αp_poly_5(v, x::T) where T
8789
xinv = inv(x)^2
8890
μ = 4 * T(v)^2
@@ -98,6 +100,7 @@ function _α_αp_poly_5(v, x::T) where T
98100
return α, αp
99101
return α, αp
100102
end
103+
=#
101104
function _α_αp_poly_10(v, x::T) where T
102105
xinv = inv(x)^2
103106
μ = 4 * v^2
@@ -118,6 +121,7 @@ function _α_αp_poly_10(v, x::T) where T
118121
return α, αp
119122
return α, αp
120123
end
124+
#=
121125
function _α_αp_poly_15(v, x::T) where T
122126
xinv = inv(x)^2
123127
μ = 4 * v^2
@@ -142,6 +146,7 @@ function _α_αp_poly_15(v, x::T) where T
142146
α = x * (evalpoly(xinv, (s0, -s1, -s2/3, -s3/5, -s4/7, -s5/9, -s6/11, -s7/13, -s8/15, -s9/17, -s10/19, -s11/21, -s12/23, -s13/25, -s14/27, -s15/29)))
143147
return α, αp
144148
end
149+
=#
145150
function _α_αp_poly_20(v, x::T) where T
146151
xinv = inv(x)^2
147152
μ = 4 * v^2

src/recurrence.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ end
3636
return jnup1, jnu
3737
end
3838

39+
#=
40+
# currently not used
3941
# backward recurrence relation for besselk and besseli
4042
# outputs both (bessel(x, nu_end), bessel(x, nu_end-1)
4143
# x = 0.1; k0 = besseli(10,x); k1 = besseli(11,x);
@@ -48,3 +50,4 @@ end
4850
end
4951
return jnup1, jnu
5052
end
53+
=#

test/gamma_test.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
x = rand(10000)*170
22
@test SpecialFunctions.gamma.(BigFloat.(x)) Bessels.gamma.(x)
33
@test SpecialFunctions.gamma.(BigFloat.(-x)) Bessels.gamma.(-x)
4+
@test isnan(Bessels.gamma(NaN))
5+
@test isinf(Bessels.gamma(Inf))

0 commit comments

Comments
 (0)