Skip to content

Commit 176f1e8

Browse files
Katharine Hyattwsmoses
authored andcommitted
Add simple trig functions
1 parent 89f507f commit 176f1e8

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/internal_rules/bigfloat.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,6 @@ EnzymeRules.@easy_rule(/(a::BigFloat, b::Number), (one(a)/b, -(a/b^2)))
8080
EnzymeRules.@easy_rule(/(a::Number, b::BigFloat), (one(a)/b, -(a/b^2)))
8181
EnzymeRules.@easy_rule(/(a::BigFloat, b::BigFloat), (one(a)/b, -(a/b^2)))
8282
EnzymeRules.@easy_rule(Base.inv(a::BigFloat), (-(one(a)/a^2),))
83+
EnzymeRules.@easy_rule(Base.sin(a::BigFloat), (cos(a),))
84+
EnzymeRules.@easy_rule(Base.cos(a::BigFloat), (-sin(a),))
85+
EnzymeRules.@easy_rule(Base.tan(a::BigFloat), (one(a) + Ω^2,))

test/rules/internal_rules/bigfloat.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@ using Test
2626
end
2727
for TR in (Const, Duplicated), TA in (Const, Duplicated)
2828
test_forward(inv, TR, (a, TA))
29+
test_forward(sin, TR, (a, TA))
30+
test_forward(cos, TR, (a, TA))
31+
test_forward(tan, TR, (a, TA))
2932
end
3033
end

0 commit comments

Comments
 (0)