Skip to content

Commit

Permalink
Add trivial tests for binary operations involving two TaylorScalar
Browse files Browse the repository at this point in the history
  • Loading branch information
facusapienza21 committed Nov 22, 2024
1 parent 6a90c01 commit f172fac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/primitive.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ end
# end
end

@testset "Multi-argument functions" begin
@test derivative(x -> 1 + 1/x, 1.0, Val(1))-1.0 rtol=1e-6
@test derivative(x -> (x+1)/x, 1.0, Val(1))-1.0 rtol=1e-6
@test derivative(x -> x/x, 1.0, Val(1)) 0.0 rtol=1e-6
end

@testset "Corner cases" begin
offenders = (
TaylorScalar(Inf, (1.0, 0.0, 0.0)),
Expand Down

0 comments on commit f172fac

Please sign in to comment.