June 2019
Intermediate to advanced
218 pages
5h 19m
English
So, the first thing to do is to find a better algorithm, one that can replace the exponentiation into multiplications. This can be done by Horner's method, which is named after the nineteenth-century British mathematician, William George Horner:

Here, b0 is the value of the p(x) polynomial.
function poly_horner(x, a...) b=zero(x) for i = length(a):-1:1 b = a[i] + b * x end return b end
f_horner(x) = poly_horner(x, 1,2,3,4,5,6,7,8,9) julia> ...
Read now
Unlock full access