Skip to content

Commit aa9eb3b

Browse files
committed
add _approx_cbrt
1 parent 3bd7a96 commit aa9eb3b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/U_polynomials.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function Uk_poly_Jn(p, v, p2, x::T) where T <: Float64
2-
if v > 5.0 + 1.00033*x + cbrt(1427.61*x)
2+
if v > 5.0 + 1.00033*x + Base.Math._approx_cbrt(1427.61*Float64(x))
33
return Uk_poly10(p, v, p2, even_odd_poly_minus)
44
else
55
return Uk_poly20(p, v, p2, even_odd_poly_minus)

src/besselj.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ function _besselj(nu, x)
166166
(x > large_arg_cutoff && x > 20.0) && return besselj_large_argument(nu, x)
167167

168168

169-
debye_cutoff = 2.0 + 1.00035*x + cbrt(302.681*x)
169+
debye_cutoff = 2.0 + 1.00035*x + Base.Math._approx_cbrt(302.681*Float64(x))
170170
nu > debye_cutoff && return besselj_debye(nu, x)
171171

172172
if nu >= x
173-
nu_shift = ceil(Int, 5.2 + 1.00033*x + (1427.61*x)^(1/3) - nu)
173+
nu_shift = ceil(Int, debye_cutoff - nu)
174174
v = nu + nu_shift
175175
arr = range(v, stop = nu, length = nu_shift + 1)
176176
jnu = besselj_debye(v, x)
@@ -182,7 +182,7 @@ function _besselj(nu, x)
182182
# in this region forward recurrence is stable
183183
# we must decide if we should do backward recurrence if we are closer to debye accuracy
184184
# or if we should do forward recurrence if we are closer to large argument expansion
185-
debye_cutoff = 5.0 + 1.00033*x + (1427.61*x)^(1/3)
185+
debye_cutoff = 5.0 + 1.00033*x + Base.Math._approx_cbrt(1427.61*Float64(x))
186186

187187
debye_diff = debye_cutoff - nu
188188
large_arg_diff = nu - x / 2.0

0 commit comments

Comments
 (0)