TPK algorithm: Difference between revisions

Content deleted Content added
m Modified Groovy implementation
Line 286:
tpk <- function(S = scan(nmax=11), t=rev(S)) sqrt(abs(t))+5*t^3
</source>
The last implementation makes use of the [[lazy evaluation]] mechanism of R for default values of parameters: <code>t</code> is evaluated only the first time it is used in a computation, after which <code>t</code> is well defined.
 
===[[Ruby (programming language)|Ruby]]===