Skip to content

Commit 80c93a0

Browse files
committed
update cbrt
1 parent 08be663 commit 80c93a0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/U_polynomials.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ end
4848
# determined by fitting a curve a + bx + (cx)^(1/3) to where debye expansions provide desired precision
4949

5050
# Float32
51-
besseljy_debye_fit(x::Float32) = 2.5f0 + 1.00035f0*x + Base.Math._approx_cbrt(360.0f0*x)
51+
besseljy_debye_fit(x::Float32) = 2.5f0 + 1.00035f0*x + 7.114f0*Base.Math._approx_cbrt(x)
5252
besseljy_debye_cutoff(nu, x::Float32) = nu > besseljy_debye_fit(x) && nu > 6
5353

5454
# Float64
55-
besseljy_debye_fit(x::Float64) = 2.0 + 1.00035*x + Base.Math._approx_cbrt(302.681*x)
55+
besseljy_debye_fit(x::Float64) = 2.0 + 1.00035*x + 6.714*Base.Math._approx_cbrt(x)
5656
besseljy_debye_cutoff(nu, x::Float64) = nu > besseljy_debye_fit(x) && nu > 15
5757

5858
# Float128 - provide roughly ~1e-35 precision
@@ -64,7 +64,7 @@ besseljy_debye_cutoff(nu, x::Float64) = nu > besseljy_debye_fit(x) && nu > 15
6464
#####
6565

6666
function Uk_poly_Jn(p, v, p2, x::Float64)
67-
if v > 5.0 + 1.00033*x + Base.Math._approx_cbrt(1427.61*x)
67+
if v > 5.0 + 1.00033*x + 11.26*Base.Math._approx_cbrt(x)
6868
return Uk_poly10(p, v, p2)
6969
else
7070
return Uk_poly20(p, v, p2)
@@ -110,18 +110,18 @@ end
110110
# determined by fitting a curve a + x + (bx)^(1/3) to where debye expansions provide desired precision
111111

112112
# Float32
113-
hankel_debye_fit(x::Float32) = -3.5f0 + x + Base.Math._approx_cbrt(-411.0f0*x)
113+
hankel_debye_fit(x::Float32) = -3.5f0 + x + 7.435f0*Base.Math._approx_cbrt(-x)
114114
hankel_debye_cutoff(nu, x::Float32) = nu < hankel_debye_fit(x)
115115

116116
# Float64
117-
hankel_debye_fit(x::Float64) = 0.2 + x + Base.Math._approx_cbrt(-411.0*x)
117+
hankel_debye_fit(x::Float64) = 0.2 + x + 7.435*Base.Math._approx_cbrt(-x)
118118
hankel_debye_cutoff(nu, x::Float64) = nu < hankel_debye_fit(x)
119119

120120
# Float128
121121
#hankel_debye_cutoff(nu, x) = nu < -2 + 0.9987*x + Base.Math._approx_cbrt(-21570.3*Float64(x))
122122

123123
function Uk_poly_Hankel(p, v, p2, x::T) where T <: Float64
124-
if v < 5.0 + 0.998*x + Base.Math._approx_cbrt(-1171.34*x)
124+
if v < 5.0 + 0.998*x + 10.541*Base.Math._approx_cbrt(-x)
125125
return Uk_poly10(p, v, p2)
126126
else
127127
return Uk_poly20(p, v, p2)

0 commit comments

Comments
 (0)