Skip to content

Commit

Permalink
more trig in float.jl (#37)
Browse files Browse the repository at this point in the history
* Update float.jl

* more trig functions
  • Loading branch information
JeffreySarnoff authored Feb 2, 2022
1 parent 5d882e5 commit 5d3ad39
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/float.jl
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,19 @@ Base.inv(x::StaticFloat64{N}) where {N} = fdiv(one(x), x)
static(exponent(M))
end

for f in (:sin, :cos, :tan, :asin, :atan, :acos,
:sinh, :cosh, :tanh, :asinh, :acosh, :atanh,
:exp, :exp2, :exp10, :expm1, :log, :log2, :log10, :log1p,
:cbrt)
for f in (:rad2deg, :deg2rad, :cbrt,
:mod2pi, :rem2pi, :sinpi, :cospi,
:exp, :exp2, :exp10, :expm1,
:log, :log2, :log10, :log1p,
:sin, :cos, :tan, :sec, :csc, :cot,
:asin, :acos, :atan, :asec, :acsc, :acot,
:sind, :cosd, :tand, :secd, :cscd, :cotd,
:asind, :acosd, :atand, :asecd, :acscd, :acotd,
:sinh, :cosh, :tanh, :sech, :csch, :coth,
:asinh, :acosh, :atanh, :asech, :acsch, :acoth,
)

@eval @generated function (Base.$f)(::StaticFloat64{M}) where {M}
Expr(:call, Expr(:curly, :StaticFloat64, $f(M)))
end
end
end

0 comments on commit 5d3ad39

Please sign in to comment.