Milan Klöwer
Milan Klöwer
I had defined it in https://github.com/milankl/ShallowWaters.jl/pull/78 but then removed again you can reactivate that code!!
> This test works for me locally... Yes, it depends on the state of your RNG. There's probably a small subset of Float16s where something odd happens and you'd likely...
@avleenk2312 Apparently it's a problem with the subnormals in Float16sr, but only one of them ```julia [ Info: Test failed for -3.874302f-6, 1000000001000001 ``` The bits are Float16 which the...
Yes, I agree one could redefine what up/down means in the case the result is already exact in the subnormals. But it shouldn't solve the problem: The subnormals are currently...
If we make $\epsilon$ smaller, i.e. ```julia const ϵ = prevfloat(Float32(nextfloat(zero(Float16))),2^8+1) ``` `5.960373f-8` instead of `5.960464f-8` it works ```julia julia> sum(h(x) .== -1) 0 julia> sum(h(x) .== 0) 8388608 julia>...
I've just implemented a float-arithmetic free version as ```julia function Float16_stochastic_round(x::Float32) rbits = rand(Xor128[],UInt32) # create random bits ui = reinterpret(UInt32,x) shift = ((0x7f800000 & ui) >> 23) - 103...
Reopened as the problem apparently perists, see failed test in [b4b3068](https://github.com/milankl/StochasticRounding.jl/pull/61/commits/b4b30681e9eea1e94ef1e182311cb22d096063b7) from #61
Solved with [20aa678](https://github.com/milankl/StochasticRounding.jl/pull/73/commits/20aa6782674afa4b80db6b66bcc627156632262f) the random perturbation for Float16sr subnormals is made somewhat smaller with a tweaked mask ```julia function rand_subnormal(rbits::UInt32) lz = leading_zeros(rbits) # count leading zeros for correct probabilities...
Stupid subnormals, there's still something wrong here ```julia [ Info: 5.5491924e-5 although in [Float16(5.55e-5),Float16(5.555e-5)] was rounded to Float16(5.543e-5) [ Info: 5.5491924e-5 although in [Float16(5.55e-5),Float16(5.555e-5)] was rounded to Float16(5.543e-5) Test for...
Reopen due the last post ☝🏼