Skip to content

Commit edb8753

Browse files
committed
fix all tests
1 parent 2ad562d commit edb8753

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/besselj.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ function besselj_positive_args(nu::Real, x::T) where T
272272
# Shifting the order up decreases the value substantially for high orders and results in a stable forward recurrence
273273
# as the values rapidly increase
274274

275-
debye_cutoff = 2.0 + 1.00035*x + Base.Math._approx_cbrt(302.681*Float64(x))
276-
nu_shift = ceil(Int, debye_cutoff - nu)
275+
debye_cutoff = ceil(2.0 + 1.00035*x + Base.Math._approx_cbrt(302.681*Float64(x)))
276+
nu_shift = ceil(Int, debye_cutoff - floor(nu))
277277
v = nu + nu_shift
278278
jnu = besseljy_debye(v, x)[1]
279279
jnup1 = besseljy_debye(v+1, x)[1]

src/bessely.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ function bessely_positive_args(nu, x::T) where T
318318

319319
# at this point x > 19.0 (for Float64) and fairly close to nu
320320
# shift nu down and use the debye expansion for Hankel function (valid x > nu) then use forward recurrence
321-
nu_shift = ceil(nu) - floor(Int, -1.5 + x + Base.Math._approx_cbrt(-411*x)) + 4
322-
v2 = nu - maximum((nu_shift, modf(nu)[1] + 1))
321+
nu_shift = ceil(nu) - floor(Int, -1.5 + x + Base.Math._approx_cbrt(-411*x)) + 2
322+
v2 = maximum((nu - nu_shift, modf(nu)[1] + 1))
323323
return besselj_up_recurrence(x, imag(hankel_debye(v2, x)), imag(hankel_debye(v2 - 1, x)), v2, nu)[1]
324324
end
325325

src/hankel.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function besseljy_positive_args(nu::Real, x::T) where T
125125

126126
# at this point x > 19.0 (for Float64) and fairly close to nu
127127
# shift nu down and use the debye expansion for Hankel function (valid x > nu) then use forward recurrence
128-
nu_shift = floor(nu) - ceil(Int, -1.5 + x + Base.Math._approx_cbrt(-411*x))
128+
nu_shift = ceil(nu) - floor(Int, -1.5 + x + Base.Math._approx_cbrt(-411*x)) + 2
129129
v2 = maximum((nu - nu_shift, modf(nu)[1] + 1))
130130

131131
Hnu = hankel_debye(v2, x)

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ import SpecialFunctions
88
@time @testset "bessely" begin include("bessely_test.jl") end
99
@time @testset "hankel" begin include("hankel_test.jl") end
1010
@time @testset "gamma" begin include("gamma_test.jl") end
11+
@time @testset "sphericalbessel" begin include("sphericalbessel_test.jl") end

0 commit comments

Comments
 (0)