130
130
@test erfcinv (one (Int)) == erfcinv (1.0 )
131
131
132
132
# airy
133
- @test_approx_eq airy (1.8 ) 0.0470362168668458052247
134
133
@test_approx_eq airy (1.8 ) airyai (1.8 )
135
134
@test_approx_eq airyprime (1.8 ) - 0.0685247801186109345638
136
135
@test_approx_eq airyaiprime (1.8 ) airyprime (1.8 )
@@ -140,12 +139,16 @@ end
140
139
@test_throws Base. Math. AmosException airybi (200 )
141
140
@test_throws ArgumentError airy (5 ,one (Complex128))
142
141
z = 1.8 + 1.0im
143
- @test_approx_eq airyx (z) airyx (0 ,z)
144
- @test_approx_eq airyx (0 , z) airy (0 , z) * exp (2 / 3 * z * sqrt (z))
145
- @test_approx_eq airyx (1 , z) airy (1 , z) * exp (2 / 3 * z * sqrt (z))
146
- @test_approx_eq airyx (2 , z) airy (2 , z) * exp (- abs (real (2 / 3 * z * sqrt (z))))
147
- @test_approx_eq airyx (3 , z) airy (3 , z) * exp (- abs (real (2 / 3 * z * sqrt (z))))
148
- @test_throws ArgumentError airyx (5 ,z)
142
+ for elty in [Complex64,Complex128]
143
+ @test_approx_eq airy (convert (elty,1.8 )) 0.0470362168668458052247
144
+ z = convert (elty,z)
145
+ @test_approx_eq airyx (z) airyx (0 ,z)
146
+ @test_approx_eq airyx (0 , z) airy (0 , z) * exp (2 / 3 * z * sqrt (z))
147
+ @test_approx_eq airyx (1 , z) airy (1 , z) * exp (2 / 3 * z * sqrt (z))
148
+ @test_approx_eq airyx (2 , z) airy (2 , z) * exp (- abs (real (2 / 3 * z * sqrt (z))))
149
+ @test_approx_eq airyx (3 , z) airy (3 , z) * exp (- abs (real (2 / 3 * z * sqrt (z))))
150
+ @test_throws ArgumentError airyx (5 ,z)
151
+ end
149
152
150
153
# bessely0, bessely1, besselj0, besselj1
151
154
@test_approx_eq besselj0 (Float32 (2.0 )) besselj0 (Float64 (2.0 ))
@@ -206,6 +209,7 @@ j43 = besselj(4,3.)
206
209
@test_approx_eq besselj (0.1 , complex (- 0.4 )) 0.820421842809028916 + 0.266571215948350899im
207
210
@test_approx_eq besselj (3.2 , 1.3 + 0.6im ) 0.01135309305831220201 + 0.03927719044393515275im
208
211
@test_approx_eq besselj (1 , 3im ) 3.953370217402609396im
212
+ @test_approx_eq besselj (1.0 ,3im ) besselj (1 ,3im )
209
213
@test_throws Base. Math. AmosException besselj (20 ,1000im )
210
214
211
215
# besselk
@@ -234,6 +238,12 @@ y33 = bessely(3,3.)
234
238
@test_throws DomainError bessely (0.4 ,Float32 (- 1.0 ))
235
239
@test_throws DomainError bessely (1 ,Float32 (- 1.0 ))
236
240
241
+ # besselhx
242
+ for elty in [Complex64,Complex128]
243
+ z = convert (elty, 1.0 + 1.9im )
244
+ @test_approx_eq besselhx (1.0 , 1 , z) convert (elty,- 0.5949634147786144 - 0.18451272807835967im )
245
+ end
246
+
237
247
# issue #6653
238
248
for f in (besselj,bessely,besseli,besselk,hankelh1,hankelh2)
239
249
@test_approx_eq f (0 ,1 ) f (0 ,Complex128 (1 ))
0 commit comments