Skip to content

Commit

Permalink
Merge branch 'master' of github.com:JuliaLang/julia
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Feb 4, 2015
2 parents afed989 + a58b607 commit cc46cf5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions base/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ clamp{T}(x::AbstractArray{T}, lo, hi) =
macro horner(x, p...)
ex = esc(p[end])
for i = length(p)-1:-1:1
ex = :($(esc(p[i])) + t * $ex)
ex = :(muladd(t, $ex, $(esc(p[i]))))
end
Expr(:block, :(t = $(esc(x))), ex)
end
Expand All @@ -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 cc46cf5

Please sign in to comment.