Skip to content

Commit 280d6f2

Browse files
committed
Add muladd as a special case
1 parent dca5f38 commit 280d6f2

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/function_registration.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ end
5555
# special cases
5656
Base.:^(x::Expression,y::T) where T <: Integer = Operation(Base.:^, Expression[x, y])
5757
Base.:^(x::Expression,y::T) where T <: Rational = Operation(Base.:^, Expression[x, y])
58+
Base.muladd(a::Expression, b::Expression, c::Expression) = a * b + c
5859

5960
@register Base.getindex(x,i)
6061
Base.getindex(x::Operation,i::Int64) = Operation(getindex,[x,i])

test/direct.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,5 @@ function test_worldage()
8181
f_iip(out,[1.0,2,3])
8282
end
8383
test_worldage()
84+
85+
@test muladd(x, y, z) == x * y + z

0 commit comments

Comments
 (0)