julia> f1( (a, b, c, d) ) = a - b * c * d
f1 (generic function with 1 method)
julia> f1( [1, 2, 3, 4] )
-23
(Note the double parentheses in the definition of f1
.)
An iterative method like Newton–Raphson converges (maybe) to the correct result, but never actually gets there, so I think it’s hopeless to expect the true rational result without symbolic methods.
The convention in Julia is that functions begin with lower-case letters, so nest
.
nest.(..., 0:10)
is inefficient since you’re recalculating everything each time.
There’s some way to write this with higher-order functions but I don’t remember how.