%mathpiper,def="HasFuncArith"

/// Analyse arithmetic expressions

HasFuncArith(expr, atom) := HasFuncSome(expr, atom, {ToAtom("+"), ToAtom("-"), *, /});

%/mathpiper



%mathpiper_docs,name="HasFuncArith",categories="User Functions;Predicates"
*CMD HasFuncArith --- check for expression containing a function
*STD
*CALL
	HasFuncArith(expr, func)

*PARMS

{expr} -- an expression

{func} -- a function atom to be found

*DESC

{HasFuncArith} is defined through {HasFuncSome} to look only at arithmetic operations {+}, {-}, {*}, {/}.

Note that since the operators "{+}" and "{-}" are prefix as well as infix operators, it is currently required to use {ToAtom("+")} to obtain the unevaluated atom "{+}".

*E.G.

In> HasFuncArith(x+y*Cos(Ln(x)/x), Cos)
Result: True;
In> HasFuncArith(x+y*Cos(Ln(x)/x), Ln)
Result: False;

*SEE HasFunc, HasFuncSome, FuncList, VarList, HasExpr
%/mathpiper_docs