Property
evfun
When a function F has the evfun
property,
the expressions ev(expr, F)
and expr, F
(at the interactive prompt)
are equivalent to F(ev(expr))
.
If two or more evfun
functions F, G, etc., are specified,
the functions are applied in the order that they are specified.
The expression declare(F, evfun)
gives the evfun
property to the function F.
The functions which have the evfun
property by default are the following:
bfloat
,
factor
,
fullratsimp
,
logcontract
,
polarform
,
radcan
,
ratexpand
,
ratsimp
,
rectform
,
rootscontract
,
trigexpand
, and
trigreduce
.
Examples:
(%i1) x^3 - 1; 3 (%o1) x - 1 (%i2) x^3 - 1, factor; 2 (%o2) (x - 1) (x + x + 1) (%i3) factor (x^3 - 1); 2 (%o3) (x - 1) (x + x + 1) (%i4) cos(4 * x) / sin(x)^4; cos(4 x) (%o4) -------- 4 sin (x) (%i5) cos(4 * x) / sin(x)^4, trigexpand; 4 2 2 4 sin (x) - 6 cos (x) sin (x) + cos (x) (%o5) ------------------------------------- 4 sin (x) (%i6) cos(4 * x) / sin(x)^4, trigexpand, ratexpand; 2 4 6 cos (x) cos (x) (%o6) - --------- + ------- + 1 2 4 sin (x) sin (x) (%i7) ratexpand (trigexpand (cos(4 * x) / sin(x)^4)); 2 4 6 cos (x) cos (x) (%o7) - --------- + ------- + 1 2 4 sin (x) sin (x) (%i8) declare ([F, G], evfun); (%o8) done (%i9) (aa : bb, bb : cc, cc : dd); (%o9) dd (%i10) aa; (%o10) bb (%i11) aa, F; (%o11) F(cc) (%i12) F (aa); (%o12) F(bb) (%i13) F (ev (aa)); (%o13) F(cc) (%i14) aa, F, G; (%o14) G(F(cc)) (%i15) G (F (ev (aa))); (%o15) G(F(cc))