Skip to content

Commit 6738653

Browse files
authored
Update README.md
1 parent b4881bc commit 6738653

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ Comparing the relative speed (`SpecialFunctions.jl / Bessels.jl`) for a vector o
2323

2424
* it looks like SpecialFunctions.jl doesn't always preserve the correct input type so some of the calculations may be done in Float64. This might skew the benchmarks for `Bessels.jl` as it should have all calculations done in the lower precision.
2525

26+
```julia
27+
# SpecialFunctions.jl
28+
julia> @btime besselk(1, x) setup=(x=Float32(10.0*rand()))
29+
179.272 ns (1 allocation: 16 bytes)
30+
0.021948646168061196 # notice incorrect Float64 return type
31+
32+
# Bessels.jl
33+
julia> @btime besselk1(x) setup=(x=Float32(10.0*rand()))
34+
22.967 ns (0 allocations: 0 bytes)
35+
0.0027777348f0 # notice correct Float32 return type
36+
```
37+
2638
## Float64
2739

2840
| function | Relative speed |

0 commit comments

Comments
 (0)