Here is the equivalent code in julia

```
function evalpoly(x, p::Tuple)
if @generated
N = length(p.parameters)
ex = :(p[end])
for i in N-1:-1:1
ex = :(muladd(x, $ex, p[$i]))
end
ex
else
_evalpoly(x, p)
end
end
```

This code is very similar to the lisp code you wrote. But there is one major difference: nowhere can you find the equivalent of `double-float`

. In fact the `evalpoly`

will generate optimized code for whatever coefficient types or x type you use.

For everything an integer:

```
julia> @code_native evalpoly(1, (1,2,3))
.text
; ┌ @ math.jl:131 within `evalpoly'
movq 16(%rsi), %rax
; │┌ @ math.jl:132 within `macro expansion'
; ││┌ @ promotion.jl:404 within `muladd'
; │││┌ @ int.jl:88 within `*'
imulq %rdi, %rax
; │││└
; │││┌ @ int.jl:87 within `+'
addq 8(%rsi), %rax
; │││└
; │││┌ @ int.jl:88 within `*'
imulq %rdi, %rax
; │││└
; │││┌ @ int.jl:87 within `+'
addq (%rsi), %rax
; ││└└
retq
nopw %cs:(%rax,%rax)
; └└
```

If x is a double:

```
julia> @code_native evalpoly(1.0, (1,2,3))
.text
; ┌ @ math.jl:131 within `evalpoly'
; │┌ @ math.jl:132 within `macro expansion'
; ││┌ @ promotion.jl:358 within `muladd'
; │││┌ @ promotion.jl:298 within `promote'
; ││││┌ @ promotion.jl:276 within `_promote'
; │││││┌ @ number.jl:7 within `convert'
; ││││││┌ @ float.jl:94 within `Float64'
vcvtsi2sdq 16(%rdi), %xmm1, %xmm1
vcvtsi2sdq 8(%rdi), %xmm2, %xmm2
; │││└└└└
; │││ @ promotion.jl:358 within `muladd' @ float.jl:339
vfmadd231sd %xmm1, %xmm0, %xmm2 # xmm2 = (xmm0 * xmm1) + xmm2
; │││ @ promotion.jl:358 within `muladd'
; │││┌ @ promotion.jl:298 within `promote'
; ││││┌ @ promotion.jl:276 within `_promote'
; │││││┌ @ number.jl:7 within `convert'
; ││││││┌ @ float.jl:94 within `Float64'
vcvtsi2sdq (%rdi), %xmm3, %xmm1
; │││└└└└
; │││ @ promotion.jl:358 within `muladd' @ float.jl:339
vfmadd213sd %xmm1, %xmm2, %xmm0 # xmm0 = (xmm2 * xmm0) + xmm1
; ││└
retq
nopl (%rax)
; └└
and so on. If for some types, there is a better algorithm? Just specify another algorithm and multiple dispatch will do its thing. That is, in my opinion, the beauty of Julia.
```