From 5784cd3451efb22ad60017ac425c6e0ccecab386 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Tue, 20 Apr 2021 00:17:49 -0400 Subject: [PATCH] enable new Float16 methods for sinh and cbrt (#40534) From #39432 and #39441, these were still using their old definition due to method overwriting. --- base/math.jl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/base/math.jl b/base/math.jl index 44da5e04ea5a5..c08c25d05f112 100644 --- a/base/math.jl +++ b/base/math.jl @@ -1195,7 +1195,7 @@ include("special/log.jl") # Float16 definitions -for func in (:sin,:cos,:tan,:asin,:acos,:atan,:sinh,:cosh,:tanh,:asinh,:acosh, +for func in (:sin,:cos,:tan,:asin,:acos,:atan,:cosh,:tanh,:asinh,:acosh, :atanh,:log,:log2,:log10,:sqrt,:lgamma,:log1p) @eval begin $func(a::Float16) = Float16($func(Float32(a))) @@ -1203,13 +1203,12 @@ for func in (:sin,:cos,:tan,:asin,:acos,:atan,:sinh,:cosh,:tanh,:asinh,:acosh, end end -for func in (:exp,:exp2,:exp10) +for func in (:exp,:exp2,:exp10,:sinh) @eval $func(a::ComplexF16) = ComplexF16($func(ComplexF32(a))) end atan(a::Float16,b::Float16) = Float16(atan(Float32(a),Float32(b))) -cbrt(a::Float16) = Float16(cbrt(Float32(a))) sincos(a::Float16) = Float16.(sincos(Float32(a))) for f in (:sin, :cos, :tan, :asin, :atan, :acos,