diff --git a/src/ComposableExpression.jl b/src/ComposableExpression.jl index 0666e1bb5..185e6e5cf 100644 --- a/src/ComposableExpression.jl +++ b/src/ComposableExpression.jl @@ -372,7 +372,7 @@ function Base.literal_pow(::typeof(^), x::ValidVector, ::Val{p}) where {p} end for op in ( - :sin, :cos, :tan, :sinh, :cosh, :tanh, :asin, :acos, + :sin, :cos, :tan, :sinh, :cosh, :tanh, :asin, :acos, :atan, :asinh, :acosh, :atanh, :sec, :csc, :cot, :asec, :acsc, :acot, :sech, :csch, :coth, :asech, :acsch, :acoth, :sinc, :cosc, :cosd, :cotd, :cscd, :secd, :sinpi, :cospi, :sind, :tand, :acosd, :acotd, :acscd, :asecd, :asind, diff --git a/test/test_composable_expression.jl b/test/test_composable_expression.jl index a67a8a03c..1db032fd1 100644 --- a/test/test_composable_expression.jl +++ b/test/test_composable_expression.jl @@ -94,9 +94,13 @@ end # Test unary operations on ValidVector @test sin(x).x ≈ sin.([1.0, 2.0, 3.0]) @test cos(x).x ≈ cos.([1.0, 2.0, 3.0]) + @test atan(x).x ≈ atan.([1.0, 2.0, 3.0]) @test abs(x).x ≈ [1.0, 2.0, 3.0] @test (-x).x ≈ [-1.0, -2.0, -3.0] + # Test binary atan (atan2) + @test atan(y, x).x ≈ atan.([0.0, 2.0, 4.0], [1.0, 2.0, 3.0]) + # Test propagation of invalid flag invalid_x = ValidVector([1.0, 2.0, 3.0], false) @test !((invalid_x + 2.0).valid)