We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4be7c42 commit 74fe3e4Copy full SHA for 74fe3e4
src/utils.jl
@@ -91,8 +91,9 @@ end
91
# expω(w,q=1) = I + sin(norm(w)*q)/norm(w)*skew(w) + (1-cos(norm(w)*q))/norm(w)^2*skew(w)^2 # verified to work
92
93
function expω(w,q=1)
94
- nw = norm(w)
95
- if nw < 1e-12 # TODO: Use TaylorSeries.jl to approximate this for small nw, I verified TaylorSeries.jl to work well for this
+ # nw = norm(w) # norm of staticarray is too inaccurate, causing ForwardDiff to NaN https://github.com/JuliaArrays/StaticArrays.jl/issues/913
+ nw = LinearAlgebra.generic_norm2(w)
96
+ if nw < 1e-12
97
tmp = (nw*q)^2
98
I + (1-tmp/6)*q*skew(w) + (0.5 - tmp/24)*(q*skew(w))^2
99
else
0 commit comments