Online Algebra Calculator
Many of users do not use powerful Maxima computer algebra system for systematic work, but for ad hoc algebraic calculations – equations, functions, matrixes, etc. only. To do this job, it is not useful to download the whole application from a web site.
Function: lreduce (<F>, <s>)
![Lreduce Example declare (F, nary);
F ([L]) := L;
xreduce (F, [a, b, c, d, e]);
G ([L]) := L;
xreduce (G, [a, b, c, d, e]);
lreduce (G, [a, b, c, d, e]);](http://maxima-online.org//plot.html?g=i1521184752.png&t=img&db=r1134124142)
Function: lreduce (<F>, <s>, <s_0>) Extends the binary function <F> to an n-ary function by composition, where <s> is a list.
lreduce(<F>, <s>) returns F(... F(F(s_1, s_2), s_3), ... s_n). When the optional argument <s_0> is present, the result is equivalent to lreduce(<F>, cons(<s_0>, <s>)).
The function <F> is first applied to the leftmost list elements, thus the name "lreduce".
See also rreduce, xreduce, and tree_reduce.
Examples:
lreduce without the optional argument.
(%i1) lreduce (f, [1, 2, 3]);
(%o1) f(f(1, 2), 3)
(%i2) lreduce (f, [1, 2, 3, 4]);
(%o2) f(f(f(1, 2), 3), 4) lreduce with the optional argument.
(%i1) lreduce (f, [1, 2, 3], 4);
(%o1) f(f(f(4, 1), 2), 3) lreduce applied to built-in binary operators. / is the division operator.
(%i1) lreduce ("^", args ({a, b, c, d}));
b c d
(%o1) ((a ) )
(%i2) lreduce ("/", args ({a, b, c, d}));
a
(%o2) -----
b c d(%o1) true (%i2)