|
1 | 1 | # general array for testing input to SpecialFunctions.jl
|
2 |
| -x = 1e-6:0.01:50.0 |
3 |
| - |
| 2 | +x32 = 1e-6:0.01:50.0 |
| 3 | +x64 = 1e-6:0.01:600.0 |
4 | 4 | ### Tests for besseli0
|
5 |
| -i0_SpecialFunctions = SpecialFunctions.besseli.(0, x) |
| 5 | +i032_SpecialFunctions = SpecialFunctions.besseli.(0, x32) |
| 6 | +i064_SpecialFunctions = SpecialFunctions.besseli.(0, x64) |
| 7 | + |
6 | 8 |
|
7 |
| -i0_64 = besseli0.(Float64.(x)) |
8 |
| -i0_32 = besseli0.(Float32.(x)) |
| 9 | +i0_64 = besseli0.(Float64.(x64)) |
| 10 | +i0_32 = besseli0.(Float32.(x32)) |
9 | 11 |
|
10 | 12 | # make sure output types match input types
|
11 | 13 | @test i0_64[1] isa Float64
|
12 | 14 | @test i0_32[1] isa Float32
|
13 | 15 |
|
14 | 16 | # test against SpecialFunctions.jl
|
15 |
| -@test i0_64 ≈ i0_SpecialFunctions |
16 |
| -@test i0_32 ≈ i0_SpecialFunctions |
| 17 | +@test i0_64 ≈ i064_SpecialFunctions |
| 18 | +@test i0_32 ≈ i032_SpecialFunctions |
17 | 19 |
|
18 | 20 | ### Tests for besseli0x
|
19 |
| -i0x_SpecialFunctions = SpecialFunctions.besselix.(0, x) |
| 21 | +i0x32_SpecialFunctions = SpecialFunctions.besselix.(0, x32) |
| 22 | +i0x64_SpecialFunctions = SpecialFunctions.besselix.(0, x64) |
20 | 23 |
|
21 |
| -i0x_64 = besseli0x.(Float64.(x)) |
22 |
| -i0x_32 = besseli0x.(Float32.(x)) |
| 24 | +i0x_64 = besseli0x.(Float64.(x64)) |
| 25 | +i0x_32 = besseli0x.(Float32.(x32)) |
23 | 26 |
|
24 | 27 | # make sure output types match input types
|
25 | 28 | @test i0x_64[1] isa Float64
|
26 | 29 | @test i0x_32[1] isa Float32
|
27 | 30 |
|
28 | 31 | # test against SpecialFunctions.jl
|
29 |
| -@test i0x_64 ≈ i0x_SpecialFunctions |
30 |
| -@test i0x_32 ≈ i0x_SpecialFunctions |
| 32 | +@test i0x_64 ≈ i0x64_SpecialFunctions |
| 33 | +@test i0x_32 ≈ i0x32_SpecialFunctions |
31 | 34 |
|
32 | 35 |
|
33 | 36 | ### Tests for besseli1
|
34 |
| -i1_SpecialFunctions = SpecialFunctions.besseli.(1, x) |
| 37 | +i132_SpecialFunctions = SpecialFunctions.besseli.(1, x32) |
| 38 | +i164_SpecialFunctions = SpecialFunctions.besseli.(1, x64) |
| 39 | + |
35 | 40 |
|
36 |
| -i1_64 = besseli1.(Float64.(x)) |
37 |
| -i1_32 = besseli1.(Float32.(x)) |
| 41 | +i1_64 = besseli1.(Float64.(x64)) |
| 42 | +i1_32 = besseli1.(Float32.(x32)) |
38 | 43 |
|
39 | 44 | # make sure output types match input types
|
40 | 45 | @test i1_64[1] isa Float64
|
41 | 46 | @test i1_32[1] isa Float32
|
42 | 47 |
|
43 | 48 | # test against SpecialFunctions.jl
|
44 |
| -@test i1_64 ≈ i1_SpecialFunctions |
45 |
| -@test i1_32 ≈ i1_SpecialFunctions |
| 49 | +@test i1_64 ≈ i164_SpecialFunctions |
| 50 | +@test i1_32 ≈ i132_SpecialFunctions |
46 | 51 |
|
47 | 52 | ### Tests for besseli1x
|
48 |
| -i1x_SpecialFunctions = SpecialFunctions.besselix.(1, x) |
| 53 | +i1x32_SpecialFunctions = SpecialFunctions.besselix.(1, x32) |
| 54 | +i1x64_SpecialFunctions = SpecialFunctions.besselix.(1, x64) |
49 | 55 |
|
50 |
| -i1x_64 = besseli1x.(Float64.(x)) |
51 |
| -i1x_32 = besseli1x.(Float32.(x)) |
| 56 | +i1x_64 = besseli1x.(Float64.(x64)) |
| 57 | +i1x_32 = besseli1x.(Float32.(x32)) |
52 | 58 |
|
53 | 59 | # make sure output types match input types
|
54 | 60 | @test i1x_64[1] isa Float64
|
55 | 61 | @test i1x_32[1] isa Float32
|
56 | 62 |
|
57 | 63 | # test against SpecialFunctions.jl
|
58 |
| -@test i1x_64 ≈ i1x_SpecialFunctions |
59 |
| -@test i1x_32 ≈ i1x_SpecialFunctions |
| 64 | +@test i1x_64 ≈ i1x64_SpecialFunctions |
| 65 | +@test i1x_32 ≈ i1x32_SpecialFunctions |
0 commit comments