forked from Aurelius-Nero/Maxima-References
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIteration.wxm
44 lines (35 loc) · 1.38 KB
/
Iteration.wxm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/
/* [ Created with wxMaxima version 22.04.0 ] */
/* [wxMaxima: input start ] */
/* Date: Fri Jun 17 16:42:57 WEST 2005 */
/* Contributor: Stavros Macrakis */
/* Description: Iterates n times f over the initial point x */
composen(f,n,x):=if n=0 then x else f(composen(f,n-1,x))$
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
/* Date: Fri Jul 7 23:45:18 WEST 2006 */
/* Contributor: Raindrop */
/* Description: Iterates b times f over the initial point a */
nest(f,a,b):=block(
[erg],
erg:a,
for tmp:0 while tmp<b do (
erg:f(erg)
),
return(erg)
)$
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
/* Date: Sun Jul 9 17:26:16 WEST 2006 */
/* Contributor: Barton Willis */
/* Description: Iterates n times f over the initial point x */
nest(f,x,n) := if n = 0 then x else nest(f, funmake(f,[x]), n-1);
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
/* Date: Wed Sep 3 11:32:50 WEST 2008 */
/* Contributor: John Lapeyre */
/* Description: Iterates n times f% over the initial point x */
nest(f%,x,n) := if n=0 then x else if n=1 then apply(f%,[x]) else apply(f%,[nest(f%,x,n-1)]);
/* [wxMaxima: input end ] */
/* Old versions of Maxima abort on loading files that end in a comment. */
"Created with wxMaxima 22.04.0"$