48
48
# determined by fitting a curve a + bx + (cx)^(1/3) to where debye expansions provide desired precision
49
49
50
50
# 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)
52
52
besseljy_debye_cutoff (nu, x:: Float32 ) = nu > besseljy_debye_fit (x) && nu > 6
53
53
54
54
# 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)
56
56
besseljy_debye_cutoff (nu, x:: Float64 ) = nu > besseljy_debye_fit (x) && nu > 15
57
57
58
58
# Float128 - provide roughly ~1e-35 precision
@@ -64,7 +64,7 @@ besseljy_debye_cutoff(nu, x::Float64) = nu > besseljy_debye_fit(x) && nu > 15
64
64
# ####
65
65
66
66
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)
68
68
return Uk_poly10 (p, v, p2)
69
69
else
70
70
return Uk_poly20 (p, v, p2)
@@ -110,18 +110,18 @@ end
110
110
# determined by fitting a curve a + x + (bx)^(1/3) to where debye expansions provide desired precision
111
111
112
112
# 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)
114
114
hankel_debye_cutoff (nu, x:: Float32 ) = nu < hankel_debye_fit (x)
115
115
116
116
# 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)
118
118
hankel_debye_cutoff (nu, x:: Float64 ) = nu < hankel_debye_fit (x)
119
119
120
120
# Float128
121
121
# hankel_debye_cutoff(nu, x) = nu < -2 + 0.9987*x + Base.Math._approx_cbrt(-21570.3*Float64(x))
122
122
123
123
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)
125
125
return Uk_poly10 (p, v, p2)
126
126
else
127
127
return Uk_poly20 (p, v, p2)
0 commit comments