-
-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Labels
performanceMust go fasterMust go faster
Description
julia> using StableRNGs
julia> rng = StableRNG(0)
StableRNGs.LehmerRNG(state=0x00000000000000000000000000000001)
julia> sqrt(rand(rng,3,3))
3×3 Matrix{ComplexF64}:
0.410548+0.369007im 0.49482-0.209855im 0.394519-0.231836im
-0.00928873+0.0595217im 0.935186-0.0338502im 0.11389-0.0373957im
0.661866-0.458654im -0.0589303+0.260838im 0.524852+0.288158im
julia> sqrt(rand(rng,3,3))
3×3 Matrix{Float64}:
0.301226 0.392135 -0.452243
0.183647 0.25732 1.14379
0.185353 -0.0785732 0.578105For scalars, we throw when sqrting a negative unless the negative is of a complex type in which case we return a complex result. IMO that is a much better solution. Switching to that would be breaking in the case of square rooting real matrices with negative real eigenvalues.
Metadata
Metadata
Assignees
Labels
performanceMust go fasterMust go faster