Skip to content

Commit 82cec36

Browse files
Revert "faster hypot(::IEEEFloat...) (#48130)" (#48436)
This reverts commit 80f6f2a.
1 parent 80f6f2a commit 82cec36

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

base/math.jl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -841,17 +841,6 @@ function _hypot(x::NTuple{N,<:Number}) where {N}
841841
end
842842
end
843843

844-
function _hypot(x::NTuple{N,T}) where {N,T<:IEEEFloat}
845-
infT = convert(T, Inf)
846-
x = abs.(x) # doesn't change result but enables computational shortcuts
847-
any(==(infT), x) && return infT # return Inf even if an argument is NaN
848-
maxabs = reinterpret(T, maximum(z -> reinterpret(Signed, z), x)) # for abs(::IEEEFloat) values, a ::BitInteger cast does not change the result
849-
iszero(maxabs) && return maxabs
850-
y = abs2.(x ./ maxabs)
851-
a2 = @fastmath reduce(+, y) # allow sum to be reordered
852-
return sqrt(a2) * maxabs
853-
end
854-
855844
atan(y::Real, x::Real) = atan(promote(float(y),float(x))...)
856845
atan(y::T, x::T) where {T<:AbstractFloat} = Base.no_op_err("atan", T)
857846

0 commit comments

Comments
 (0)