Skip to content

Commit

Permalink
enable new Float16 methods for sinh and cbrt (JuliaLang#40534)
Browse files Browse the repository at this point in the history
From JuliaLang#39432 and JuliaLang#39441, these were still using their old definition due
to method overwriting.
  • Loading branch information
vtjnash authored and ElOceanografo committed May 4, 2021
1 parent d8b6dbf commit cb73abe
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions base/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1195,21 +1195,20 @@ 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)))
$func(a::ComplexF16) = ComplexF16($func(ComplexF32(a)))
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,
Expand Down

0 comments on commit cb73abe

Please sign in to comment.