Skip to content

Commit

Permalink
muladd in evalpoly macro
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne committed Jan 22, 2015
1 parent 45a27da commit 399b05b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions base/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ macro evalpoly(z, p...)
for i = length(p)-2:-1:1
ai = symbol("a", i)
push!(as, :($ai = $a))
a = :($b + r*$ai)
b = :($(esc(p[i])) - s * $ai)
a = :(muladd(r, $ai, $b))
b = :(-muladd(s, $ai, -$(esc(p[i]))))
end
ai = :a0
push!(as, :($ai = $a))
Expand All @@ -72,7 +72,7 @@ macro evalpoly(z, p...)
:(r = x + x),
:(s = x*x + y*y),
as...,
:($ai * tt + $b))
:(muladd($ai, tt, $b))
R = Expr(:macrocall, symbol("@horner"), :tt, p...)
:(let tt = $(esc(z))
isa(tt, Complex) ? $C : $R
Expand Down

0 comments on commit 399b05b

Please sign in to comment.