Skip to content

Commit

Permalink
Loosen Float16 tolerances slightly to pass PkgEval
Browse files Browse the repository at this point in the history
  • Loading branch information
moble committed Jul 16, 2022
1 parent 577524c commit 40b8b96
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/conversion.jl
Original file line number Diff line number Diff line change
@@ -255,7 +255,7 @@ function from_euler_phases(zₐ, zᵦ, zᵧ)
Rotor(zb.re * zp.re, -zb.im * zm.im, zb.im * zm.re, zb.re * zp.im)
end
from_euler_phases(z) = from_euler_phases(z...)


"""
to_spherical_coordinates(q)
@@ -319,7 +319,7 @@ for non-orthogonal matrices. [J. Guidance, Vol. 23, No. 6,
p. 1085](http://dx.doi.org/10.2514/2.4654)
"""
function from_rotation_matrix(ℛ)
function from_rotation_matrix(ℛ::AbstractMatrix)
@assert size(ℛ) == (3, 3)
@inbounds begin
K = Array{eltype(ℛ), 2}(undef, (4, 4))
2 changes: 1 addition & 1 deletion test/conversion.jl
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@

@testset "Euler phases" begin
N = 5_000
ϵ = (T === Float16 ? 22eps(T) : 10eps(T))
ϵ = (T === Float16 ? 25eps(T) : 10eps(T))

dumb_to_euler_phases(α, β, γ) = [exp*im), exp*im), exp*im)]

4 changes: 3 additions & 1 deletion test/math.jl
Original file line number Diff line number Diff line change
@@ -62,7 +62,9 @@
for s S
cval = binary_function(c, float(s))
qval = ℍ_to_ℂ(binary_function(q, s), component)
@test cval qval rtol=6ϵ nans=true
let ϵ = (T === Float16 ? 10ϵ/6 : ϵ)
@test cval qval rtol=6ϵ nans=true
end
if !iszero(c)
cval = binary_function(c/abs(c), s)
qval = ℍ_to_ℂ(binary_function(Rotor(q), s), component)

0 comments on commit 40b8b96

Please sign in to comment.